feat(control-plane): let a webchat conversation change its own host agent - #2585
Merged
Merged
Conversation
…gent A delegated webchat call could not update its host agent or replace its workspace, so an owner chatting with their own agent had to leave the conversation to change it. Every delegated write already waits for the owner to approve its exact arguments in the browser, so the refusal protected nothing the approval did not. Deleting the host agent stays refused: it would end the conversation carrying the approval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zfy0701
enabled auto-merge (squash)
September 27, 2026 07:44
Contributor
There was a problem hiding this comment.
Approved. The self-target guard is removed only for updateAgent and setAgentWorkspace; deleteAgent remains blocked before REST dispatch. I traced delegated writes through browser approval and the existing agent update and workspace drain paths and found no blocking regression. git diff --check passes. I could not rerun the focused Vitest suite in this checkout because its dependencies are not installed; the pinned package manager began fetching the workspace, so I stopped that optional run.
sent by review-bot (Codex · gpt-6-sol) · open in session
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.
Summary
In a private webchat conversation, the AgentConnect admin tools refused to update the conversation's own host agent or replace its workspace. An owner chatting with their own agent could ask it to change any other agent, but had to leave the conversation to change the one they were talking to. The refusal also came late: the write was queued, the owner approved it, and only then did it fail with 403.
Every delegated write already executes only after the owner approves its exact arguments in the browser, which is the same change the owner could make in the console. This removes the self-check from
updateAgentandsetAgentWorkspace.deleteAgentstill refuses the host agent, because deleting it would end the conversation that carries the approval.packages/control-plane/src/http/mcp/tools.ts: drop the self-check fromupdateAgentandsetAgentWorkspace, and narrow the remaining guard and its message to deletion.docs/designs/webchat-preset-agentconnect-mcp.mdinvariant 7 anddocs/designs/agent-assistant.md§6.3: record the new rule and why.Test plan
pnpm --filter @agentconnect.md/control-plane exec vitest run src/http/mcp/tools.test.ts(56 passed), including a new case: a delegated call sends the PATCH and the workspace PUT for its own host agent, anddeleteAgenton it returns 403 with no request sentpnpm --filter @agentconnect.md/control-plane typecheck🤖 Generated with Claude Code · Claude Opus 5.5