Rename multi-agent v2 close_agent to interrupt_agent#26994
Conversation
There was a problem hiding this comment.
💡 Codex Review
When interrupt_agent runs through the app-server/history path, these CollabClose* events are still converted to CollabAgentTool::CloseAgent in app-server-protocol/src/protocol/thread_history.rs and event_mapping.rs. That makes an interrupt appear in clients/history as a close operation, and unloaded agents with NotFound status are marked failed even though this tool returns success. Please add/use an interrupt-specific event/tool mapping rather than reusing close events.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
For the record, event emission will change to fit the new UX |
Why
close_agentis the wrong model-facing name for the v2 operation after the residency changes. V2 agents remain reusable by task name, and residency/unloading owns capacity management; the exposed tool should describe the action it actually performs: interrupt the target agent's current turn without making the agent unavailable for future messages or follow-up tasks.What changed
close_agenttointerrupt_agent.close_agentsurface unchanged.Op::Interrupt, keep interrupted agents registered, and reject root/self targets with interrupt-specific errors.Verification
Added focused coverage in:
core/src/tools/spec_plan_tests.rscore/src/tools/handlers/multi_agents_tests.rs