Repository navigation
fix: show why plugin state access fails after an update - #157004
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: blocked before merge. Reviewed September 24, 2026, 3:28 PM ET / 19:28 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds process and version identity and nested causes to plugin-state errors, carries them across the SQLite worker boundary, and documents recovery from an older macOS app worker reading an upgraded database. Merge readiness⛔ Blocked before merge - 11 items remain Keep open: current main still lacks the requested diagnostics, while this head retains three actionable blockers from the prior review. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw plugins use a shared SQLite state database. Database errors cross a worker boundary to plugin callers and can then appear in structured operator logs. flowchart LR
A[Plugin state request] --> B[SQLite worker]
B --> C{Read succeeds?}
C -->|Yes| D[Plugin state result]
C -->|No| E[Captured error and owner]
E --> F[Caller error]
F --> G[Redacted operator log]
Before merge
Findings
Agent review detailsSecurityNeeds attention: Two introduced cause-serialization paths can expose sensitive diagnostic content outside the intended redaction policy. PR surfaceSource +43, Tests +84, Docs +11. Total +138 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Project bounded, allowlisted cause details only at the redacted diagnostic boundary, while retaining worker origin on the in-memory error. Do we have a high-confidence way to reproduce the issue? Yes for the diagnostic omission: current-main source and the reported published-version reader experiment establish a clear path. The reporter's exact macOS background process was not captured. Is this the best way to solve the issue? No. Worker origin is useful, but projecting raw causes from the error's general JSON method and bypassing code-field redaction is broader than the diagnostic need. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 11f0dad5872b. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
…#157004) Preserve bounded nested causes, native errno, and the process/thread/version that captured plugin-state errors in structured logs. Share cause capture with worker transport and document updating the private Mac app worker after a Gateway schema upgrade. Refs openclaw#156930. Reported by @Fuma2013.
Refs #156930. Thanks @Fuma2013 for the report and the restart/foreground control evidence.
What Problem This Solves
Plugin-state failures appear in structured logs without their nested cause or the process that captured them, hiding why an older background reader rejects an upgraded database.
User Impact
Structured records now include bounded nested causes, native error codes/errno, and the capturing process ID, thread ID, and OpenClaw version. Operators can distinguish a schema-version refusal from a file-open failure. Existing credential redaction remains active; arbitrary error properties and stacks are excluded.
For the reported 9.5 companion / 9.6 Gateway skew, update and relaunch OpenClaw.app; a Gateway-only restart leaves the old app worker in place. The diagnostics change must ship in the next npm release; the separate macOS-only rebuild cannot update the installed CLI/Gateway package.
Why This Change Was Made
The tagged 9.5 app selects its signed private Node/OpenClaw payload, validates that payload against the app's version and build, and runs
node worker; updating the external npm CLI does not replace it. The node-host plugin registry registers the same Codex catalog commands and keyed-state store. Its resident catalog reconciles every 30 seconds against the same profile's shared state database. Tagged 9.5 supports schema 17 and rechecks schema support even when reusing a read handle; 9.6 migrates the shared database to schema 18.This establishes a version-skew mechanism consistent with a failing app-owned background reader, successful 9.6 foreground reads, and persistence across Gateway-only restarts. We have not captured the reporter's exact failing PID or nested cause, so this PR references the issue rather than claiming that attribution is independently proven.
The fix belongs to the plugin-state error and transport owners. One shared bounded cause serializer serves both worker transport and JSON logs; the existing canonical codec preserves typed/aggregate errors and now carries
errno. JSON useserrorCodefor native causes so OAuth-code redaction does not hide them; in-memory.codeis unchanged.owneridentifies where the plugin-state error was constructed, including the caller thread for pre-dispatch failures. No schema, migration, retention, or admission-policy changes.Tagged source evidence
eb377acpredates both perf(state): reuse admitted schema facts on database reads #156643 and fix(state): observe foreign commits on the next database read #156824, so their specific admitted-facts regression is excluded. It also predates perf(session-share): keep chat catalog startup responsive #156400 and perf(infra): keep hot Workers warm and expose churn #156387; neither changes this tagged Codex path.Evidence
quick_check=ok; no background warning appeared during 65 seconds after readiness or the subsequent native-rollout restart probe.PLUGIN_STATE_OPEN_FAILED, operationentries, with nestedSqliteSchemaVersionError: database schema 18, reader supports 17. This was an isolated reader reproduction, not a live capture of the reporter's macOS process.pnpm buildexited 0 in 306.72 s; its UI report flagged a Mermaid gzip budget overage (1,555.8 KiB versus 960.0 KiB), not investigated in this lane. Freshautoreview --mode branch --base origin/mainfound no actionable P0–P2 findings.canonical-descendant.integration.test.tspassed 73 cases in 182.587 s of test time; the firstserver.codex-failure-recovery.test.tscase took 37.121 s. Both timing issues predate this change and are being handled in a separate performance follow-up. No tests were weakened, skipped, or retiered for this change.check:changedpassed on Testbox (exit 0, 25m 41.568s), including core types, all 25 core-test typecheck graphs, formatting, lint, schema/ownership guards, and zero runtime import cycles.