@koda-sl/baker-bridge 0.109.0-dev.f28c07bd2 → 0.109.0-dev.fbf7b641a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -48,6 +48,7 @@ await server.start();
48
48
  | `BAKER_ACTING_USER_ID` | Injected into the Agent SDK subprocess env per turn (when the turn's sender is known) so in-sandbox `baker` CLI calls can scope work to the acting user — e.g. `baker mcp add --scope user` |
49
49
  | `CLAUDE_CODE_ENABLE_TASKS` | Set to `0` on every Agent SDK subprocess. Turns off the CLI's built-in task backlog and its `task_reminder` — see [Session surface](#session-surface) |
50
50
  | `CLAUDE_CODE_MODEL_CAPABILITIES` | Set to `-per_turn_effort` on every Agent SDK subprocess so no request carries a per-message effort, which OpenRouter cannot route to Bedrock — see [Bedrock is the preferred provider](#bedrock-is-the-preferred-provider) |
51
+ | `ENABLE_TOOL_SEARCH` | Set to `true` on every Agent SDK subprocess. MCP tool schemas are deferred to their names until the agent loads one with `ToolSearch`; the CLI would otherwise load every schema into every request, because it switches tool search off behind a non-first-party `ANTHROPIC_BASE_URL` — see [MCP servers (Composio)](#mcp-servers-composio) |
51
52
  | `NO_COLOR` | Set to `1` on every Agent SDK subprocess so `baker --help` output carries no ANSI escapes — see [Session surface](#session-surface) |
52
53
  | `BAKER_AGENT_MODEL` | Optional. Runs every turn in this runtime on the named model instead of the default, and is forwarded to subagents as `CLAUDE_CODE_SUBAGENT_MODEL`. Ignored unless it names a model with a known context window — see [Model selection](#model-selection) |
53
54
  | `CLAUDE_CODE_SUBAGENT_MODEL`, `CLAUDE_CODE_SUBAGENT_MODEL_FORCE` | Set on the Agent SDK subprocess only when `BAKER_AGENT_MODEL` is set. Together they override the `model:` each subagent pins in its own frontmatter |
@@ -284,6 +285,8 @@ When the agent *does* call `request_avatar_casting` for the avatar a pending cas
284
285
 
285
286
  Before each turn the bridge fetches the company's scoped Composio MCP endpoints from Convex — `POST {BAKER_CONVEX_SITE_URL}/api/chat/mcp-servers` with the bridge's `BAKER_API_KEY` bearer, sending `{ threadId, actingUserId? }`. The response `{ mcpServers }` map (up to four streamable-HTTP entries: `composio_user`, `composio_user_org`, `composio_company`, `composio_org` — plus any custom servers) is passed straight into `options.mcpServers`. No Composio secret is injected into the sandbox env; the capability URLs live only in the bridge process.
286
287
 
288
+ Connected servers are deferred behind tool search (`ENABLE_TOOL_SEARCH=true`): each request carries their tool names, and a tool's schema enters the prompt only once the agent searches for it. A large toolkit (Make exposes ~180 tools) therefore costs its names, not ~115k tokens on every request. `baker_ui` is the exception — it sets `alwaysLoad`, so its forms are always one call away.
289
+
287
290
  The fetch is resilient by design: results are cached per `(thread, actor)` for 60s, and a failed or timed-out refetch (2.5s) serves the last set that `(thread, actor)` received, however old — the tool list is part of the prompt, so dropping it mid-chat would rewrite the prompt cache. Only an actor that never fetched successfully in that chat runs the turn with **no** MCP; nothing here fails a turn. The actor is part of the key because personal connections (`user`, `user_org`, per-user custom-server sign-ins) belong to the person sending the message, so a teammate's turn never reuses them. When the Agent SDK reports an MCP server failed to connect, the bridge fires `POST /api/chat/mcp-invalid`: a `composio_*` entry is reported by scope, so Convex re-mints that scope's session on the next turn, and a custom server is reported by name (`customServerName`), so Convex re-checks its address and records why it failed instead of the entry being silently dropped.
288
291
 
289
292
  ### Tool mentions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-bridge",
3
- "version": "0.109.0-dev.f28c07bd2",
3
+ "version": "0.109.0-dev.fbf7b641a",
4
4
  "description": "HTTP server wrapping the Claude Agent SDK. Persists chat events to Convex; the dashboard subscribes via Convex realtime",
5
5
  "license": "MIT",
6
6
  "type": "module",