Repository navigation
fix(sqlite): preserve Unicode in worker stderr tails - #137675
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: needs maintainer review before merge. Reviewed September 8, 2026, 10:48 AM ET / 14:48 UTC. ClawSweeper reviewWhat this changesPreserves well-formed Unicode in shortened SQLite worker error messages and adds real-child regression coverage for both truncation boundaries. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and the latest release retain the unsafe truncation. No actionable correctness or security findings remain, and the retained runtime evidence covers the changed behavior. Priority: P2 Review scores
Verification
How this fits togetherSQLite snapshot workers isolate database inspection from the calling process. Their errors flow back to Doctor and other callers through a shared formatter that retains a bounded stderr suffix. flowchart LR
A[Doctor or snapshot caller] --> B[SQLite child worker]
B --> C[Result and stderr]
C --> D{Worker succeeded?}
D -->|Yes| E[Snapshot location]
D -->|No| F[Unicode-safe stderr tail]
F --> G[Caller diagnostic]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +32. Total +35 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep diagnostic normalization in the shared worker error formatter, preserving the existing size bound and snapshot lifecycle. Do we have a high-confidence way to reproduce the issue? Yes: current-main slicing splits the surrogate pair in an emoji followed by 3,999 ASCII characters; the PR also records real-worker and Doctor reproductions. This review established the source mechanism without executing target code. Is this the best way to solve the issue? Yes: reusing the existing Unicode-safe slicer and Node normalizer repairs both boundaries at their shared diagnostic owner without changing database behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f3271158f8d7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…675-20260907 # Conflicts: # src/infra/sqlite-readonly-location.ts
|
Exact-head conflict-resolution evidence ( |
…675-20260907 # Conflicts: # src/infra/sqlite-readonly-worker.ts
|
The completed CI run, attempt 2 remains red for three failures unrelated to this two-file diagnostic repair. The guarded standing CI exception will record all three; no failed check is being called green.
The tested merge was The SQLite repair retains real-worker/Doctor proof, 75 focused tests, final-source boundary checks, independent CLI acceptance and a clean exact-head review. No timeout, assertion, dependency or workflow was changed to accommodate these failures. |
|
landpr-approve-unrelated-red |
|
Thanks @ly85206559! Proof: Real Doctor commands and SQLite child workers, 75 focused tests, both final-source boundary regressions, and 30 independent CLI cases. The final review found no actionable issues.
CI exception: The completed run 34239971456, attempt 2 remains red. The guarded merge uses the exact standing approval record, with complete causal details:
No introducing OpenClaw commit is attributed for the external HTTP error or unresolved Windows stall. No failed check was relabeled passed, and no timeout, assertion, dependency or workflow was weakened. |
## What Problem This Solves Long SQLite worker errors could contain a lone surrogate when the retained stderr tail started inside an astral Unicode character. Node's child-output buffer limit can also split a pair at the other end. ## Why This Change Was Made Keep the shared Unicode-safe suffix helper and normalize any remaining lone surrogate in the selected tail. The 4,000 UTF-16-unit limit, whitespace trimming, error selection, child execution, timeout, cancellation, and database behavior stay unchanged. Extend the real-child regression to cover both boundaries. ## User Impact Doctor and other SQLite snapshot callers receive well-formed diagnostics without an extra replacement glyph at the start of the tail. Normalizing Node's already-truncated output preserves its existing UTF-8 rendering. ## Evidence - Reproduced both failures on pinned current main with real SQLite child processes on Node 24.19.0. - Reproduced the operator-visible start-boundary failure through ordinary `doctor --non-interactive` and `doctor --lint --json`; the rebuilt candidate returns the exact complete suffix. - The start-boundary regression fails on main. The added overflow regression fails on the contributor's helper-only code and passes with normalization. - All 75 focused tests passed, plus changed-file formatting and lint. - All 33 candidate integration controls passed: Unicode boundary cases, ASCII/BMP text, trimming, empty stderr, parser faults, nonzero exits, signals, real 30-second timeouts, cancellation, and usable snapshots. These source-entrypoint controls complement the ordinary CLI proof. - Independent source-blind acceptance ran 30 ordinary CLI cases, observed 66 real workers, and matched all 19 fully visible diagnostic tails exactly. Its raw-parent-string and source-only limits are covered separately by the integration controls and source review. - Fresh source review found no actionable issues. The final typed Node API calls the same normalizer used by the retained runtime proof; both real-child boundary tests passed again after that API adjustment. Hosted CI and the final landing review are enforced on the published head. AI-assisted repair; contributor ancestry and credit are preserved. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Long SQLite worker errors could contain a lone surrogate when the retained stderr tail started inside an astral Unicode character. Node's child-output buffer limit can also split a pair at the other end.
Why This Change Was Made
Keep the shared Unicode-safe suffix helper and normalize any remaining lone surrogate in the selected tail. The 4,000 UTF-16-unit limit, whitespace trimming, error selection, child execution, timeout, cancellation, and database behavior stay unchanged. Extend the real-child regression to cover both boundaries.
User Impact
Doctor and other SQLite snapshot callers receive well-formed diagnostics without an extra replacement glyph at the start of the tail. Normalizing Node's already-truncated output preserves its existing UTF-8 rendering.
Evidence
doctor --non-interactiveanddoctor --lint --json; the rebuilt candidate returns the exact complete suffix.AI-assisted repair; contributor ancestry and credit are preserved.