Skip to content

fix(update): preserve successful outcomes and warn about stopped channels - #169037

Merged
steipete merged 2 commits into
mainfrom
upd/upd-l1554
Oct 11, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/upd-l1554

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A result-publication error can make an already successful update report pending recovery and exit unsuccessfully. Separately, successful repair verification can hide channel accounts that remain stopped or suppressed.

User Impact

Updates already recorded as successful now emit a publication warning and exit 0. Repair reports identify stopped channel accounts without turning an otherwise working update into a failure. Disabled and unconfigured accounts are excluded.

Why This Change Was Made

The terminal publication owner trusts the durable success outcome before entering failure triage. The existing restart-health reader carries channel runtime warnings separately from channel probe errors, and verification uses the existing warning/report path. A shared snapshot path replaces duplicated managed/unmanaged result construction; production LOC is +53/-53, net zero. No configuration, schema, dependency, or timeout changes.

Supersedes #162503, thanks @kvnloo. Supersedes #162262, thanks @RomneyDa. Each contributor is credited in the corresponding commit.

Evidence

  • Both reporting regressions failed on the original implementation. Focused proof passed 160 tests across six files in 88.24 s wall time with node scripts/run-vitest.mjs <files> --maxWorkers=1, including terminal publication, relocated channel-warning coverage, and restart-health siblings. The changed terminal test file used 14.859 s of test time. After the lint fixes, the relocated channel-warning file passed both cases again in 0.042 s of test time (37.15 s command wall time, dominated by compilation).
  • node scripts/check-changed.mjs --base cf534960545d3fa8c020450da474d67c269ceb00: passed, all checks, 932.01 s wall time.
  • pnpm check:madge-import-cycles: 0 cycles. git diff --check: passed.
  • The broader cross-import run recorded 445 passing tests and one failure before stopping, with 26 selected files not run. The failure was update-finalization-output.process.test.ts / doctor-progress: its 1 s deadline expired before Doctor established custody or emitted output. The exact unchanged base, cf534960545d3fa8c020450da474d67c269ceb00, reproduced the same empty-output/unsettled-custody failure under host load (22.625 s test time, 165.97 s command wall time). A lighter-load base run passed. This is retained as an inherited host-load failure; its deadline and assertions are unchanged. Existing slow rollback/process tests and shared compilation account for the broad run's 3185.71 s wall time. CI decides the remaining coverage.
  • Isolated Codex review was attempted but returned 401 Unauthorized, so no clean review is claimed; maintainer review remains required. Tests use isolated state and ports. Test LOC is +121/-1; docs +8/-1. CI results are pending.

steipete and others added 2 commits October 11, 2026 02:20
Keep a durably succeeded update successful when terminal publication throws:
report a warning and exit 0 instead of offering pending recovery. Cover the
exit status and absence of recovery triage at the terminal owner boundary.

Supersedes #162503.

Co-authored-by: Kevin Rajan <[email protected]>
Report configured stopped or suppressed channel accounts through update
verification warnings, without broadening channel probe failures. Preserve
successful Gateway recovery and exclude disabled or unconfigured accounts.
Consolidate duplicate restart snapshot construction to keep the combined
production diff at zero net lines. Document both update reporting fixes.

Supersedes #162262.

Co-authored-by: Dallin Romney <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: M labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR preserves durably successful updates after publication errors and warns about configured channel accounts that remain stopped.

Example: Update history records succeeded, then terminal result publication throws.

  • Before: The command exits unsuccessfully and reports pending recovery.
  • After: The command warns about publication failure and exits 0 when the success lookup completes.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-boundary coverage supports the intended repairs, but the confirmed lookup-error escape blocks merge.
Proof confidence 🦐 gold shrimp (3/6) Under the supplied maintainer-authored classification, ordinary contributor proof gating does not apply; inspected evidence exercises terminal publication and verification owners in process, without claiming a shipped update run.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An already successful update can report pending recovery, while repair reports can omit configured channel accounts that remain stopped.
Reason: The supplied maintainer-authored direction fixes misleading outcomes through existing owners without new settings, schemas, or channel restarts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: both reporting fixes remain useful on current main, but the previously reported lookup-error escape still blocks merge.

Priority: P2
Reviewed head: 3e4523dcd773a0166edead7e6ba46f3225d7d584

Before merge

  • Contain failures from the success-status lookup (P2) - When deferred publication throws and the subsequent SQLite history read also fails, getUpdateRun throws from inside this catch. That bypasses the outcome aggregation and guarded pending-recovery handling below, discards the publication diagnostic, and sends a raw inspection error to ordinary interactive reporting or diagnostics. Snapshot failures against a changing Gateway database are an observed reporting failure mode. Contain this lookup, preserve both diagnostics, and retain guarded reporting when success cannot be established. This is the unchanged finding from the previous review.

Findings

  • [P2] Contain failures from the success-status lookup — src/cli/update-cli/update-command-terminal.ts:257

Tests

  • Missing end-to-end proof: The supplied evidence does not show a current published-driver-to-candidate update exercising these reporting paths through the shipped CLI.
Agent review details

How this fits together

The update CLI consumes durable update history and Gateway health to produce verification results, reports, warnings, and an exit status.

flowchart TD
A[Update executor] --> B[Durable update history]
A --> C[Terminal result owner]
B --> C
D[Gateway channel health] --> E[Restart health inspector]
E --> F[Update verification]
F --> C
C --> G[Reports and exit status]
Loading

Technical review

Best possible solution:

Keep durable success authoritative and stopped channels advisory while containing failed history inspection within the terminal-result owner.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes the original reporting problems, and the introduced catch establishes the lookup-error escape; no target code or tests were executed during this review.

Is this the best way to solve the issue?

The existing terminal and restart-health owners are appropriate, and advisory channel reporting preserves operator intent, but the success lookup needs exception containment.

Full review comments:

  • [P2] Contain failures from the success-status lookup — src/cli/update-cli/update-command-terminal.ts:257
    When deferred publication throws and the subsequent SQLite history read also fails, getUpdateRun throws from inside this catch. That bypasses the outcome aggregation and guarded pending-recovery handling below, discards the publication diagnostic, and sends a raw inspection error to ordinary interactive reporting or diagnostics. Snapshot failures against a changing Gateway database are an observed reporting failure mode. Contain this lookup, preserve both diagnostics, and retain guarded reporting when success cannot be established. This is the unchanged finding from the previous review.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e7e3b949ae13.

Provenance checked

  • Terminal publication and failure containment changes intended behavior with a stated reason (b31c0ac: Record terminal failures before triage, preserve structured outcomes, and keep pending recovery out of ordinary repair reporting.)
  • Channel timeout warning projection keeps the original intent (e7546f2: Collection timeouts warn without rejecting otherwise healthy updates; definitive channel probe failures remain failures.)
  • Managed and unmanaged restart snapshots keeps the original intent (2b12538: Bound interrupted-update observation while retaining unmanaged reachability and avoiding false stale-process classification.)
  • Required Gateway health probe keeps the original intent (b464d49: A listening managed process must answer Gateway health before restart verification succeeds.)
  • Reporting failure after successful activation changes intended behavior with a stated reason (8bb8609: Preserve the verified installation when reporting fails; this PR explains why durably recorded success should also retain exit 0.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/cli/update-cli/update-command-terminal-unreported.test.ts src/cli/update-cli/update-command-inspection-failure.test.ts --maxWorkers=1
  • node scripts/check-changed.mjs --base cf53496
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 212f041 adds src/cli/update-cli/update-command-terminal.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 212f04188a05; files: src/cli/update-cli/update-command-terminal.ts)
  • Jason (Json): Raw commit 1dfcddb adds src/cli/update-cli/update-command-terminal.ts:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1dfcddb5c98e; files: src/cli/update-cli/update-command-terminal.ts)
  • SunnyShu: Raw commit 2b12538 adds src/cli/daemon-cli/restart-health-inspect.ts:42 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 2b125389c8b0; files: src/cli/daemon-cli/restart-health-inspect.ts)

PR surface

Source 0, Tests +120, Docs +7. Total +127 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 53 53 0
Tests 2 121 1 +120
Docs 1 8 1 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 182 55 +127

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +53/-53; tests +121/-1. Snapshot consolidation offsets the reporting additions, while the added coverage exercises terminal outcomes and account-warning projection.

Root-cause cluster

Relationship: canonical
Canonical: #169037
Summary: This maintainer replacement combines the successful-publication repair with advisory reporting drawn from the earlier channel-recovery work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The defects affect update reporting and recovery guidance without establishing installation damage or a runtime outage.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T09:32:19.780Z sha 3e4523d :: needs changes before merge. :: [P2] Contain failures from the success-status lookup

Reviewed October 11, 2026, 5:39 AM ET / 09:39 UTC (Revision 2).

@steipete
steipete marked this pull request as ready for review October 11, 2026 09:35
@steipete
steipete merged commit 48a3480 into main Oct 11, 2026
196 of 198 checks passed
@steipete
steipete deleted the upd/upd-l1554 branch October 11, 2026 09:45
RomneyDa pushed a commit that referenced this pull request Oct 11, 2026
…rnings (#169037)

Backport of 48a3480 (#169037) adapted for 2026.10.2.

A run the ledger finalized as succeeded now reports success with a warning
(exit 0) when a later publication step fails, instead of claiming recovery
is pending. Update repair warns about configured channel accounts still
stopped or suppressed after repair without failing the update.

Adaptations for the release line:
- The release line lacks #165852's channel health-collection timeout
  plumbing (channelProbeTimeouts). Only channelRuntimeWarnings is added;
  readChannelProbeErrors becomes readChannelProbeFailures returning
  { errors, warnings } and keeps this line's probe-error semantics, and
  verification derives its channel warnings from channelRuntimeWarnings.
- restart-health-inspect keeps this line's unmanaged-reachable early
  return instead of main's merged snapshot path (main's healthy-gating
  differs here); both snapshot constructions carry the warnings.
- On this line exitCliAfterOutput(defaultRuntime, 0) throws ExitError, so
  the update failure triage handler now rethrows ExitError (the matching
  hunk of #168587 on main). Without it the success warning's exit would be
  triaged as an update failure; the ported completed-publication test
  fails without this hunk.

(cherry picked from commit 48a3480)
RomneyDa pushed a commit that referenced this pull request Oct 12, 2026
…rnings (#169037)

A run the ledger finalized as succeeded now reports success with a warning (exit 0) when a later publication step fails, instead of claiming recovery is pending. update repair warns about channels still stopped or suppressed after repair without failing updates for unrelated channel problems. Production net 0 LOC. Supersedes #162503 (thanks @kvnloo) and #162262 (thanks @RomneyDa).

(cherry picked from commit 48a3480)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…rnings (openclaw#169037)

A run the ledger finalized as succeeded now reports success with a warning (exit 0) when a later publication step fails, instead of claiming recovery is pending. update repair warns about channels still stopped or suppressed after repair without failing updates for unrelated channel problems. Production net 0 LOC. Supersedes openclaw#162503 (thanks @kvnloo) and openclaw#162262 (thanks @RomneyDa).
RomneyDa added a commit that referenced this pull request Oct 12, 2026
…otfix)

The #169037 backport reports finalized successes as warnings and exits 0, but
release/2026.10.5 still routed that deliberate ExitError through failure
triage, so a completed publication whose result reporting failed launched
interactive triage. Rethrow ExitError before triage and terminal failure
reporting, as main does.

Extracted from #168587 (98813c2): only the ExitError guards in
update-command-triage.ts and update-command-terminal.ts; the shutdown
redesign is not taken.

Extracted-from: 98813c2
RomneyDa added a commit that referenced this pull request Oct 13, 2026
…168587)

Extracted from 98813c2 (#168587) for 2026.10.3.

10.3 already carries #169037, whose succeeded-run publication path and the existing
finalize/admission paths end through exitCliAfterOutput (ExitError). 10.3 had only the
triage guard; without the terminal-settlement and recovery-unwind guards a reported exit
is re-recorded as an unexpected update failure. Took only the update-cli ExitError guard
hunks (terminal, unwind, cleanup) plus a terminal+unwind regression that fails without them.

Extracted-from: 98813c2
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 18, 2026
First-parent upstream facdd3c..fd0fc62 (7 commits: openclaw#168789
subagent and runner bookkeeping, e65bd3b cold actor append retry,
openclaw#168747 worker environment lifecycle, openclaw#169037, 7fb80f6, openclaw#168949,
fd0fc62).

openclaw#168789 removes retrySubagentCleanup: accepted-run termination is now a
single attempt that resolves when the stop is confirmed (or the session
provably belongs to a successor) and rejects when it is not. Conflicts:

- subagent-spawn-cleanup.ts: took upstream's single-attempt form. Kept
  our hasFrozenSessionIdentity arms on both deletion paths: the
  abort-miss fallback rejects instead of deleting by key alone, and the
  waited provisional delete is skipped without a frozen identity. Dropped
  our retry option and isSettledAbortResponse (upstream's
  isDefinitiveAbortMiss already covers it in preserve mode); the
  continuation guard call-site contract still pins the identity guard.
- Our boolean consumers adapted to the rejecting contract, keeping their
  pre-merge outcomes: the accepted-spawn sweep and spawn rollback map a
  rejection to "not terminated"; the collector's launch-failure path keeps
  rollback custody for the sweeper and settles once (pinned by
  subagent-registry.rollback-custody-restart.test.ts); its
  registration-changed path releases the acceptance hold in a finally.
- subagent-spawn.test.ts: upstream's new "holds an unconfirmed collector
  slot for shutdown" expects no settlement; ported to the fork's custody
  contract (one abort, no second dispatch, settled once).
- subagent-spawn-cleanup.test.ts: our cases ported to the new contract,
  plus two pins for the identity arms (RED with the arms removed).
- subagent-registry-restore.ts: kept our armed-row skip next to
  upstream's restart-recovery/kill skip.
- subagent-registry.test.ts: our extracted restore test kept; upstream's
  "reconcile on the next explicit restore" change ported into
  subagent-registry.restore-retry.test-support.ts.
- worker-access inventory regenerated.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant