Skip to content

Coalesce consecutive tool-failure recovery audits into one count - #886

Closed
TheGreatAxios wants to merge 5 commits into
cl-7642-detect-verbatim-tool-markupfrom
cl-7648-coalesce-tool-failure-interventions
Closed

Coalesce consecutive tool-failure recovery audits into one count#886
TheGreatAxios wants to merge 5 commits into
cl-7642-detect-verbatim-tool-markupfrom
cl-7648-coalesce-tool-failure-interventions

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Coalesces consecutive tool-failure recovery audits into a single director-memory record with a count when the pending recovery nudge is applied
  • Keeps recovery nudge text and arming behavior the same; forensics treats a missing count as one

Verification

  • Focused tests for tool-failure intervention coalescing passed
  • bun run check blocked by known pre-existing main failures

Fixes CL-7648

@linear-code

linear-code Bot commented Sep 10, 2026

Copy link
Copy Markdown

CL-7648

@TheGreatAxios
TheGreatAxios force-pushed the cl-7642-detect-verbatim-tool-markup branch from 4a695dc to 3e213d3 Compare September 11, 2026 01:04

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review · Request changes

Unique coalesce patch arms once and writes one JSONL line when the recovery infer is issued. Do not merge until this is rebased onto current 885 (3e213d30).

Findings

  • Three-dot still contains stale parent 4a695dce. Current 885 is 3e213d30 (docs + extra tests). nudge-director.test.ts conflicts on merge-tree.
  • src/subagent/nudge-director.ts:405-410 — deferred flush only in applyPendingNudge after an infer is present. Cancel/destroy or compact-without-infer drops audits that used to log at arm time.
  • Tests only cover fail+fail+ok → count 2. No single-failure or all-fail batch.

Notes

GitHub blocks request-changes on own PRs, so this is a comment with that verdict.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Critic · Request changes

16a5570f is the unique commit. Stack still carries old 885 tip.

Findings

  • Merge-base with current origin/cl-7642 is 57226a72, not 885 HEAD.
  • Flush only after infer (nudge-director.ts:502-514); compact return at :414-419 skips apply.
  • intervention-log.ts docs say omit count for one; writer always writes count when counter > 0.

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.
Several failed tool.done events before the pending recovery nudge is
consumed were each writing a separate intervention line. Keep the
recovery nudge text and arming behavior the same, but count the burst
in director memory and flush a single record with count when the nudge
is applied. Forensics treats missing count as one.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7648-coalesce-tool-failure-interventions branch from ff61185 to 5e0241a Compare September 11, 2026 03:11
@TheGreatAxios
TheGreatAxios deleted the branch cl-7642-detect-verbatim-tool-markup September 11, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant