Skip to content

Commit 4e79442

Browse files
committed
docs(spec): App.defaultAgent names the agent route as the chat door, read by the console
The docblock said the assistant chat endpoint resolves this agent from context.appName. The cloud AI runtime retired that route; the agent route is the one chat door and the console's surface resolver is the reader. actions-as-tools.mdx drops the retired route from its chat-route callout. Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent c9761cd commit 4e79442

3 files changed

Lines changed: 27 additions & 12 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
`App.defaultAgent` docblock: the agent route is the one chat door, and the console is what reads the key.
6+
7+
Clause-②: no
8+
9+
- The docblock no longer says the assistant chat endpoint (`POST /api/v1/ai/assistant/chat`) resolves this agent from `context.appName`. That route, with `GET /api/v1/ai/assistant` and `GET /api/v1/ai/assistant/skills`, was retired in the cloud AI runtime (objectstack-ai/cloud#2621, objectstack-ai/cloud#2651), and no server route reads `defaultAgent`.
10+
- It now says who does read it. The console's chat dock hands the active app's `defaultAgent` to its one surface-to-agent resolver, which honours only `ask` or `build` (legacy aliases included) and otherwise falls back to the surface default. The resolved agent is then called by name on `POST /api/v1/ai/agents/:agentName/chat`, where the path segment, not this key, selects the agent.
11+
- The ADR-0063 surface-binding paragraph and the rule that only the two platform agents resolve are unchanged, as is the note that the bare `POST /api/v1/ai/chat` resolves no agent.
12+
- The docs page `ai/actions-as-tools` lists the agent route as the only in-product chat route.
13+
- ⛔ No schema, parse, `.describe()`, export, type or accept-set change. The docblock ships in the published `dist` type declarations, which is why this is a patch.

‎content/docs/ai/actions-as-tools.mdx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,9 @@ action into AI only when its logic is safe to run on behalf of anyone the
271271
capability gate admits.
272272

273273
<Callout type="info">
274-
**ObjectOS** — the in-product chat routes
275-
(`/api/v1/ai/assistant/chat`, `/api/v1/ai/agents/:agentName/chat`) resolve the
276-
authenticated principal from `req.user` — both cookie session
277-
(`better-auth.session_token`) and Bearer token are handled — and forward it to
274+
**ObjectOS** — the in-product chat route, `/api/v1/ai/agents/:agentName/chat`,
275+
resolves the authenticated principal from `req.user` — both cookie session
276+
(`better-auth.session_token`) and Bearer token are handled — and forwards it to
278277
`aiService.chatWithTools(...)` as
279278
`toolExecutionContext: { actor, conversationId, environmentId }`. That threads the
280279
same RLS context through the runtime's built-in data tools and its

‎packages/spec/src/ui/app.zod.ts‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,15 +1655,18 @@ export const AppSchema = lazySchema(() => strictObject(
16551655
/**
16561656
* Default agent for this app's ambient chat surface.
16571657
*
1658-
* When set, the assistant chat endpoint (`POST /api/v1/ai/assistant/chat`)
1659-
* resolves this agent for a call carrying `context.appName`, without the
1660-
* user having to pick from a list — that route is what drives the
1661-
* resolution chain (explicit agent > `defaultAgent` of the named app >
1662-
* first active agent).
1658+
* The console's agent surfaces read this key; no server route does. The
1659+
* chat dock hands the active app's `defaultAgent` to the console's one
1660+
* surface→agent resolver (objectui `surfaceAgent.ts`, called from
1661+
* `ChatDock.tsx`), which honours it only when it names `ask` or `build`
1662+
* (legacy aliases included) and otherwise falls back to the surface
1663+
* default. The agent it resolves is then called by name on the agent route,
1664+
* `POST /api/v1/ai/agents/:agentName/chat` — the one chat door, where the
1665+
* `:agentName` path segment, not this key, selects the agent.
16631666
*
1664-
* The bare `POST /api/v1/ai/chat` route is NOT part of that chain: it
1665-
* resolves no agent and never reads `context.appName`, so this key does not
1666-
* scope it. Do not read this key as a guarantee over that endpoint.
1667+
* The bare `POST /api/v1/ai/chat` route resolves no agent at all, so this
1668+
* key does not scope it either. Do not read this key as a guarantee over
1669+
* any endpoint.
16671670
*
16681671
* ADR-0063 §1/§2 — this is a SURFACE-BINDING knob, not a custom-agent
16691672
* slot: the resolvable values are the two platform agents (`ask` for a

0 commit comments

Comments
 (0)