CL-6946 part 2: delete prose-based sub-agent stop-reason matchers - #610
Merged
TheGreatAxios merged 1 commit intoAug 24, 2026
Merged
Conversation
…rt 2) Replaces prose-matching of forced-stop reports (isXxxSubAgentReport family, per-reason parent hint functions, classifyBriefSalvage(string)) with a structured ForcedStopReason value threaded through runSubAgent's return and the task tool result's detail field. The parent chat director and task-tool dispatch path now classify salvage outcomes and select hint text from that typed value instead of parsing report text.
This was referenced Aug 24, 2026
TheGreatAxios
added a commit
that referenced
this pull request
Aug 27, 2026
…rt 2) (#610) Replaces prose-matching of forced-stop reports (isXxxSubAgentReport family, per-reason parent hint functions, classifyBriefSalvage(string)) with a structured ForcedStopReason value threaded through runSubAgent's return and the task tool result's detail field. The parent chat director and task-tool dispatch path now classify salvage outcomes and select hint text from that typed value instead of parsing report text.
TheGreatAxios
added a commit
that referenced
this pull request
Aug 27, 2026
…rt 2) (#610) Replaces prose-matching of forced-stop reports (isXxxSubAgentReport family, per-reason parent hint functions, classifyBriefSalvage(string)) with a structured ForcedStopReason value threaded through runSubAgent's return and the task tool result's detail field. The parent chat director and task-tool dispatch path now classify salvage outcomes and select hint text from that typed value instead of parsing report text.
TheGreatAxios
deleted the
cl-6946-part2-delete-the-prose-report-matchers
branch
August 28, 2026 00:09
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
Threads the structured
ForcedStopReasonthrough the sub-agent dispatch path instead of re-deriving it by parsing the returned report's prose.runSubAgentnow returns{ report, stopReason? }instead of a bare string;stopReasonis set whenever the run ends via a forced stop (turn budget, no-progress, never-acted, never-edited, deadline, cancelled, stalled, repetition, incomplete-report).SubAgentDirectorexposes the reason viaobserveForcedStop, wired intorunSubAgent's return.task-tool.tsclassifies the salvage outcome and selects the parent hint fromresult.stopReasondirectly, and stampsToolResult.detail.stopReasonso the parent chat director can do the same without parsing tool-result content.classifyBriefSalvageis now(input: { stopReason?, wasCancelled }) => BriefSalvageKind | null— a trivial passthrough, no string/regex matching anywhere.appendSubAgentParentHintsnow switches on the structured reason instead of re-parsing report text.src/agent/director.ts's hard-block-salvage nudge (previouslyclassifyBriefSalvage(toolResultContentString)) now reads the same structureddetail.stopReasonoff the tool result.Deleted
isForcedStopSubAgentReportand every per-reason wrapper (isTurnBudgetSubAgentReport,isNeverActedSubAgentReport,isNeverEditedSubAgentReport,isDeadlineSubAgentReport,isRepetitionSubAgentReport,isNoShipSubAgentReport,isNoProgressSubAgentReport,isStalledSubAgentReport,isCancelledSubAgentReport,isIncompleteReportSubAgentReport).appendTurnBudgetParentHint,appendNeverActedParentHint,appendNeverEditedParentHint,appendDeadlineParentHint,appendNoShipParentHint,appendRepetitionParentHint,appendNoProgressParentHint(folded into one structured switch inappendSubAgentParentHints).parseSubAgentReportimport frombrief-dispatch.ts's consumer path (the genuinely different completeness-gate use ofhasReportEnvelopeinstop-policy.ts— checking the model's own final turn for a report envelope as a nudge trigger — is unrelated and kept).classifyBriefSalvagedecides from the structured value with no text involved.Not touched
The sibling lanes (CL-6994, CL-6995) hadn't landed on
mainas of this branch, so nothing described in the ticket was already removed — all theForcedStopReasonvariants and their prose renderers inFORCED_STOP_SUMMARIESare still present; only the classification path changed.Net diff
git diff --stat origin/main...HEAD: 18 files changed, 302 insertions(+), 339 deletions(-) — net −37 lines.Test plan
bun test src/subagent/index.test.ts src/agent/director.test.ts src/subagent/run-authority.test.ts src/subagent/agent-fleet.test.ts src/subagent/task-tool-worktree.test.ts src/perf/permission-subagent-spans.test.ts tests/unit/subagent-session-store.test.ts tests/unit/subagent.test.ts tests/unit/telemetry-product-events.test.ts— 250 pass, 0 failbunx tsc --noEmit— cleanbun run check— lint/typecheck/build pass; 8 pre-existing failures in unrelated integration suites (git-push-scoped, late-MCP-dispatch, reactor-permission-multi-turn) — timing/network flakes untouched by this change