Repository navigation
[ENG-21904][ENG-21905] fix(agents): timed-out sub-agents resume late and recovered overflows show a false error - #313
Merged
Conversation
A sub-agent run that hit its run timeout switched to the next fallback model with a fresh full timeout. The gateway aborted that attempt about a minute later, so the extra model time was lost. A later orphan scan then cleared the end time of the timed-out run and resumed it. The resumed child sent the parent out-of-date corrections minutes or hours after the task had been reported as timed out. A turn that hit the mid-turn context precheck and recovered still showed "The run hit an error before it could finish" next to the real answer, and Sentry counted the recovered attempt as an error. The precheck also fired when it did not need to. The request copy of a large tool result kept about 250,000 characters, but the session file kept 64,000. Recovery truncated the session file, found nothing to cut, and ran a full compaction. Fix each cause: - After the attempt's own run deadline fires, the embedded runner no longer rotates the auth profile or switches to a fallback model. It surfaces the timeout. An idle model stall still falls back. The failover decision log records timedOutByRunDeadline. - Orphan recovery no longer reopens a run that the registry already ended as a timeout. Runs that a restart interrupts stay unended and still resume. - The deferred lifecycle error of the reply runner and of the agent command follows the last finishing event. A recovered retry ends the run normally. A failed last attempt still fails the run. - The sentry-monitor plugin reports an attempt that ends with the precheck error as a warning message with the same fingerprint. - The tool-result context guard caps the text of each result in the request copy with the same rule as the persisted copy. Images are kept. Trade-offs: - Callers with no outer deadline (cron, queued follow-ups, heartbeat, local CLI) no longer get a fallback attempt after the run deadline. - An overflow that recovery cannot fix is now a Sentry warning. The user still gets the explicit overflow reply. Upstream took the other direction for the run deadline and renews the gateway deadline for each fallback attempt (openclaw#141869). A later upstream sync must reconcile the two.
The embedded runner now has a TODO for the timeout-triggered compaction retry after the run deadline. The repo lints TODO comments as errors, so the line above it disables eslint/no-warning-comments. The production suppression allowlist test lists every such suppression, so add the new one.
a-bernike
approved these changes
Oct 29, 2026
orswn
added a commit
that referenced
this pull request
Oct 30, 2026
…advice (#315) When a long reply turn fails, the progress-nudge runner posts one notice: "The run hit an error before it could finish. You can send the request again, or narrow it into a smaller batch." Two cases make that notice wrong. The Boon web channel plugin already posts its own outcome for every turn it dispatches: the reply, a failure message, or a halt row with Retry or Continue. The core notice then lands next to that row. It duplicates the plugin's failure message, or it contradicts a halt row that the backend later retries on its own. In production, almost every Boon web notice had a plugin or agent row in the same second. A turn can also fail while sub-agents that it spawned keep running. Their results still reach the user later, so "send the request again" makes the user repeat work that is already in progress. Add an optional ChannelCapabilities.reportsTurnOutcome flag. When the delivery target's channel plugin declares it, the runner logs and skips the terminal failure notice before any edit or send. Channels without the flag keep the notice. When live sub-agent work spawned by the failed turn remains, the notice uses the existing subagent_still_working copy instead of the resend advice. Sub-agents from earlier turns do not count, so an unrelated failed turn still gets the resend advice. Progress nudges do not change. Add a regression test for a false notice fixed in #313: a mid-turn precheck error, then a recovered attempt that ends with sessions_yield. The run must end, not fail. The test fails when the reply runner keeps the earlier finishing error. Related: ENG-21129
orswn
added a commit
that referenced
this pull request
Nov 2, 2026
Cut the fork release for the 6 PRs merged to boon since v2026.6.35-boon.2: - #313 (ENG-21904, ENG-21905): no fallback after the run deadline, no late replies from timed-out sub-agents, and no false error notice after a recovered context precheck. - #314 (ENG-21269): a parent that yielded keeps finished sub-agent results on later wakes. - #315 (ENG-21129): skip the failure notice on channels that report their own turn outcome, and say the work continues while the failed turn's sub-agents still run. - #311: qs override 6.16.1 (CVE-2026-82417). - #317: follow-redirects override 1.16.2 (GHSA-mrwp-f3q8-3g9p). - #312: Docker base digests to Node 24.22.1. Bump the root package.json and npm-shrinkwrap.json, all 136 bundled plugin manifests (scripts/sync-plugin-versions.ts), and the version and openclaw peer floor in every extension npm-shrinkwrap.json. Add the 2026.6.35-boon.3 CHANGELOG.md section. No source or dependency change beyond what already merged in the PRs above.
orswn
added a commit
that referenced
this pull request
Nov 2, 2026
Cut the fork release for the 6 PRs merged to boon since v2026.6.35-boon.2: - #313 (ENG-21904, ENG-21905): no fallback after the run deadline, no late replies from timed-out sub-agents, and no false error notice after a recovered context precheck. - #314 (ENG-21269): a parent that yielded keeps finished sub-agent results on later wakes. - #315 (ENG-21129): skip the failure notice on channels that report their own turn outcome, and say the work continues while the failed turn's sub-agents still run. - #311: qs override 6.16.1 (CVE-2026-82417). - #317: follow-redirects override 1.16.2 (GHSA-mrwp-f3q8-3g9p). - #312: Docker base digests to Node 24.22.1. Bump the root package.json and npm-shrinkwrap.json, all 136 bundled plugin manifests (scripts/sync-plugin-versions.ts), and the version and openclaw peer floor in every extension npm-shrinkwrap.json. Add the 2026.6.35-boon.3 CHANGELOG.md section. No source or dependency change beyond what already merged in the PRs above.
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.
Related: ENG-21904, ENG-21905
What Problem This Solves
Fixes two problems in long agent turns on customer boxes.
Why This Change Was Made
Each fix targets one cause, and each keeps the existing behavior for other cases.
timedOutByRunDeadlineflag, which only the deadline timer sets, and theembedded_run_failover_decisionlog line shows it.timeoutoutcome,endedAt, sessionabortedLastRun) as an old restart interruption. It clearedendedAtand resumed the run. That rule is removed. Runs that a restart interrupts already stay unended, so restart resume still works.finishingerror for the whole run. They now follow the lastfinishingevent. A recovered retry ends withend. A failed last attempt still fails the run.agent_endwith the precheck error as awarningmessage. The fingerprint does not change, so the existing issue keeps its history.Trade-offs:
This diverges from upstream. Upstream renews the gateway deadline for each fallback attempt (openclaw#141869), which can multiply the wall time of a turn by the length of the fallback chain. A later upstream sync must reconcile the two.
Not in this PR:
agents.defaults.timeoutSeconds.TODOmarks it.User Impact
Evidence
node scripts/run-vitest.mjs: every changed test file passes, plusmodel-fallback.run-embedded.e2e.test.ts. Each new behavior test failed on the base commit first.tsgo(core, core tests, extensions, extension tests),oxlint,oxfmt --check, the import-cycle check, andgit diff --checkpass.timeoutSeconds, compaction, and progress nudge settings), driven through the Boon web chat with a real model. Each scenario ran on the base commit first, then on this branch, with the same input. To keep runs short, the sub-agent run timeout was set to 60 s and the context window to 100,000 tokens.surface_errorwithtimedOutByRunDeadline: true77 ms after the deadlineresumed orphaned session; a late "Correction" message in the parent chatendedAtand thetimeoutoutcomeexception, levelerrormessage, levelwarning, same fingerprintwarningSummary by cubic
Fixes two long-turn agent failures: timed-out sub-agents no longer come back later with stale corrections, and turns that recover from a context overflow no longer show a false error next to the answer.
Behavior changes
finishingevent defines the run's lifecycle error, so a recovered retry ends the run normally while a failed last attempt still fails it.Trade-offs
Written for commit cd1a366. Summary will update on new commits.