Repository navigation
refactor: simplify internal error and recovery ownership - #173597
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Regression provenancePossible 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 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherCLI, 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c921503c9d28. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 9:02 PM ET / October 16, 2026, 01:02 UTC. |
b35df50 to
0bc3599
Compare
There was a problem hiding this comment.
💡 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. */ |
There was a problem hiding this comment.
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 👍 / 👎.
d1e0b6e to
233811c
Compare
233811c to
9040e8a
Compare
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.
…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
…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.
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
Evidence
The original replacement's focused proof and attributed repairs are recorded below. Exact head
233811c95095d7ebfdb0958006f12a996d1afe2fsubsequently passed hosted CI run38870548373. GitHub then reported CONFLICTING; the mechanical MCP test integration described below produces signed head9040e8a93670e208247fbb6aa7e31a469ce0d6a7. That exact head now passes hosted CI run38880660070, 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.scripts/lib/control-ui-warm-reload-probe.tsandsrc/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.Replacement CI repair
Run
38847860761on0bc3599fe91af9a8d6abdfec980513f5457211f3failed 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
b35df50failed CI. Its attributed fixes and backend cuts are retained ondeslop/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 onto4c7d1bd2f6949279ff4340d7325ece63211bbeec, 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
233811c95095d7ebfdb0958006f12a996d1afe2fcompleted successfully, GitHub reported CONFLICTING again. Rebased onto547c9602aa8aec09627cf54b3a3ed1cb6185b62f. The sole manual conflict is MCP's test fixture: retain main's consolidated harness andconfigWithconstructor, 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 run38880660070, attempt 1, subsequently completed successfully, includingopenclaw/ci-gate. No CI rerun, admin exception or green-chasing branch update is needed for this head.