Repository navigation
refactor(agents): unify CLI spawn/live failure policy lanes - #122164
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
Author
|
Land-ready proof for exact head
Production LOC is +229/-232 (net -3); tests are +57/-0. Local Testbox delegation was unavailable because the Blacksmith CLI and managed broker authentication were unavailable; the documented trusted-source local fallback ran, and exact-head hosted CI supplied the final remote gate. Broad aggregate-only shared-state/order failures were isolated to untouched fixtures; each implicated owning suite and exact-head CI passed. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 12, 2026
steipete
added a commit
that referenced
this pull request
Aug 12, 2026
…2432) Supervisor-capture tests asserted real telegram/slack channel ids, so their pass/fail depended on which channel plugins the selected vitest lane loads (stubs when focused, real normalizers under unit-fast); switch to a neutral synthetic channel. Two embedded-runner tests carried a shared literal /tmp/openclaw.sqlite storePath — one actually opened it, colliding with stale artifacts across parallel runs; both now use realpath'd auto-cleaned per-test temp dirs. Evidence in PR #122164 body; pre-fix aggregates failed 12/1202 (cli) and 4/4750 (embedded), post-fix green in default and shuffled order.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 13, 2026
…nclaw#122432) Supervisor-capture tests asserted real telegram/slack channel ids, so their pass/fail depended on which channel plugins the selected vitest lane loads (stubs when focused, real normalizers under unit-fast); switch to a neutral synthetic channel. Two embedded-runner tests carried a shared literal /tmp/openclaw.sqlite storePath — one actually opened it, colliding with stale artifacts across parallel runs; both now use realpath'd auto-cleaned per-test temp dirs. Evidence in PR openclaw#122164 body; pre-fix aggregates failed 12/1202 (cli) and 4/4750 (embedded), post-fix green in default and shuffled order.
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.
What Problem This Solves
Resolves a maintenance and reliability problem where the CLI spawn and persistent-live lanes made the same watchdog and abnormal-exit decisions through duplicated, subtly different predicates. That divergence could make equivalent quiet failures recover differently depending on which CLI transport was selected.
Why This Change Was Made
This change gives both lanes one CLI-owned no-output decision module and one exit-classification adapter backed by the shared failover substrate. It also routes final raw CLI errors through
coerceToFailoverError, word-bounds unsupported checkpoint-flag detection, and documents whycli_max_turnsremains reachable at the embedded failover boundary.Predicate differences were adjudicated as follows:
lastOutputAtMs === nullcode assignment with the same replay-safety facts used by spawn.allowResumeControlOnlyRetryinput. The persistent live parser can distinguish init/control traffic from replay-unsafe assistant/tool activity; spawn supervision cannot.outstandingWorkGraceMsinput. The persistent live lane still owns tracked work and may extend to the blocked-tool floor; the spawn child is already terminated when classification runs.CliTimeoutContextconstruction are shared.candidatesinput. Spawn can classify bounded stderr/stdout parse windows and diagnostic tails; live stdout is structured and consumed before exit, so live supplies stderr only.emptyReasoninput. A clean live exit before a terminal record is a protocol-levelempty_response; an output-free nonzero exit remainsunknown.cli_unknown_empty_failurein both lanes, including quiet nonzero live exits.The removed alternatives were a consumer-side guard, a lane-selecting wrapper over the old branches, and preserving the CLI-local text classifier. Each would have left duplicate retry authority or classification policy in place.
User Impact
No new configuration or public API. Equivalent CLI failures now produce consistent structured failover behavior across spawn and persistent-live execution, while replay-unsafe tool/output activity remains protected from automatic recovery.
Production LOC: +229/-232 (net -3). Tests: +57/-0.
Evidence
node scripts/run-vitest.mjs src/agents/cli-runner.fault-sequences.e2e.test.ts— 10/10 passed.node scripts/run-vitest.mjs src/agents/cli-runner.reliability.test.ts— 86/86 passed; the new word-bound regression failed before the matcher fix and passes after it.node scripts/run-vitest.mjs src/agents/cli-runner/execute.supervisor-capture.test.ts— 52/52 passed.node scripts/run-vitest.mjs src/agents/cli-runner/claude-live-process.test.ts src/agents/cli-runner/claude-live-turn.test.ts src/agents/cli-runner/claude-live-turn-diagnostics.test.ts— 57/57 passed.node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/failover-policy.test.ts— 47/47 passed.node scripts/check-changed.mjs --timed— passed all changed gates after the remote backend was unavailable and the documented trusted-source local fallback ran.pnpm check:import-cyclesandpnpm check:madge-import-cycles— 0 cycles.pnpm build— passed.git diff --checkand changed-file formatting — passed.Broad local aggregate notes:
src/agents/cli-runnerpassed 1184/1196, with 12 order-sensitive target-normalization assertions in supervisor capture; that owning file passes 52/52 alone and the target-normalization surface is untouched here. The embeddedrun/aggregate passed 4724/4728; all four failures were the same hard-coded/tmp/openclaw.sqliteschema-16 artifact under four configs, unrelated to the two-line failover-policy comment.AI-assisted implementation; reviewed and verified by the maintainer workflow.