CedarCopilot wants to merge 2 commits into staging from fix/chat-path-agentid-propagation
Live on prod, no production signal yet
Libra has verdicts on 0 of 8 tracked behaviors on prod; 8 are still being checked. Libra checks hourly for 3 days after each deploy.
Phase 1 of docs/design/unify-agent-dispatch-paths.md.
On the autonomous dispatch path ("Path A" , on-event triggers, cron, before-meeting), every dispatch tool resolves the real per-agent UUID and sets it on RequestContext before running. That's what lets updateConversationFieldsTool's field-ownership check (ownerId !== runningAgentId) tell who's actually calling.
On the chat/on-demand path ("Path B"), this was broken: run-chat-agent-sdk.ts and chat-workflow.ts set agentId to hardcoded literal strings ('chat-agent-sdk-apply' / 'chat-agent') regardless of which named agent was actually bound or delegated to. Since runningAgentId could never equal a real stamped ownerAgentId, field-ownership enforcement failed closed , silently blocking every agent from writing an owned field (statusOverview, nextSteps), including the legitimate owner , for every chat interaction, always.
request-context.ts already resolved the bound agent's real id (an earlier commit, confirmed via git blame) , added an explicit override hook and propagated it through the two remaining hardcoded-literal call sites.agentId (delegate-tool-scoping.ts), since the Agent SDK's tool handler has no per-invocation correlator back to the calling subagent otherwise.This entire code path is already gated behind the OFF-by-default cedar-claude-code-sdk PostHog flag , this fix doesn't introduce new production exposure, it closes a real gap inside an already-conservative gate.
One residual, documented limitation: the per-agent AgentDefinition.tools/mcpServers scoping mechanism is built from the SDK's documented type surface, but can't be exercised against a live @anthropic-ai/claude-agent-sdk query() run in this sandbox (no network/API key in CI). Recommend a manual smoke test in staging (with the flag on for a test account) before merging, since this is the one part static review and unit tests can't fully close the loop on.
pnpm --filter @zero/server run types , cleanpnpm exec vitest run across every touched test dir , 145 tests, all passingpnpm dlx oxlint@1.78.0 --deny-warnings , cleanpnpm deps:check , 0 violationscedar-claude-code-sdk on for a test account, verifying a bound-chat and a Task-delegated agent each get the correct field-ownership behaviorš¤ Generated with Claude Code
https://claude.ai/code/session_01E3AhwqADAFeqe9wEhz6Mk7
This PR propagates real playbook agent IDs through both bound-chat and named-delegate execution, preserves that provenance across deferred mutation approval, and normalizes per-agent MCP tool names for frontend rendering.
The PR should not merge until generated delegate server names cannot be overwritten by user MCP servers a
Libra has not measured any production surfaces for this change yet.