Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui,docs): make the file-support command runnable as pasted

Jose Ramireze0f48921893e
diff --git a/control-ui/app/communication-channels/new/page.tsx b/control-ui/app/communication-channels/new/page.tsx
index 0a16b83ae..481e6a3af 100644
--- a/control-ui/app/communication-channels/new/page.tsx
+++ b/control-ui/app/communication-channels/new/page.tsx
@@ -222,7 +222,8 @@ export default function CreateCommunicationChannelPage() {
}, [draft.teamsAppName, teamsWebhookUrl])
// Substituted with CLIENT_ID once it is pasted, which on a teams-managed bot IS
// the app id (the Teams App ID, Bot ID and CLIENT_ID are one UUID). Before that
- // it renders the <appId> placeholder, so the command is readable either way.
+ // it renders a named placeholder rather than an angle-bracket one, which sh and
+ // zsh would treat as a redirect and fail on confusingly.
const teamsSupportsFilesCommand = useMemo(
() => buildTeamsSupportsFilesCommand(draft.teamsAppId),
[draft.teamsAppId]
@@ -809,10 +810,12 @@ export default function CreateCommunicationChannelPage() {
</li>
<li>Paste CLIENT_ID, TENANT_ID, and CLIENT_SECRET below.</li>
<li>
- To deliver workflow files, enable them on the manifest. The{' '}
- <code>--yes</code> is required; without it the command changes nothing
- and still looks like it worked. File delivery works in a direct chat
- only, not in a channel.
+ To deliver workflow files, enable them on the manifest. Paste CLIENT_ID
+ above first and this command fills itself in: the Teams App ID, the Bot
+ ID and CLIENT_ID are all the same value, written to <code>.env</code> by
+ the command above. The <code>--yes</code> is required; without it the
+ command changes nothing and still looks like it worked. File delivery
+ works in a direct chat only, not in a channel.
<CommandBlock
command={teamsSupportsFilesCommand}
onCopy={copyTeamsSupportsFilesCommand}
diff --git a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx
index d52bc4eac..a8b6d045e 100644
--- a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx
+++ b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx
@@ -294,8 +294,10 @@ describe('CreateCommunicationChannelPage — provider setup', () => {
expect(items[0].querySelector('pre')).toHaveTextContent('teams app create')
expect(items[1].querySelector('pre')).toBeNull()
+ // Named placeholder, never `<appId>`: angle brackets are a redirect in sh and
+ // zsh, so pasting the command unedited fails with "no such file or directory".
expect(items[2].querySelector('pre')).toHaveTextContent(
- "teams app manifest update <appId> --set-json 'bots[0].supportsFiles=true' --yes"
+ "teams app manifest update YOUR_CLIENT_ID --set-json 'bots[0].supportsFiles=true' --yes"
)
})
diff --git a/control-ui/lib/__tests__/teamsSetup.test.ts b/control-ui/lib/__tests__/teamsSetup.test.ts
index 0c1d84320..6b52ffd43 100644
--- a/control-ui/lib/__tests__/teamsSetup.test.ts
+++ b/control-ui/lib/__tests__/teamsSetup.test.ts
@@ -112,6 +112,11 @@ describe('buildTeamsSupportsFilesCommand', () => {
})
it('falls back to a placeholder app id', () => {
- expect(buildTeamsSupportsFilesCommand()).toContain('<appId>')
+ // Never an angle-bracket placeholder: `<appId>` is a redirect in sh and zsh,
+ // so pasting the command unedited fails with "no such file or directory".
+ const cmd = buildTeamsSupportsFilesCommand()
+ expect(cmd).toContain('YOUR_CLIENT_ID')
+ expect(cmd).not.toContain('<')
+ expect(cmd).not.toContain('>')
})
})
diff --git a/control-ui/lib/teamsSetup.ts b/control-ui/lib/teamsSetup.ts
index 475a5a934..ac62ba1b8 100644
--- a/control-ui/lib/teamsSetup.ts
+++ b/control-ui/lib/teamsSetup.ts
@@ -95,7 +95,17 @@ export function buildTeamsAppCreateCommand(params: { botName: string; endpoint:
* Enabling file delivery is a manifest property, not a Developer Portal toggle.
* Older guidance points at App features > Bot > "Upload and download files",
* which the current portal does not present.
+ *
+ * The app id is CLIENT_ID: on a teams-managed bot the Teams App ID, the Bot ID
+ * and CLIENT_ID are all the same UUID. So once the operator has pasted
+ * CLIENT_ID into this form, the command is complete and needs no editing.
+ *
+ * The fallback is deliberately NOT an angle-bracket placeholder. `<appId>` is a
+ * redirect in sh and zsh, so pasting it unedited fails with
+ * "no such file or directory: appId" rather than anything that points at the
+ * real problem.
*/
export function buildTeamsSupportsFilesCommand(appId?: string): string {
- return `teams app manifest update ${appId?.trim() || '<appId>'} --set-json 'bots[0].supportsFiles=true' --yes`
+ const id = appId?.trim() || 'YOUR_CLIENT_ID'
+ return `teams app manifest update ${id} --set-json 'bots[0].supportsFiles=true' --yes`
}
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 042b36d76..8a0d6564b 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.426",
+ "version": "0.1.427",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.426",
+ "version": "0.1.427",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index 0edfb7234..7024d9f74 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.426",
+ "version": "0.1.427",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/docs/how-to/connect-teams.md b/docs/how-to/connect-teams.md
index 97a0aa7a5..8872099e4 100644
--- a/docs/how-to/connect-teams.md
+++ b/docs/how-to/connect-teams.md
@@ -155,6 +155,10 @@ or a screenshot.
Workflow results are delivered as files, which the bot cannot send unless the
manifest allows it.
+`YOUR_CLIENT_ID` below is the `CLIENT_ID` from your `.env`. On a teams-managed
+bot the Teams App ID, the Bot ID and `CLIENT_ID` are the same UUID, so any of
+the three works and there is nothing extra to look up.
+
> **Files only work in a one to one chat.** Microsoft's file consent APIs, which
> this uses, are documented as working in the `personal` context only and not in
> `channel` or `groupchat`. A workflow that produces a file will deliver it in a
@@ -163,7 +167,7 @@ manifest allows it.
> you will conclude it is broken when it is behaving as designed.
```shell
-teams app manifest update <appId> --set-json 'bots[0].supportsFiles=true' --yes
+teams app manifest update YOUR_CLIENT_ID --set-json 'bots[0].supportsFiles=true' --yes
```
**`--yes` is load-bearing.** Without it the command prints "Manifest update
@@ -172,7 +176,7 @@ it worked. The global `-y` you passed to `teams app create` does not carry over.
Confirm against the server rather than trusting the exit code:
```shell
-teams app manifest download <appId> ./verify.json
+teams app manifest download YOUR_CLIENT_ID ./verify.json
```
Expect `bots[0].supportsFiles` to be `true` and the manifest version to have
@@ -184,7 +188,7 @@ and older guidance pointing at App features > Bot > "Upload and download files"
describes a UI that the portal no longer presents. If you would rather not use
the CLI, edit the manifest directly under Configure > **App package editor**.
-`teams app doctor <appId>` is a useful checkpoint. It reports whether the
+`teams app doctor YOUR_CLIENT_ID` is a useful checkpoint. It reports whether the
endpoint is reachable and shows `Sign-in audience: AzureADMyOrg` for a correctly
registered single-tenant bot.
@@ -270,7 +274,7 @@ flow when it is not.
**Nothing arrives, but the channel saved.** Almost always the endpoint. Confirm
the registered endpoint matches the channel's current name, and that the origin
-is publicly reachable. `teams app doctor <appId>` reports reachability.
+is publicly reachable. `teams app doctor YOUR_CLIENT_ID` reports reachability.
A wrong endpoint is not fatal. The messaging endpoint stays editable in the
[Teams Developer Portal](https://dev.teams.microsoft.com/apps). Only
@@ -296,7 +300,7 @@ printed link; it bypasses the catalog lookup that is failing. Or wait a short
while and regenerate the link:
```shell
-teams app get <appId> --install-link
+teams app get YOUR_CLIENT_ID --install-link
```
**The bot cannot get a token.** An `AADSTS` error means the app is multi-tenant.