Repository navigation
fix(config): surface the SQLite worker launch failure instead of a trim TypeError - #165373
Conversation
Classify worker launches before parsing their output, and retain config read causes with their paths. Keep native identity checks on the host platform in the update-service fixture. Refs #164404. Thanks @nnljl2003 for reporting the intermittent failure.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 5, 2026, 2:22 AM ET / 06:22 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR reports SQLite worker launch failures directly, preserves their causes through config diagnostics, adds regression coverage and documentation, and corrects a host-platform test fixture. Merge readiness✅ Ready for maintainer review The PR remains useful: fetched main still masks failed SQLite worker launches and discards config-read causes. No introduced correctness defect was found; the underlying Windows launch trigger remains separate, unresolved work. Priority: P2 Review scores
Verification
How this fits togetherConfig diagnostics inspect settings and shared SQLite state before CLI commands or Gateway startup proceed. Worker failures feed into config snapshots, which produce operator-facing errors and determine whether recovery is appropriate. flowchart TD
A[CLI or Gateway startup] --> B[Config snapshot]
B --> C[SQLite inspection worker]
C --> D{Launch succeeded?}
D -->|Yes| E[Parse worker response]
D -->|No| F[Preserve launch error]
E --> B
F --> G[Config path and original cause]
B --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +40, Tests +67, Docs +2. Total +109 across 15 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep launch classification and cause preservation in their existing owners, then use the exposed Windows error to diagnose the remaining runtime failure. Do we have a high-confidence way to reproduce the issue? Yes for the diagnostic defect: a failed synchronous executable launch reaches trimming of absent output on fetched main, and the regression exercises that boundary with Node's actual launch result. The reporter's specific Windows trigger remains unverified; no reviewer runtime reproduction was executed. Is this the best way to solve the issue? Yes: classify failure at the launch owner and preserve causes through the existing snapshot/error owners, without bypassing validation or changing write safety. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9151e48c4f9c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…im TypeError (openclaw#165373) Refs openclaw#164404 Reported by @nnljl2003.
…im TypeError (#165373) Refs #164404 Reported by @nnljl2003. (cherry picked from commit 97430de)
…law#165373, openclaw#166843, openclaw#166991, openclaw#168037) (cherry picked from commit a4511e5) Co-authored-by: RomneyDa <[email protected]>
backport) (cherry picked from commit 7daf4de) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Config diagnostics can replace a failed read-only SQLite worker launch with
Cannot read properties of undefined (reading 'trim'), hiding the actual runtime failure. Refs #164404. Thanks @nnljl2003 for the report and the clarification about intermittency.User Impact
The diagnostic names the config path and reports the underlying worker launch error. The original exception remains available through
causefor in-process diagnostics, without exposing raw exception metadata in config JSON. Read failures retain their existing write-safety behavior.Why This Change Was Made
A failed
spawnSynccall can return absent stdout/stderr despite Node's string declarations. The launch owner now produces a closedlaunched { stdout, stderr, status } | launch-failed { error }result before parsing. The config snapshot owner preserves the cause, and the shared read-error constructor carries it through all callers. The worker's on-wire response format is unchanged.Evidence
pnpm test <file> --maxWorkers=1: config snapshot 39.37 s; SQLite worker 39.07 s; worker protocol 25.32 s. Shared compiler preparation accounts for much of the wall time; the worker suite additionally exercises real child-process and SQLite snapshot lifecycles.node scripts/check-changed.mjs --timed --base 678572811dd8b10c19ee69e2107947d099dd33c1 -- <all 15 changed paths>completed successfully: all 34 steps passed, including production/test types, lint, dead exports, and ownership guards (1844.64 s).update-command-service.integration.test.ts: it published a real macOS Gateway namespace, then checked it while simulating Linux. The fixture now invokes the real namespace/ancestry classifiers under the host platform, retaining all ownership checks. The original run failed 12 cases in a 297.63 s three-file shard; after the fixture repair, the complete 121-test suite passed three times (363 tests). Single-file invocation wall times were 352.87 s including runtime preparation, 268.56 s, and 233.30 s.src/cli/gateway-cli/pre-bootstrap.process.test.tsfailed the Doctor-repaired escaped-reference case and both fast/Commander--devcases. The file took 425.07 s across 17 isolated Node+TSX launches. The two--devchildren were still progressing at 48.5/50.1 s; the existing 60 s subprocess deadline is suspected, but the raw child error did not expose termination metadata. Follow-up: use the existing prepared-runtime fixture pattern while preserving fresh children, private state, Doctor repair, dispatch, and config-drift assertions.doctor.runs-legacy-state-migrations-yes-mode-without.e2e.test.tsalso hit its existing 30 s guard in “runs legacy state migrations in yes mode without prompting”; the other five cases passed (54.19 s test time, 62.78 s invocation). The migration itself is mocked, but yes-mode executes real database/archive preflight and maintenance admission after lazy imports. The maintenance-phase diagnostic did not appear, so the precise stalled phase remains unknown. Preparing/reusing the lazy Doctor graph while preserving admission and cleanup is follow-up work that needs phase-level diagnosis.update-command-original-service.test.tstook 545.10 s (54 cases each seed and close real session databases);state-migrations.skill-workshop.test.tstook 544.87 s (33 cases, 50 full migration calls plus seven direct Workshop migrations). Fixture-lifecycle optimization remains follow-up work; the required schema, ordering, and artifact-preservation coverage is retained.The reporter's underlying Windows launch trigger is unverified. @nnljl2003, please retry the affected diagnostics on a build containing this fix so the real launch-failure reason prints.