Nudge once when assistants print tool-call markup as text - #885
Merged
Conversation
TheGreatAxios
force-pushed
the
cl-7642-detect-verbatim-tool-markup
branch
from
September 11, 2026 01:04
4a695dc to
3e213d3
Compare
TheGreatAxios
commented
Sep 11, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review · Comment
One verbatim-markup nudge per no-real-tool epoch. Markup check runs before complete-envelope stop policy.
Findings
src/subagent/nudge-director.ts:314-329—hasVerbatimToolCallMarkupreturns beforeevaluateSubAgentStop. A valid four-heading envelope that also quotes<tool_call><function=…>becomes a nudge (subagent-verbatim-tool-call-nudge) instead of complete. A later clean envelope still completes.
TheGreatAxios
commented
Sep 11, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Critic · Comment
Epoch flag does not increment toolLessNarrationCycles. Thinking/XML stay on wrap-up. Flag clears on real tool_call and parent follow-up.
Findings
- Completeness is already owned by
hasReportEnvelopeinstop-policy.ts:156-167. Markup-first intercept can reopen a finished worker.
Models sometimes emit <tool_call><function=...> wrappers as assistant text instead of real tool_call blocks. Catch that narrow shape, give one corrective nudge per no-real-tool epoch without counting it as incomplete-report narration, then fall through to the existing report policy. Thinking blocks and arbitrary XML stay out of scope; the epoch resets only on genuine tool activity or a parent follow-up.
Document recovery of verbatim tool markup in fleet stop policy.
TheGreatAxios
force-pushed
the
cl-7642-detect-verbatim-tool-markup
branch
from
September 11, 2026 03:11
cdb3776 to
d172cd8
Compare
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
<tool_call>markup as text instead of a real tool_call block and issues one corrective nudge per no-real-tool epochVerification
bun test ./src/subagent/nudge-director.test.ts --randomize --seed 424242passes (25 tests)bun run checklint, typecheck, and build pass; remaining suite failures are pre-existing session/FS tests unrelated to this branchFixes CL-7642