Skip to content

feat(agent-applications): send supported_client_tools at /run#2942

Merged
benjackwhite merged 1 commit into
mainfrom
ben/agent-supported-client-tools
Jun 26, 2026
Merged

feat(agent-applications): send supported_client_tools at /run#2942
benjackwhite merged 1 commit into
mainfrom
ben/agent-supported-client-tools

Conversation

@benjackwhite

Copy link
Copy Markdown
Contributor

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): optional supportedClientTools, added to the /run body as supported_client_tools when non-empty.
  • AgentChatSession (core): carries supportedClientTools; agentChatService forwards it to runAgentSession.
  • useAgentChat (ui): new supportedClientTools option threaded into the session config (+ memo deps).
  • AGENT_BUILDER_CLIENT_TOOLS: declares the dock's fulfillable ids and is passed from AgentBuilderDock.

Tool-list cross-check

AGENT_BUILDER_CLIENT_TOOLS was verified against the agent-builder agent's spec.json kind:'client' declarations — they match exactly (8 ids, all required: false):

focus_tab, focus_file, focus_revision, focus_session, focus_spec_section, toast, get_context, set_secret

So 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_mcp is intentionally not included — it doesn't exist on main (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 typecheck green 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 the agent-mcp-connections branch).

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 9428abd.

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(agent-applications): send supported..." | Re-trigger Greptile

@benjackwhite benjackwhite requested a review from a team June 25, 2026 18:14
@benjackwhite benjackwhite marked this pull request as ready for review June 25, 2026 18:14
@benjackwhite benjackwhite merged commit 1c8d7d0 into main Jun 26, 2026
24 checks passed
@benjackwhite benjackwhite deleted the ben/agent-supported-client-tools branch June 26, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants