Clarify same-context subcommand boundaries - #419
Conversation
Automated Review: Clarify same-context subcommand boundariesCriticalNone. ImportantF1: A terminal report and delegation in the same tool batch can start subcommand work after completion has been committed. The new report-pending gate in I ran a disposable Agent-loop probe with the relevant shape: let reported = false;
const tools = [
{ name: "delegate", execute: async () => ({ content: [{ type: "text", text: reported ? "rejected" : "delegated-body" }] }) },
{ name: "status", execute: async () => { reported = true; return { content: [{ type: "text", text: "completed" }], terminate: true }; } },
];
// First model response: [delegate(), status()]; second response: ordinary assistant text.Observed output: {"streamCalls":2,"reported":true,"toolResults":["delegated-body","completed"],"lastText":"continued-after-report"}This contradicts the new contract that “no more subcommand work may start” once terminal status is pending and can delay routing while additional work runs under reported lifecycle state. Enforce terminal reporting at the tool-batch boundary (rather than relying only on execution-time state), and add real Agent-loop regressions for both SuggestionsS1: Make delegate-only routing diagnostics lifecycle-aware. S2: Strengthen the report-pending no-mutation regression with populated state. The test at Strengths
Solution Assessment
Reviewed by GPT-5.6 Sol This is an automated review. |
Independent Review AssessmentAssessing review comment: #419 (comment) No finding was subsequently discussed, resolved, or deferred in the PR conversation. ClassificationsF1 — Genuine issueOriginal finding: A terminal report and delegation in the same tool batch can start subcommand work after completion has been committed. The problem is real: model tools run in parallel by default ( Sound fix approach: Add a backward-compatible unconditional batch-termination mode for accepted terminal reports, preserving the current all-results rule for ordinary S1 — NitpickOriginal finding: Make delegate-only routing diagnostics lifecycle-aware. The wording is misleading and worth a small correction. Idle suggestion validation tells the agent to use S2 — NitpickOriginal finding: Strengthen the report-pending no-mutation regression with populated state. The existing case starts with empty stack/sidebar/journal state ( Summary
Solution Assessment
Staged Implementation PlanRequired Stage 1 — Enforce terminal tool-batch completion (F1)
Optional Stage 2 — Correct lifecycle-specific diagnostics (S1)
Optional Stage 3 — Preserve populated rejection state (S2)
Assessed by GPT-5.6 Sol |
|
Addressed review findings F1, S1, and S2 in commit
Verification: full build, typecheck, lint, and all 2,275 workspace tests pass. The termination mode deliberately does not cancel sibling tools; it waits for their normal finalization and persisted result artifacts before stopping the provider loop. Reviewed by GPT-5.6 Sol |
Summary
delegatecallable after a neutral 44-trial real-runtime evaluation and clarify that the current agent executes returned subcommand instructions immediately in the same conversation.Test plan
npm run typechecknpm run buildnpm testnpm run lintFixes #413