Skip to content

Rename multi-agent v2 close_agent to interrupt_agent#26994

Merged
jif-oai merged 1 commit into
mainfrom
jif/close_interrupt
Jun 8, 2026
Merged

Rename multi-agent v2 close_agent to interrupt_agent#26994
jif-oai merged 1 commit into
mainfrom
jif/close_interrupt

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Why

close_agent is 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

  • Rename the multi-agent v2 tool from close_agent to interrupt_agent.
  • Keep the v1 close_agent surface unchanged.
  • Update the v2 handler to send Op::Interrupt, keep interrupted agents registered, and reject root/self targets with interrupt-specific errors.
  • Route interrupt delivery through the existing dead-thread cleanup path so stale resident entries do not keep consuming capacity.
  • Update tool planning and handler tests for the new v2 surface and semantics.

Verification

Added focused coverage in:

  • core/src/tools/spec_plan_tests.rs
  • core/src/tools/handlers/multi_agents_tests.rs

@jif-oai jif-oai requested a review from a team as a code owner June 8, 2026 12:25
@jif-oai jif-oai changed the title feat: close to interrupt Rename multi-agent v2 close_agent to interrupt_agent Jun 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review


P2 Badge Emit interrupt-specific collaboration events

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".

Comment thread codex-rs/core/src/tools/handlers/multi_agents_v2/interrupt_agent.rs
@jif-oai

jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

For the record, event emission will change to fit the new UX

@jif-oai jif-oai merged commit 8d41505 into main Jun 8, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/close_interrupt branch June 8, 2026 12:46
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant