Skip to content

fix: preserve schema worker causes in update reports - #164169

Merged
steipete merged 1 commit into
mainfrom
codex/update-schema-diagnostic-cause
Oct 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/update-schema-diagnostic-cause

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes update failure reports losing recognized schema-worker errors when private source paths or earlier warning lines appear first.

User Impact

Operators retain useful permission, module-load, SQLite, and numeric GLIBC diagnostics while private paths, quoted filename suffixes, and arbitrary worker prose remain hidden behind the existing source boundary. This repairs reporting; it does not fix or identify the underlying worker exit.

Why This Change Was Made

The worker emits an allowlisted error code before its full diagnostic, preserving the existing final error line and stdout JSON. The diagnostic envelope promotes only the canonical public summary before source context. Quoted paths now receive the same conservative suffix redaction as unquoted paths because filenames can contain quotes. Existing SQLite public codes move into the shared allowlist rather than introducing a second policy.

Native error causes remain intact because they carry cleanup and process-outcome ownership. Follow-up: define a closed public projection for structured update error causes while preserving their operational graphs; their existing first-line prose policy is unchanged here.

Evidence

Regressions reproduced the original source-path loss, embedded-quote leakage, nested and plain module-error loss, multiline and SQLite-warning loss, and private-prose exposure in the initial draft. The repaired composed tests and shared redactor suite pass. Existing real-worker cleanup, Gateway reporting, and numeric GLIBC report cases also pass.

All planned changed-file checks completed: production and all 27 core-test type graphs, export scans, lint, schema, import-cycle, and remaining guards passed. The full wrapper stopped at two unnecessary escapes in a test literal; after that behavior-preserving cleanup, exact lint and the remaining planned guards passed. Earlier passing checks were reused. Five existing cleanup-custody cases also pass.

No production update or service restart is part of this change.

The exact-head CI run passed. Its published-driver update cell upgraded published [email protected] to candidate source fab30eb40032834a6d9b16712265a13f26e45bba (the tested merge of base 01f838a2b4215 and this PR head 789b6b63b6d0). The canonical harness relabeled candidate version metadata from 2026.9.7 to 2026.9.8; the source commit and build ID remained unchanged. The downloaded candidate input checksum matched ed64855f815c8ab79f53e6adc5f65b2d1629ae093ff272d7531346923e244d87. The update finished successfully, replaced the managed service, and returned /readyz HTTP 200; the observed serving build ID matched the candidate (2026.9.7-fab30eb40032-2026-10-03T08-33-31.140Z). Update command: 566.845 s; cell step: 633 s; job: 655 s. This upgrade result complements the focused diagnostic-failure regressions.

One-worker costs use pnpm test <file> --maxWorkers=1 on macOS, Node v26.10.0, with the task-owned warm transform cache. CI times are the corresponding per-file shard wrapper durations in the linked run.

Test file Local command wall Local Vitest wall CI shard wall (Vitest wall)
src/infra/update-candidate-state.diagnostics.test.ts 6.506 s 2.57 s 1.80 s (0.928 s; Bun-labelled shard)
src/logging/diagnostic-support-redaction.test.ts 3.199 s 1.23 s 2.26 s (1.51 s)

Promote only recognized diagnostic summaries before private source context. Keep native error causes for cleanup ownership, preserve worker stdout and its final error line, and redact complete quoted path suffixes.
@clawsweeper

clawsweeper Bot commented Oct 3, 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 size: M labels Oct 3, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 5:03 AM ET / 09:03 UTC (Revision 3).

ClawSweeper review

What this changes

The PR preserves recognized schema-worker errors in update reports while redacting private path suffixes, and adds regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

The PR remains useful, and no introduced correctness or security defect was found. Both earlier review requests are addressed; no additional required action remains. Likely related people: steipete, supported by prior merged work on update diagnostics.

Priority: P2
Reviewed head: 789b6b63b6d07257088240fa321a61285a5d8f35

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported repair with useful regression coverage, recorded upgrade verification, and no blocking finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-author exemption applies. Separately, the captured published-driver cell verifies a real 2026.9.8-to-candidate upgrade and healthy service recovery; focused diagnostic regressions supplement it without claiming the successful upgrade exercised failure reporting. No stored-data contract changes. Raw Actions logs were inaccessible to this reviewer.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies. Separately, the captured published-driver cell verifies a real 2026.9.8-to-candidate upgrade and healthy service recovery; focused diagnostic regressions supplement it without claiming the successful upgrade exercised failure reporting. No stored-data contract changes. Raw Actions logs were inaccessible to this reviewer.
Evidence reviewed 8 items Verified introduced patch and merge result: Inspected the pinned merge-base-to-head patch and the verified test merge against its main parent. The reporting and redaction changes survive the three-way merge; unrelated base changes are not attributed to this PR.
Current main still needs the repair: Fetched main still places source context before the worker diagnostic in the failure envelope. Its worker formatter lacks this PR's recognized-code prefix, so the central repair is not already implemented there.
Reporting and privacy boundary: Read the complete diagnostic owner, worker, inspection callers, error formatter, failure-fact owner, and shared redactor. The public summary precedes source context, SQLite codes use the shared allowlist, and quoted paths discard their complete suffix. Native causes and stdout JSON remain intact; no stored-data format or authorization contract changes.
Findings None None.
Security None None.

How this fits together

The updater runs database inspection in a subprocess and converts its diagnostics into saved failure reports. Shared support redaction keeps recognized error facts while removing private paths and arbitrary diagnostic text.

flowchart TD
  A[Update request] --> B[Database inspection worker]
  B --> C[Worker errors and progress]
  C --> D[Diagnostic envelope]
  D --> E[Public error allowlist and redaction]
  E --> F[Saved update failure report]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +14, Tests +209, Docs +4. Total +227 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 45 31 +14
Tests 2 209 0 +209
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 258 31 +227

Review metrics

None.

Technical review

Best possible solution:

Keep recognized worker facts ahead of private source context using the shared redaction owner, while preserving process-cleanup causes and the existing worker protocol.

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

Yes, source establishes the failure path: a private source path precedes the worker error, and saved diagnostic redaction discards that suffix. The composed regressions cover this path; no local runtime reproduction was executed.

Is this the best way to solve the issue?

Yes, promoting only recognized public facts through the existing redactor is a focused repair that preserves worker output and cleanup ownership.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded improvement to actionable update-failure reporting, with no demonstrated urgent runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-author exemption applies. Separately, the captured published-driver cell verifies a real 2026.9.8-to-candidate upgrade and healthy service recovery; focused diagnostic regressions supplement it without claiming the successful upgrade exercised failure reporting. No stored-data contract changes. Raw Actions logs were inaccessible to this reviewer.

Evidence

What I checked:

  • Verified introduced patch and merge result: Inspected the pinned merge-base-to-head patch and the verified test merge against its main parent. The reporting and redaction changes survive the three-way merge; unrelated base changes are not attributed to this PR. (src/infra/update-candidate-state.diagnostics.ts:16, 789b6b63b6d0)
  • Current main still needs the repair: Fetched main still places source context before the worker diagnostic in the failure envelope. Its worker formatter lacks this PR's recognized-code prefix, so the central repair is not already implemented there. (src/infra/update-candidate-state.diagnostics.ts:137, dd66b6780734)
  • Reporting and privacy boundary: Read the complete diagnostic owner, worker, inspection callers, error formatter, failure-fact owner, and shared redactor. The public summary precedes source context, SQLite codes use the shared allowlist, and quoted paths discard their complete suffix. Native causes and stdout JSON remain intact; no stored-data format or authorization contract changes. (src/logging/diagnostic-support-redaction.ts:379, 789b6b63b6d0)
  • Focused regression coverage: Read both complete changed test suites. Composed tests exercise worker formatting through saved failure facts for nested codes, warning lines, multiline output, private prose, credential masking, and POSIX, Windows, and UNC paths. The PR body records original failures and passing repaired cases; tests were not executed during this read-only review. (src/infra/update-candidate-state.diagnostics.test.ts:37, 789b6b63b6d0)
  • Earlier review requests satisfied: The captured PR body supplies the published 2026.9.8 updater-to-candidate verification, candidate checksum and serving build identity, successful service replacement and readyz HTTP 200, plus local one-worker and CI costs for both changed suites. This addresses both retained rank-up requests. (789b6b63b6d0)
  • Published-driver job independently verified: GitHub reports https://github.com/openclaw/openclaw/actions/runs/37109980383/job/111166659683 successful for the pinned head, including candidate download, published-driver update, and synthetic diagnostics preservation. Raw log retrieval was blocked by the sandbox allowlist for results-receiver.actions.githubusercontent.com; the captured runtime transcript remains valid evidence, with that independent-inspection limitation disclosed. (789b6b63b6d0)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-03T08:22:03.960Z sha 789b6b6 :: needs changes before merge. :: none
  • reviewed 2026-10-03T08:34:15.110Z sha 789b6b6 :: needs changes before merge. :: none

@steipete
steipete marked this pull request as ready for review October 3, 2026 08:31
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 789b6b63b6d07257088240fa321a61285a5d8f35
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/logging/diagnostic-support-redaction.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 3, 2026
@steipete
steipete merged commit 97f01e2 into main Oct 3, 2026
213 checks passed
@steipete
steipete deleted the codex/update-schema-diagnostic-cause branch October 3, 2026 09:06
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Promote only recognized diagnostic summaries before private source context. Keep native error causes for cleanup ownership, preserve worker stdout and its final error line, and redact complete quoted path suffixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant