Skip to content

refactor: simplify internal error and recovery ownership - #173597

Merged
steipete merged 5 commits into
mainfrom
deslop/z20-error-handling-20261015
Oct 16, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/z20-error-handling-20261015

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Internal failure carriers and overlapping recovery owners obscure the actual error boundary. This replacement keeps public diagnostics, protocol/SDK results, authorization, ordinary durability, and write settlement at their existing owners while removing private envelopes, duplicate catches and unsupported fallback machinery.

The larger structural cuts put managed Git acquisition inside the existing directory-install transaction, use native failures between private OC Path editors and their CLI boundary, and leave transport liveness with the Gateway rather than a second terminal application probe. Smaller cuts remove discarded channel outcomes, duplicate update-report recovery, redundant Storage readbacks and catch-to-result-to-catch plumbing in MCP management.

Net production LOC for the reviewed repair candidate against pinned main 547c9602aa8aec09627cf54b3a3ed1cb6185b62f: 528 removed (442 added / 970 deleted across 35 production files), excluding tests, test support, fixtures, generated code and declarations. No changelog, schema, config, protocol, dependency or permission change.

Best-effort tradeoffs accepted

  • Outbox synchronous Storage reentry: fix(ui): keep chat and drafts usable when connections fail #162428 introduced recursive mock Storage fixtures, not native sessionStorage behavior. Monkey-patched recursive adapters are best effort; durable transfer staging remains.
  • Outbox repeated destination recapture and payload checks: carry the already admitted synchronous input instead of repeatedly rebuilding it. Account, Gateway, client, connection and privacy checks remain at effects; synthetic replacement from inside a Storage method is unsupported.
  • Outbox whole-store CAS rereads: native synchronous Storage does not interleave another same-document writer inside the invocation. Keep live-authority checks before writes, without reloading our own state.
  • Outbox successful-write readbacks: fix(ui): keep chat and drafts usable when connections fail #162428's successful-no-op/resurrection adapters are synthetic. Native mutations throw on failure; durable staging and throwing/commit-then-throw recovery remain.
  • Session-placement successful-write readbacks: fix(ui): make Cloud Worker startup responsive #121200 contains synthetic Storage rollback proof, not a report of native Storage silently ignoring a successful write. Trust successful writes; retain quota/security exceptions and restoration of original bytes.
  • Terminal application liveness probes: perf(control-ui): avoid reconnecting on delayed application heartbeats #171253 made native Gateway ping/pong the transport owner and measured unnecessary reconnect/bootstrap work from application probes. fix(terminal): recover sessions after stale Control UI connections #107419/fix(ui): tolerate transient gateway stalls in terminal liveness probe #109317 predate that cutover. An intermediary selectively dropping application frames while preserving native ping/pong no longer gets a terminal-specific periodic reconnect; socket closure, tab activation and the retained bounded terminal-open watchdog recover it. Replay gaps and explicit negative acknowledgments remain separate owners.
  • Git staging fallback: fix(plugins): stage git plugin clone on target filesystem to avoid EXDEV #99896 fixes human EXDEV: cross-device link error during git plugin install in Docker containers #99885's cross-device publication through adjacent staging, which remains. Its synthetic one-shot EROFS fallback cannot repair a persistently unwritable managed destination; now fail visibly before cloning rather than retry in system temp.
  • Git target-existence recheck: use the initial mode under the existing plugin lifecycle owner. Unsupported out-of-band replacement during acquisition fails through the directory owner; normal updates, consent, rollback and deferred settlement remain.
  • Maintenance clock corrections: refactor(gateway): own companion timed work in the kernel scheduler #158423/fix(runtime): close async cleanup and refresh gaps #171415 document synthetic clock interleavings; perf(gateway): coalesce idle maintenance wakeups #171318 establishes measured, best-effort maintenance phasing. Correcting a forward jump may postpone maintenance until the next wall slot. Exact deadlines and security expiry remain on their existing wall/elapsed contract.
  • Cancelled scheduler timer callback: native timer cancellation is the owner. An injected clock that manually calls an already cancelled callback no longer gets a second generation fence; normal job cancellation and shutdown settlement remain.
  • Update-report double recovery: fix(gateway): settle restart intents and update reports in workers #167572 already recovers exact native commit facts. If that recovery and its reply both fail, propagate the existing error instead of another row read. Durable admission prevents speculative issue re-creation; ordinary status/reconciliation observes the committed receipt. Genuine false-result confirmation remains.
  • Claw generated-archive inventory revalidation: feat(claws): add local project author lifecycle #117037 introduced this as initial experimental authoring with synthetic/golden output proof, not a human-reported tar corruption incident. Trust the maintained tar producer over the explicit validated file selection; a dependency defect may now be detected by independent artifact tests or the eventual consumer instead of a second runtime inventory pass. Source confinement, validated-byte matching and atomic no-overwrite publication remain.
  • Claw generated-archive extraction/reparse/identity revalidation: the same feat(claws): add local project author lifecycle #117037 initial feature reopened its own private staging output, with no cited human-use failure requiring that extra pass. A tar dependency defect or same-user private-staging modification is best effort; the real artifact consumer still validates its input, and existing output tests extract and check actual archive bytes. CLI dev's actual extraction path remains.
  • Undici missing/throwing runtime API fallbacks: supported Node and current Bun implement the family getter/setter. Old-runtime or monkey-patched API failures now surface normally; WSL IPv4 policy and finally restoration remain. No runtime support policy changes.
  • Other cuts change only private carriers or duplicate catch ownership. OC Path's CLI retains exact reason/detail, exit codes and file bytes; public channel results and realtime error text remain unchanged. No additional recovery concession is intended.

Evidence

The original replacement's focused proof and attributed repairs are recorded below. Exact head 233811c95095d7ebfdb0958006f12a996d1afe2f subsequently passed hosted CI run 38870548373. GitHub then reported CONFLICTING; the mechanical MCP test integration described below produces signed head 9040e8a93670e208247fbb6aa7e31a469ce0d6a7. That exact head now passes hosted CI run 38880660070, attempt 1. All 181 check runs were enumerated: none unfinished or failing; the aggregate CI gate is successful and CodeQL is neutral. Prior-head proof remains distinguished below; no hosted job was rerun or branch updated merely for green.

  • Terminal regression: the old watchdog reconnects during healthy pending input (negative control); the cut passes 52 tests across terminal, heartbeat, socket, controller-lifecycle and reconnect suites. Vitest103.61s on the loaded host.
  • Retained outbox owner and siblings: 87/87 pass; unchanged since that proof.
  • OC Path CLI and full parser/editor subtree: 323/323 tests across 33 files pass; Vitest112.82s, wrapper155.41s on the loaded host. Exact rejection text, exit codes, unchanged bytes, sentinel admission and cross-format round trips remain covered.
  • MCP, organizer and placement recovery: 120/120 tests across five files pass; Vitest176.62s, wrapper206.12s. Socket-factory owner: 13/13 pass, Vitest58.79s.
  • Replacement changed-file dry run passes with explicit staged base. Formatting and whitespace pass. Production delta measured after formatting.
  • Runtime import-cycle check: zero value cycles. Full static/madge scan: zero cycles. Independent isolated P0–P2 review: scoped-clean, final source verification passed.
  • Usage-cache native boundary before CI: 2/2 passed, but this missed the existing worker deletion-pruning contract. The repair restores bounded full rediscovery for a disappeared queued transcript and restores the original lifetime test, retiring only the new no-rediscovery mechanism assertions. Existing worker pruning coverage remains unchanged. Fresh worker/lifetime replay prepared compiled workers, then was deliberately stopped after more than ten minutes without further output on the heavily loaded host (exit 130, no assertion results). It is not passing or inherited-red proof; exact-head CI must cover it.
  • Targeted production/test graph types pass for all changed files. Two own inference errors were corrected using the directory installer's parameter type and a captured narrowed timer value, without casts or suppressions.
  • The initial core/channel aggregate runs were invalidated by compiled-source verification after that type-only edit during execution. The final frozen-source replay passes: 66 infra tests across five files plus 42 MSTeams tests across three files. CLI/onboarding/install callers pass 166 tests across ten files (25 scheduler, 49 CLI, 59 command, 33 Git-install). Native Git acquisition/update/rollback and security/lifecycle siblings remain covered.
  • Targeted native lint was interrupted by the coordinator shutdown (exit 143), without findings or a passing verdict. Earlier extension lint preparation also hit its unchanged declaration-build timeout. Exact-head CI must supply lint/broad proof; no preparation guard, policy or timeout was bypassed.
  • Native changed checks completed conflict, line-cap, max-lines, environment-count and assertion-safety ratchets. SQLite analysis was stopped after about ten minutes without a result; no broad-check pass is claimed. Exact-head CI owns remaining broad proof.
  • Suppression inventory: two of three cases pass; inventory comparison finds96 actual versus94 expected. Extra entries are in unchanged scripts/lib/control-ui-warm-reload-probe.ts and src/agents/code-mode-node.watchdog.test-support.ts; both sources and the inventory test are identical to pinned main. No allowlist expansion or local pass claimed. Wrapper101.79s, Vitest79.56s.
  • No new suppression, timeout, retry or skip. Exact-head hosted CI is the broad gate; no production Gateway, real user state, live provider or device proof is claimed.

Replacement CI repair

Run 38847860761 on 0bc3599fe91af9a8d6abdfec980513f5457211f3 failed four substantive jobs, plus the aggregate gate. These are not being classified as inherited reds:

  • check-lint-extensions-1: Discord voice's success branch needs an explicit undefined return alongside string diagnostics. No suppression added.
  • checks-node-changed-compact-small-21-2: a real cached transcript deletion needs bounded rediscovery to prune the row. Restore that owner path and keep the existing worker regression unchanged.
  • checks-ui (1/3): the unavailable-Storage fixture threw only on reads but silently accepted writes. Make its writes reject with the same native SecurityError; keep every existing recovery assertion.
  • checks-node-changed-5: the scheduler-disabled Gateway fixture reached cron inference admission without any inference identity, before its scheduler assertion. Fresh main now supplies an explicit offline model/provider configuration; the conflict repair keeps that complete main-owned fix and drops our superseded synthetic-key hunk. This test file is identical to the fresh base.

The six-file repair delta, including the Claw producer cut, passed fresh isolated P0–P2 review with final source verification (scoped-clean, confidence 0.98). Applied files match the reviewed bytes. Fresh placement proof passes 12/12 (Vitest 104.33s; wrapper 129.87s); core lint, corrected targeted production/test graph types, changed-file planning, formatting and whitespace pass. The initial scratch type config omitted UI JSX/ambient settings; corrected execution uses those canonical settings. Suppression proof again reports only the same two untouched inventory extras (2/3 tests pass; Vitest 189.87s, wrapper 253.81s), without an allowlist expansion. Extension lint could not execute because its normal plugin-SDK declaration preparation hit the unchanged 300000ms timeout; no guard, timeout or suppression was bypassed and no lint pass is claimed for that route. The six-file delta introduces no runtime import edges and removes one, so the prior zero-cycle graph cannot acquire a new SCC from this repair. Claw project and temp-root suites pass: 29 tests, one pre-existing skip, two files (Vitest 317.22s; wrapper 379.49s), with completed-source verification. Exact-head CI remains the landing gate. No failed hosted job was rerun or reclassified green.

Original CI and replaced scope

The original head b35df50 failed CI. Its attributed fixes and backend cuts are retained on deslop/z20-parked-ci-backend-20261015, not silently claimed green. The voice fixture failure did not reproduce in serial head/base replay; that is inconclusive, not inherited-red proof. All original non-UI paths were restored to pinned main before building this independently audited replacement. No admin exception or CI rerun is requested for the original failures.

Conflict-only integration

GitHub reported CONFLICTING on d1e0b6e22f701ddaf86f45d019d25c4c2f69fa42. Rebased onto 4c7d1bd2f6949279ff4340d7325ece63211bbeec, keeping main's wrapped-Markdown key/value parser inside the direct-AST editor and both main's and this PR's CLI regressions. Main's complete offline Gateway model/provider fixture supersedes our synthetic-key hunk; that file now has no diff.

The conflicted production/CLI graph types pass. Initial fresh CLI/universal replay: 93 pass, four fail because main added tests still reading the retired private Result envelope (Vitest 342.68s; wrapper 459.44s). These were ours, not inherited failures. Those four cases now use direct AST/throw without dropping content, line-ending, unchanged-input or reparse assertions. The corrected production/CLI/universal-test graph typecheck passes; universal owner replay passes all 39 cases (Vitest 157.37s; wrapper 236.89s), reusing the unchanged CLI pass. Fresh independent P0–P2 review is scoped-clean with final source verification, confidence 0.98. Fresh suppression inventory passes 3/3 (Vitest 242.84s; wrapper 339.82s), without an allowlist change; changed-file planning passes. The fresh full runtime cycle scan was interrupted before a result on the saturated host; the earlier zero-cycle runs are prior-head evidence, not fresh execution. The only added runtime imports against the new base target the pure leaf edit-error module. Exact-head hosted CI remains required before landing.

Second conflict-only integration

After exact-head CI on 233811c95095d7ebfdb0958006f12a996d1afe2f completed successfully, GitHub reported CONFLICTING again. Rebased onto 547c9602aa8aec09627cf54b3a3ed1cb6185b62f. The sole manual conflict is MCP's test fixture: retain main's consolidated harness and configWith constructor, plus all four load/patch/refusal/refresh visible-error and retry assertions. No production conflict or new behavior; no parked backend hunks returned. All five task commits retain valid signatures.

Fresh affected proof on signed 9040e8a93670e208247fbb6aa7e31a469ce0d6a7: MCP owner 31/31 (Vitest181.49s, wrapper247.72s), suppression inventory 3/3 (Vitest252.16s, wrapper322.48s), targeted conflicted graph types, focused type-aware lint, both-file formatting/whitespace and changed-file planner pass. Runtime cycle scan 0; full static/madge scan 0. The default host Node binary became unavailable during an earlier planner attempt before source scanning; the supported installed Node24 rerun passed without changing repository runtimes, dependencies or guards. Exact-head hosted CI run 38880660070, attempt 1, subsequently completed successfully, including openclaw/ci-gate. No CI rerun, admin exception or green-chasing branch update is needed for this head.

@clawsweeper

clawsweeper Bot commented Oct 16, 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 channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call channel: zalouser Channel integration: zalouser app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: openai extensions: ollama extensions: browser plugin: mcp-events size: XL labels Oct 16, 2026
@steipete
steipete marked this pull request as ready for review October 16, 2026 00:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T09:32:15.470849Z 9040e8a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes redundant error wrappers, recovery retries, and storage readbacks across core runtime and plugins.

Example: An exec command such as echo hello fails to spawn with EBADF.

  • Before: The supervisor attempts another spawn without detaching.
  • After: The native spawn error surfaces after one attempt.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The approved cleanup has useful source and harness evidence, but introduced behavioral and CI failures prevent a passing patch assessment.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied evidence covers in-process tests and CI, and explicitly claims no live Gateway or provider run.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Redundant error and recovery layers obscure failures, while some cleanup and storage failures disappear without diagnostics.
Reason: The maintainer has explicitly approved the direction and best-effort concessions, and source inspection confirms substantial removal of duplicate plumbing without new public settings or interfaces.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep this PR open: the maintainer-approved simplification is useful, but an Ollama timeout regression, unmigrated Storage fixtures, and an introduced CI ratchet failure need repair.

Priority: P2
Reviewed head: b35df502c93ce1c18ac5dd9024d6a3efd49b3477

Before merge

  • Let the idle-timeout rejection settle before canceling the reader (P2) - For an Ollama pull that supplies no data for 300 seconds, the timeout callback cancels the pending reader before throwing. With reader.read() now passed directly to raceWithTimeout, cancellation resolves that source promise with done:true before the deadline rejects, so the caller reports 'pull stream ended before success' instead of the idle timeout. The existing setup.test.ts:474 assertion fails with exactly this result in head CI. Let the timeout reject first and use the existing finally block to cancel and release the reader.
  • Finish migrating the sibling tests to the native Storage contract (P2) - Removing successful-write verification deliberately drops support for no-op Storage adapters, but outbox-identity.test.ts and outbox-blob-recovery.test.ts still inject silent setItem/removeItem no-ops and require detection. Head CI consequently fails source-retention assertions, two restore outcomes, and the removal exception assertion. Remove the unsupported no-op cases from those sibling tables while retaining quota failures, throwing removals, actual byte retention, and account-isolation coverage.
  • Move the new shutdown case into a focused sibling suite (P2) - The added MCP-close warning case grows server-close.test.ts beyond its existing no-growth allowance. The head baseline check explicitly reports 1648 to 1660 counted lines against the 1000-line cap and fails. Put this diagnostic case in a coherent sibling suite without increasing the baseline or removing existing shutdown coverage.
  • Explain or restore the original intent of Ollama observation timeout - ab4d26a: Share observation-only timeout races while preserving timing, error identity, and cleanup barriers; the current change unintentionally changes which timeout outcome wins.

Findings

  • [P2] Let the idle-timeout rejection settle before canceling the reader — extensions/ollama/src/setup-pull.ts:35-39
  • [P2] Finish migrating the sibling tests to the native Storage contract — ui/src/lib/chat/outbox-store.ts:657-659
  • [P2] Move the new shutdown case into a focused sibling suite — src/gateway/server-close.test.ts:228-239

Provenance

  • Ollama observation timeout changes intended behavior without addressing why it exists (ab4d26a: Share observation-only timeout races while preserving timing, error identity, and cleanup barriers; the current change unintentionally changes which timeout outcome wins.)

Tests

  • Missing end-to-end proof: No shipped-entry-point run of this refactor is supplied; the maintainer-authored PR is outside the ordinary contributor proof gate.
Agent review details

How this fits together

CLI, Gateway, UI, and plugin callers invoke operation owners that perform network, process, and storage work and return results or errors; this refactor removes intermediate error and recovery layers.

flowchart TD
  A[CLI and Control UI] --> B[Gateway operation owners]
  B --> C[Plugin adapters]
  B --> D[Process and install owners]
  C --> E[Provider and channel transports]
  A --> F[Account scoped outbox storage]
  D --> G[Native processes and filesystem]
Loading

Technical review

Best possible solution:

Retain the approved simplifications while preserving the Ollama timeout outcome, completing sibling fixture migration, and restoring the shutdown-suite CI gate.

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

The existing stalled Ollama stream test fails in head CI, and the promise race explains the wrong timeout result; UI and shutdown ratchet annotations independently identify the other introduced failures.

Is this the best way to solve the issue?

Removing redundant private layers fits the repository’s ownership guidance, but timeout settlement must not depend on an incidental promise wrapper, and supported sibling tests must complete the cutover.

Full review comments:

  • [P2] Let the idle-timeout rejection settle before canceling the reader — extensions/ollama/src/setup-pull.ts:35-39
    For an Ollama pull that supplies no data for 300 seconds, the timeout callback cancels the pending reader before throwing. With reader.read() now passed directly to raceWithTimeout, cancellation resolves that source promise with done:true before the deadline rejects, so the caller reports 'pull stream ended before success' instead of the idle timeout. The existing setup.test.ts:474 assertion fails with exactly this result in head CI. Let the timeout reject first and use the existing finally block to cancel and release the reader.
    Confidence: 0.99
  • [P2] Finish migrating the sibling tests to the native Storage contract — ui/src/lib/chat/outbox-store.ts:657-659
    Removing successful-write verification deliberately drops support for no-op Storage adapters, but outbox-identity.test.ts and outbox-blob-recovery.test.ts still inject silent setItem/removeItem no-ops and require detection. Head CI consequently fails source-retention assertions, two restore outcomes, and the removal exception assertion. Remove the unsupported no-op cases from those sibling tables while retaining quota failures, throwing removals, actual byte retention, and account-isolation coverage.
    Confidence: 0.99
  • [P2] Move the new shutdown case into a focused sibling suite — src/gateway/server-close.test.ts:228-239
    The added MCP-close warning case grows server-close.test.ts beyond its existing no-growth allowance. The head baseline check explicitly reports 1648 to 1660 counted lines against the 1000-line cap and fails. Put this diagnostic case in a coherent sibling suite without increasing the baseline or removing existing shutdown coverage.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Spawn readiness and detached fallback changes intended behavior with a stated reason (e7240ca: Canonical spawn readiness preserved native errors, authority, and fallback selection; the original fallback introduction remains unknown because older blobs are missing.)
  • Outbox recovery and successful-write verification changes intended behavior with a stated reason (9764de1: Preserve unsent input through interrupted transfers and account changes; this PR explicitly trusts successful native Storage mutations while retaining staging and effect-time authority.)
  • Update-report receipt retries changes intended behavior with a stated reason (40d57f8: Move receipt transitions and accepted-write settlement to existing workers; this PR records why outer retries of domain refusals are redundant.)
  • OpenAI realtime retirement keeps the original intent (fix(openai): retry failed voice hangups without losing the call #137636: Retain cleanup capability and reserved capacity through failed remote hangups; the refactor preserves shared closes and bounded retries while accepting a microtask yield for void retirement.)
  • Validated npm archive installation changes intended behavior with a stated reason (refactor(hooks): consolidate validated npm archive installs #138267: Consolidate archive installation while preserving cleanup settlement, result metadata, and transaction symbols; this PR explains moving plain-result construction inside the workspace callback.)
  • Setup credential staging keeps the original intent (496433f: Retain saved credentials after failed connection checks; typed internal exceptions still become public unavailable results with the existing saved-credential guidance.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/ollama/src/setup.test.ts extensions/ollama/src/setup-pull.test.ts --maxWorkers=1
  • pnpm --dir ui test src/pages/chat/outbox-identity.test.ts src/pages/chat/outbox-blob-recovery.test.ts src/lib/chat/outbox-recovery.test.ts --maxWorkers=1
  • pnpm test src/gateway/server-close.test.ts src/gateway/server-close-prelude.test.ts --maxWorkers=1
  • node scripts/check-changed.mjs -- extensions/ollama/src/setup-pull.ts ui/src/pages/chat/outbox-identity.test.ts ui/src/pages/chat/outbox-blob-recovery.test.ts src/gateway/server-close.test.ts src/gateway/server-close-prelude.test.ts

What I checked:

  • Pinned introduction and current-main comparison: The complete introduced diff was read from the verified merge base to the original head. Current main retains the previous Ollama timeout wrapper and spawn fallback; these changes are not already implemented there. (b35df502c93c)
  • Accepted product direction: The maintainer-authored body explicitly accepts removal of detached-spawn retries, persistence-only recovery timers, and synthetic Storage readback guarantees; those choices require no second product approval. (b35df502c93c)
  • Ollama timeout failure: The existing stalled-stream test fails on the reviewed head: expected the 300-second idle-timeout diagnostic, received 'pull stream ended before success'. Removing the reader promise wrapper lets cancellation resolve the read before the timeout rejection wins. (extensions/ollama/src/setup-pull.ts:36, b35df502c93c)
  • Unmigrated sibling fixtures: The UI check reports failures in outbox-identity and outbox-blob-recovery tests whose no-op Storage fixtures still expect successful-write verification; source inspection confirms those unsupported fixtures remain. (ui/src/pages/chat/outbox-blob-recovery.test.ts:254, b35df502c93c)
  • Introduced shutdown-suite ratchet failure: The baseline check identifies growth in server-close.test.ts from 1648 to 1660 counted lines against its 1000-line cap; the introduced MCP-close diagnostic case accounts for that growth. (src/gateway/server-close.test.ts:228, b35df502c93c)
  • Recovery and authority retained: Outbox writes retain immediate client, connection epoch, account, Gateway, and incognito checks before storage effects; process startup retains authority checks before launch and private-input delivery. The serialized outbox remains version 4. (ui/src/lib/chat/outbox-recovery.ts:331, b35df502c93c)

Likely related people:

  • Peter Steinberger: Raw commit 0352277 adds src/system-agent/setup-inference-credentials.ts:206 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 035227797aa6; files: src/system-agent/setup-inference-credentials.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +671/-1177; tests and support +455/-1051 The introduced diff removes 506 net production lines without adding a competing operation owner; docs and tooling are excluded.

Labels

Label changes:

  • add P2: This is a useful maintenance refactor with a bounded diagnostic regression and concrete CI repair work, rather than an urgent runtime outage.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a useful maintenance refactor with a bounded diagnostic regression and concrete CI repair work, rather than an urgent 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 execution lanes are retired.

Reviewed October 15, 2026, 9:02 PM ET / October 16, 2026, 01:02 UTC.

@steipete
steipete force-pushed the deslop/z20-error-handling-20261015 branch from b35df50 to 0bc3599 Compare October 16, 2026 03:54
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call channel: zalouser Channel integration: zalouser labels Oct 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: msteams Channel integration: msteams cli CLI command changes extensions: oc-path and removed scripts Repository scripts agents Agent runtime and tooling extensions: ollama extensions: browser plugin: mcp-events labels Oct 16, 2026
@steipete steipete changed the title refactor: simplify internal error handling and redundant recovery refactor: simplify internal error and recovery ownership Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bc3599fe9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

addEventListener(listener: (evt: Pick<EventFrame, "event" | "payload">) => void): () => void;
inboundActivitySeq?: number;
/** Recovers unreplayable output gaps and half-open terminal streams. */
/** Recovers unreplayable output gaps and terminal-open watchdog failures. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Retain liveness recovery for active terminal streams

When the WebSocket becomes half-open while the page remains visible, removing the idle terminal.list probes leaves an existing terminal frozen until a page-activation event or the network stack eventually reports closure. GatewayBrowserClient.needsWakeReconnect is only consulted on visibility, pageshow, and online events, while terminal input and resize request failures are caught without triggering reconnection, so continued user interaction cannot recover the stream. Keep continuous liveness detection in the browser transport owner or retain the terminal probe.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Oct 16, 2026
@steipete
steipete force-pushed the deslop/z20-error-handling-20261015 branch from d1e0b6e to 233811c Compare October 16, 2026 07:57
@steipete
steipete force-pushed the deslop/z20-error-handling-20261015 branch from 233811c to 9040e8a Compare October 16, 2026 09:28
@steipete
steipete merged commit 53a452a into main Oct 16, 2026
193 checks passed
@steipete
steipete deleted the deslop/z20-error-handling-20261015 branch October 16, 2026 10:23
steipete added a commit that referenced this pull request Oct 16, 2026
The approval handoff test manually invoked a cancelled host callback after
arming its replacement. 53a452a (#173597) intentionally removed the
scheduler's second generation fence: "native timer cancellation is the
owner." This stale fixture consequently armed a second synthetic host timer.

Assert that handoff cancels the old 16000ms wake and that its final release
arms a live 17000ms wake. Keep the approval live at the original deadline
and verify cleanup at the replacement deadline. No production scheduling,
approval authority, timeout, retry, or skip behavior changes.

Proof: the original current-main file reproduced the hourly failure
(44 passed, 1 failed). The repair passes 88 tests across approval manager,
approval expiry, and Gateway scheduler suites with --maxWorkers=1.
Gateway-root test types, scoped lint, formatting, and whitespace pass.
Fresh isolated P2 autoreview: no actionable findings.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…3597)

* refactor: collapse redundant internal error and recovery layers

* fix: repair error transport cleanup regressions

* refactor: simplify internal error and recovery ownership

* refactor: complete error-boundary cleanup repairs

* test: migrate rebased OC Path editor regressions
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…4154)

The approval handoff test manually invoked a cancelled host callback after
arming its replacement. 02b90e5 (openclaw#173597) intentionally removed the
scheduler's second generation fence: "native timer cancellation is the
owner." This stale fixture consequently armed a second synthetic host timer.

Assert that handoff cancels the old 16000ms wake and that its final release
arms a live 17000ms wake. Keep the approval live at the original deadline
and verify cleanup at the replacement deadline. No production scheduling,
approval authority, timeout, retry, or skip behavior changes.

Proof: the original current-main file reproduced the hourly failure
(44 passed, 1 failed). The repair passes 88 tests across approval manager,
approval expiry, and Gateway scheduler suites with --maxWorkers=1.
Gateway-root test types, scoped lint, formatting, and whitespace pass.
Fresh isolated P2 autoreview: no actionable findings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui channel: discord Channel integration: discord channel: msteams Channel integration: msteams cli CLI command changes commands Command implementations extensions: oc-path extensions: openai P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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