Repository navigation
feat(j5): retire j5_stop_agent for t3_thread_interrupt with the Captain's rule - #982
Merged
Merged
Conversation
…in's rule Agents now stop another agent with upstream's t3_thread_interrupt, whose stop: true is the full Stop. J5 re-declares it with upstream's description and parameters and one rule: a Captain stopping a seat of its own Crew skips upstream's check that the target runs within the caller's modes. Every other caller, outside agents included, gets upstream's declaration and handler. An agent's stop: true now records "Stopped by an agent", as j5_stop_agent did, where upstream's would read as the user's. Crew stop's refusal names the new tool, and t3_thread_interrupt takes j5_stop_agent's place in the pre-approved tools. Closes #955. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
This review includes 22 billable files and costs up to $5.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 9 minutes for your next included review. View limit details
|
thread.stop queues the delegated-task stop only when a delegate has a thread here. Upstream's handler calls stopDelegatedTasks after it with the same command, which also ends delegates on a linked machine and retries a failed stop; the Captain's path now does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
7 of 8 tasks
This branch was successfully deployed
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.
Problem
The agent-tool rulings of 2026-11-07 (register D2) retire
j5_stop_agent. Since v0.1.7, upstream'st3_thread_interruptwithstop: trueis the same full Stop. The only thing J5's tool still added was the Captain's exemption: a Captain may stop its own seats whatever their access. Closes #955.What changed
t3_thread_interrupt(j5/a2a/mcp/orchestratorSurface.ts,threadInterrupt.ts) with upstream's description, parameters and result as shipped. Its handler adds one rule. When the caller is the Captain of the live Crew seat the target holds, the call stops or interrupts with no mode check and noDispatchModeLimit. Every other caller, outside agents included, gets upstream's ownwritesThreadsdeclaration andOrchestratorMcpService.interruptThread.McpToolAccess.ts. So FORK.md case 2 gainseitherBythere: upstream'seither, picked by an effect. A call bound for a linked environment takes upstream's check.stop: truepasses the reason as given, so a Stop without one reads "Stopped by user" in the timeline (upstream's own comment says agent callers always set one). J5 words it as upstream words an interrupt, "Stopped by an agent", asj5_stop_agentdid.j5_stop_agentis gone: the tool, its handler and its tests.t3_thread_interrupttakes its place in the pre-approved tools (j5ToolPreapproval.ts), so a read-only or approval-neverCaptain can still stop its seats. Thej5_stop_crewand Crew-stop refusals now namet3_thread_interruptwithstop: true.orchestratorSurface.test.ts. It covers a non-Captain refused on a broader seat, upstream's path within the caller's modes, a Captain stopping a broader seat with no limit (replay included), and a Captain's plain interrupt. The case fails on this branch with the Captain check disabled. The oldj5_stop_agentcases inhandlers.test.tsandoutsideAgent.test.tsare removed, because the outside-agent path is now upstream's unchanged. The env-gated Luna live test stops through upstream's service.agentContextBudget.jsonshrinks by 772 bytes of tool list.docs/j5/product/a2a/agent-tools.mdalready describes this (docs(j5): the agent tools after linked environments #954). FORK.md, the migration runbook,upstream-convergence.mdand the A2A README are updated.Text agents read (for Jackson before merge)
t3_thread_interruptkeeps upstream's description, unchanged: "Interrupt a top-level thread's running turn. NorunId: newest running turn. No effect when idle. For a delegate, usetask_cancel." Upstream's schema doesn't describestopto the model either; agents see only the parameter name. The live test checks whether models find it.orchestrationInstructions.ts) are unchanged. They never namedj5_stop_agent, and their existing clause ("Stop a delegate run you replace or no longer need withtask_cancel, nevert3_thread_interrupton achildThreadId") still fits.j5_stop_crewby a non-Captain: "Only a Crew's Captain stops it: message the Captain with j5_send_message, or stop one agent with t3_thread_interrupt and stop: true."CrewStopService.ts): "Ask the Captain with j5_send_message, or stop one agent with t3_thread_interrupt and stop: true."t3_thread_interrupt(withstop: trueto stop an agent) in place ofj5_stop_agent.Live testing
Pass for the paths exercised, on an isolated test server with real Claude Haiku and GPT Luna turns (tester seat, reports
artifacts/test-reports/982/).cd042a907b): told only to stop a peer's work, Haiku and Luna each choset3_thread_interruptwithstop: trueon their own.cd042a907b): a Supervised Captain stopped an active Full-access seat. A non-Captain agent in a narrower mode was refused on a broader target.9761be5f37): Luna stopped an agent with a real queued follow-up. The queue was held (queueHeld: true, the follow-up never started), and Resume ran it. A held turn restarted correctly.9761be5f37, the review fix): a Supervised Captain stopping a Full-access seat also stopped that seat's live Haikudelegate_taskdelegate.9761be5f37, because that code didn't change.interrupt_requestedwith the seat's already-completed run. That follows upstream's Stop, which reaches the last run while background work is pending, and the delegate did stop.Upstream impact
apps/server/src/mcp/McpToolAccess.ts: addseitherBy(FORK.md case 2, file-table row already present). Upstream's own tools are unchanged.t3_thread_interruptis no longer registered from upstream's toolkit (upstreamCatalog.ts). J5 registers its re-declaration, as decided in register D2 (Jackson, 2026-11-07; record).Checklist
FORK.md(case text and file-table row) in this PRBuilt by Claude Opus 5.5 in Claude Code (J5 Code crew builder seat).
🤖 Generated with Claude Code