Repository navigation
fix(agents): narrow the unfinished-steps retry guard to actual committed mutations (ENG-18893) - #192
Conversation
…ted mutations (ENG-18893) The hadPotentialSideEffects check added in the previous fix was too broad: it is unconditionally true whenever an exec/bash/process tool was called at all (tool-replay-safety.ts never marks those replay-safe by default), which is true for every single attempt this retry exists to handle (isRecoverableExecClassToolName gates on exactly those tool names). The guard was silently defeating the retry for its own primary use case — confirmed live on a canary host (arief-openclaw-test): a solo failed exec call never retried at all, going straight to the fallback note. Narrowed shouldRetryUnfinishedSteps to the specific mutation evidence the original review finding actually described — a committed messaging-tool send, cron add, or session spawn — via hasMessagingToolDeliveryEvidence, hasAcceptedSessionSpawn, and successfulCronAdds, instead of the broad replay-safety flag. Re-verified live on the same canary host: the retry now fires correctly and resolves the turn without ever surfacing the 'steps didn't finish' note. Strengthened the existing unit + full-loop tests to include a realistic failed exec toolMeta entry (the previous tests used empty toolMetas, which is why they didn't catch this regression), plus new coverage for the narrowed guard.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…paths at the full-loop level (ENG-18893) cubic review flagged that the new full-loop coverage only exercised the messaging-tool branch of the committed-mutation guard; the other two evidence paths wired into hasCommittedMutation in run.ts (hasAcceptedSessionSpawn, successfulCronAdds > 0) were only proven at the unit level, so a wiring regression there would silently let retries fire after a committed cron add or session spawn -- the exact broad-suppression vs duplicate-mutation risk this PR exists to guard against.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/agents/embedded-agent-runner/run.incomplete-turn.test.ts">
<violation number="1" location="src/agents/embedded-agent-runner/run.incomplete-turn.test.ts:1649">
P3: The two new test titles embed the Linear ticket ID `(ENG-18893)`. Keep test titles focused on the behavior being asserted and drop the ticket reference, consistent with the established convention in this file that describe() blocks are ticket-free.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Keep test titles focused on the behavior being asserted rather than the Linear ticket; the ticket context lives in the commit message and PR body.
There was a problem hiding this comment.
Approve.
The fix correctly diagnoses #188: hadPotentialSideEffects decomposes to hadUnsafeTools || hadAsyncStartedTool || messaging || sessionSpawn || cronAdd, and hadUnsafeTools is unconditionally true for every exec/bash/process failure — i.e. every case isRecoverableExecClassToolName gates on — so the guard was firing 100% of the time it should have opened. Narrowing to hasCommittedMutation = messaging || sessionSpawn || cronAdd restores the retry for its intended cases while keeping the specific duplication risks #188 was right to flag.
Scope check: verified the other five sites still keying off the broad hadPotentialSideEffects (compaction-continuation, incomplete-turn-fallback-safe, isAttemptReplaySafe, etc.) are untouched — only the unfinished-steps retry gate is narrowed. Good.
Test coverage: the exec-toolMeta shape on the existing full-loop tests is the right regression-catcher (empty toolMetas is exactly what let the #188 regression through). The new cron-add and session-spawn full-loop cases close the gap cubic flagged.
One nit — not blocking:
hadAsyncStartedTool (a backgrounded exec) also drops out of the guard by construction. In practice the transcript carries the background session id so the model can poll rather than re-launch, but it's a deliberate line-drawing choice worth calling out in the field-doc comment alongside the hadUnsafeTools explanation — the current comment reads as if the only broad-flag contributor being excluded is the unreplayable-tool-presence one.
CI still cooking (many jobs IN_PROGRESS/QUEUED, cubic review IN_PROGRESS) — hold merge until it goes fully green, per usual.
…193) Cuts the next boon-fork release. On merge, tag v2026.6.11-boon.36 -> boon-release.yml builds & publishes openclaw-2026.6.11-boon.36.tgz (+ sibling plugin assets) -> the fleet deploy pipeline rolls it. Ships ENG-18893: the embedded run loop now silently retries a turn that ends with a real reply but an unrecovered exec-class tool failure (#188), with the retry guard corrected to key off actual committed mutations rather than the mere presence of an exec-class tool call (#192). Diff is mechanical pnpm release:prep output plus the CHANGELOG.md release section: - Root package.json boon.35 -> boon.36. - Lockstep extension package.json + npm-shrinkwrap.json synced to boon.36. - Regenerated release artifacts: plugin inventory/reference docs, plugin-sdk API baseline, config-baseline sha256. npm pack --dry-run verified end to end (build + changelog extraction + tarball assembly), version 2026.6.11-boon.36, exit 0.
What Problem This Solves
The
hadPotentialSideEffectsguard added toshouldRetryUnfinishedStepsin #188 (its own code-review fix) was too broad and silently defeated the retry it was supposed to only narrow — for its own primary use case.Why This Change Was Made
tool-replay-safety.tsnever marksexec/bash/processas replay-safe by default (they can run arbitrary commands), sohadPotentialSideEffectsistrueany time anexec-class tool was called at all — which is unconditionally true for every attempt this retry exists to handle (isRecoverableExecClassToolNamegates on exactly those tool names). The guard from #188 was therefore blocking the retry 100% of the time it should have fired.Confirmed live, not just in theory: deployed the merged
boonHEAD to a canary host (arief-openclaw-test) and drove a real turn through the real gateway (real model, realboon-llm-gateway→ Bedrock, realanychat-boon-webplugin) that fails a singleexeccall. Before this fix: zero retries, straight to the fallback note. After this fix:unfinished steps detected: ... retrying 1/2 with continuation nudge, then a clean resolution with no fallback note at all.The fix narrows the guard to the specific mutation evidence the original review finding actually described — a committed messaging-tool send, cron add, or session spawn (
hasMessagingToolDeliveryEvidence,hasAcceptedSessionSpawn,successfulCronAdds) — instead of the broad replay-safety flag that also covers the mere presence of an unreplayable tool call.The existing unit + full-loop tests didn't catch this because they used empty
toolMetasarrays — none of them modeled a real failedexeccall, which is exactly the shape production traffic has. Strengthened those tests to include a realistictoolMetas: [{ toolName: "exec" }]entry, plus new coverage for the narrowed guard (a committed messaging-tool send still blocks the retry; a solo exec failure with no other mutation does not).User Impact
Restores the actual intent of #188 — non-terminal
exec-class failures now silently retry as designed, without reopening the messaging/cron/session-spawn duplication risk the original review finding was right to flag.Evidence
node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo— clean.node scripts/run-oxlint-shards.mjs --threads=8— clean.node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run.incomplete-turn.test.ts— 118/118 passed, verified post-rebase onto latestorigin/boon.arief-openclaw-test(realboon-llm-gateway/Bedrock model, real gateway process) — before/after comparison above.Follows #188 (merged) on ENG-18893: https://linear.app/getboon/issue/ENG-18893/gemstone-industrial-proposal-generation-generic-one-step-didnt-finish
Summary by cubic
Fixes the unfinished-steps retry guard so a failed
execcall retries as designed instead of always falling through to the "steps didn't finish" note. The previoushadPotentialSideEffectscheck was unconditionally true for every attempt this retry exists to handle, which silently defeated the retry for its own primary use case (ENG-18893).hasCommittedMutationcheck limited to messaging-tool sends, cron adds, and session spawns.exectoolMeta entries, which the previous empty fixtures missed, and added full-loop coverage for the cron-add and session-spawn mutation paths.Written for commit 1ccaad4. Summary will update on new commits.