feat(agent-applications): send supported_client_tools at /run#2942
Merged
Conversation
Producer counterpart to the agent-platform server change that gates client-tool exposure on a per-run capability list. The agent-builder dock now declares the `kind:'client'` tool ids it can fulfil and sends them in the /run body as `supported_client_tools`, so the runner exposes only those to the model (spec ∩ supported). - `runAgentSession` (api-client): optional `supportedClientTools`, added to the /run body when non-empty. - `AgentChatSession` (core): carries `supportedClientTools`; `agentChatService` forwards it to `runAgentSession`. - `useAgentChat` (ui): new `supportedClientTools` option threaded into the session config. - `AGENT_BUILDER_CLIENT_TOOLS` declares the dock's fulfillable ids (set_secret, focus_*, toast, get_context) — verified to exactly match the agent-builder spec's `kind:'client'` tools — and is passed from the dock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat(agent-applications): send supported..." | Re-trigger Greptile |
dmarticus
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Producer counterpart to the agent-platform server change PostHog/posthog#66161, which makes the runner expose
kind:'client'tools to the model only if the caller declared them at/run(supported_client_tools). Without this, once the server change lands, code clients would send nothing and lose all client tools (focus_*, set_secret, toast, get_context).This wires the agent-builder dock to declare and send that list.
Changes
runAgentSession(api-client): optionalsupportedClientTools, added to the/runbody assupported_client_toolswhen non-empty.AgentChatSession(core): carriessupportedClientTools;agentChatServiceforwards it torunAgentSession.useAgentChat(ui): newsupportedClientToolsoption threaded into the session config (+ memo deps).AGENT_BUILDER_CLIENT_TOOLS: declares the dock's fulfillable ids and is passed fromAgentBuilderDock.Tool-list cross-check
AGENT_BUILDER_CLIENT_TOOLSwas verified against the agent-builder agent'sspec.jsonkind:'client'declarations — they match exactly (8 ids, allrequired: false):focus_tab, focus_file, focus_revision, focus_session, focus_spec_section, toast, get_context, set_secretSo every declared client tool is in the supported list (nothing dropped by the server's spec ∩ supported intersection), and none are
required(no session-open-fail risk).connect_mcpis intentionally not included — it doesn't exist onmain(it's part of the separate MCP-connections work).Compatibility
Order-independent with the server PR: an old server ignores the extra body field (Zod strips unknowns); an old client that omits the field just gets no client tools exposed.
Verification
turbo typecheckgreen for@posthog/api-client,@posthog/core,@posthog/ui; biome clean; pre-commit (biome + full typecheck) passed.Agent context
Authored from a Claude Code session, in an isolated worktree off
main. Scoped to the producer plumbing only (not the broader MCP feature on theagent-mcp-connectionsbranch).🤖 Generated with Claude Code