Skip to content

fix(cli): report config read failures without repair advice - #158671

Merged
fuller-stack-dev merged 1 commit into
mainfrom
fix/cli-config-read-failure-20260926
Sep 26, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
fix/cli-config-read-failure-20260926

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Related: #158455

What Problem This Solves

Fixes misleading invalid-config errors and doctor --fix advice when the CLI cannot read configuration or its backing metadata.

User Impact

Operators see the read failure and its original cause without being prompted to modify a configuration that has not been shown to be invalid. Invalid JSON and schema errors retain their existing diagnosis and repair guidance.

Why This Change Was Made

The snapshot loader already distinguishes read failures, but CLI readiness and validation discarded that distinction. Share the existing classification across those consumers and the updater while preserving command admission and exit behavior.

This does not relax SQLite snapshot consistency checks or solve starvation during continuous checkpoints. Those failures must remain visible and retryable without suggesting a configuration repair.

Evidence

  • A private SQLite database under real concurrent checkpoints reproduced CONFIG_READ_FAILED with unchanged config bytes. Readiness now preserves that classification and omits mutating repair advice.
  • All 70 focused config-read, config-guard, and updater-invalid-config tests passed. The separate append-only concurrent snapshot suite passed all 5 tests.
  • New test cost on published head: pnpm test src/cli/config-read-failure.test.ts --maxWorkers=1 passed 7/7 in 70.388 s cold command wall time, with reported case durations totaling 1.234 s. The cold run spent 83% of Vitest time transforming modules; it exercises real config readers and readiness/validation entrypoints so a mocked snapshot cannot bypass the regression. In CI job 108345868548, all seven cases passed with reported durations totaling 0.276 s. The shared multi-file job took 272 s overall, not attributable to this one file.
  • The entire new seven-case integration test file was audited for observable assertions, isolation, and cleanup. No existing tests were removed or weakened.
  • Independent API review found no actionable P0–P2 findings. Source-blind acceptance passed all five clauses across seven actual CLI invocations, including restored includes and varying valid inputs.
  • Targeted native lint and the first 16 local repository checks passed. Local typechecking stopped at the shared-dependency location guard. Required hosted CI, including every production and test typecheck, passed on published head 884f8b6.
  • Public CLI recordings below use only a synthetic missing-include fixture. Both exit nonzero and preserve config bytes. The deployed base calls it invalid; the candidate reports the read failure and retains the cause.

Red, deployed 50df80460acb5bb44f77431e92e8347e72df3a5e:

https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/publish/publish/20260926-051757-124870000/base-cli.mp4?X-Amz-Expires=604800&X-Amz-Date=20260926T051757Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20260926%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=af401b21bc4dfd784b6417a98820c475eb922e7057e51965c5eead970edbb556

Green, reviewed candidate 1689e055b17144ed0b450dfd3222662dedfe6d6c. Published head 884f8b6f166b16d1e6879c66277d29d26e27da9a rebases the identical seven file blobs onto current main; intervening changes do not affect this contract:

https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/publish/publish/20260926-051757-124870000/head-cli.mp4?X-Amz-Expires=604800&X-Amz-Date=20260926T051757Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20260926%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=177c086d7410b978258b21ef4249167e06d9dae7f81cb47aac6760cf631d3559

Raw captures and artifact manifest

@clawsweeper

clawsweeper Bot commented Sep 26, 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 cli CLI command changes commands Command implementations size: S labels Sep 26, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 26, 2026 05:23
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 26, 2026, 1:34 AM ET / 05:34 UTC.

ClawSweeper review

What this changes

The branch makes CLI configuration errors distinguish unreadable files and includes from invalid input, while preserving repair guidance for invalid JSON and schema errors.

Merge readiness

⛔ Needs changes before merge - 2 items remain

This PR remains useful. The merged update fix distinguishes read failures in update reporting, but current main still labels those failures as invalid configuration in CLI readiness and validation. The proposed CLI change is focused; the new test suite’s required cost disclosure remains outstanding.

Priority: P2
Reviewed head: 884f8b6f166b16d1e6879c66277d29d26e27da9a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused patch follows the existing snapshot classification and has specific reported CLI proof; the new suite’s cost still needs disclosure.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its body describes real before/after CLI runs for a missing include, matching the changed output path; this reviewer could not play the downloaded MP4s because ffprobe is absent and browser access failed, or verify the unavailable earlier candidate commit against the pinned head. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its body describes real before/after CLI runs for a missing include, matching the changed output path; this reviewer could not play the downloaded MP4s because ffprobe is absent and browser access failed, or verify the unavailable earlier candidate commit against the pinned head. No stored-data contract changes.
Evidence reviewed 8 items Current main still mislabels CLI read failures: The fetched main revision prints “OpenClaw config is invalid” in the CLI readiness and validation paths; no matching read-failure heading was found in those CLI paths.
Snapshot classification source: The reader marks include-read failures with CONFIG_READ_FAILED; the outer read-failure path also records that issue code without broadening the separate unavailable-source write guard.
Proposed CLI behavior: Read failures use a shared heading and suppress automatic Doctor recovery, while the existing invalid-input recovery path remains available.
Findings 1 actionable finding [P3] Record the new suite’s measured cost
Security None None.

How this fits together

CLI commands and the updater consume a configuration snapshot produced by the config reader. They use its failure classification to decide what to display and whether a command may continue.

flowchart LR
A[CLI or update command] --> B[Configuration snapshot reader]
B --> C{Failure type}
C -->|Read failure| D[Read error and retry guidance]
C -->|Invalid input| E[Validation and Doctor guidance]
D --> F[Command admission or exit]
E --> F
Loading

Before merge

  • Record the new suite’s measured cost (P3) - This adds a seven-case test file, but the PR body gives no measured pnpm test src/cli/config-read-failure.test.ts --maxWorkers=1 wall time or CI seconds. The repository’s test policy requires those figures so reviewers can check the per-PR runtime budget; add them to the PR body.
  • Complete next step (P2) - Add measured wall time for the new test file and its CI seconds to the PR body.

Findings

  • [P3] Record the new suite’s measured cost — src/cli/config-read-failure.test.ts:42-44
Agent review details

Security

None.

PR surface

Source +38, Tests +108. Total +146 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 6 59 21 +38
Tests 1 108 0 +108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 167 21 +146

Review metrics

Metric Value Why it matters
Production versus test lines production +59/−21; tests +108/−0 The production growth centralizes failure classification and updates its CLI consumers; the new test file carries most of the added lines.

Technical review

Best possible solution:

Keep the snapshot reader as the classification owner and use its result across CLI outputs, preserving command admission and Doctor guidance for genuinely invalid input.

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

Yes. On current main, a missing include receives the reader’s read-failure code while CLI readiness still prints an invalid-config heading; this review established the path from source without executing it.

Is this the best way to solve the issue?

Yes. Sharing the existing snapshot classification across the affected CLI consumers is a narrow repair that leaves invalid-input handling and updater admission intact.

Full review comments:

  • [P3] Record the new suite’s measured cost — src/cli/config-read-failure.test.ts:42-44
    This adds a seven-case test file, but the PR body gives no measured pnpm test src/cli/config-read-failure.test.ts --maxWorkers=1 wall time or CI seconds. The repository’s test policy requires those figures so reviewers can check the per-PR runtime budget; add them to the PR body.
    Confidence: 0.96

Overall correctness: patch is correct
Overall confidence: 0.87

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 63f1dec2b57e.

Labels

Label changes:

  • add P2: Misleading CLI repair advice affects operators, while the patch is a bounded diagnostic correction.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its body describes real before/after CLI runs for a missing include, matching the changed output path; this reviewer could not play the downloaded MP4s because ffprobe is absent and browser access failed, or verify the unavailable earlier candidate commit against the pinned head. No stored-data contract changes.

Label justifications:

  • P2: Misleading CLI repair advice affects operators, while the patch is a bounded diagnostic correction.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate. Its body describes real before/after CLI runs for a missing include, matching the changed output path; this reviewer could not play the downloaded MP4s because ffprobe is absent and browser access failed, or verify the unavailable earlier candidate commit against the pinned head. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add the new test file’s measured wall time and CI seconds to the PR body.

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.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Addressed the test-cost disclosure in the PR Evidence section. On published head 884f8b6, the requested single-file command passed 7/7 in 70.388 s cold wall time, with 1.234 s in the reported case durations. The cold run was dominated by module transformation. CI passed the same seven cases in 0.276 s of reported case durations: job log. The shared multi-file job took 272 s overall.

All required CI, production types, and test types passed. No product or test source changed in response to this disclosure request.

@fuller-stack-dev
fuller-stack-dev merged commit fac6042 into main Sep 26, 2026
286 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/cli-config-read-failure-20260926 branch September 26, 2026 05:47
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 26, 2026
* commit '66b812f26e725cd709e08860d2cb46ba496cd308': (70 commits)
  fix(gateway): preserve typed boxed-number coercion
  chore(ui): refresh control ui locales (#158689)
  fix(gateway): reset staged headers on authority errors (#158669)
  fix(workers): keep inbound staging stable during quota scans
  fix: preserve Telegram delivery after bot identity changes (#158612)
  fix(ui): keep automation starter prompts out of startup (#158482)
  fix(cli): distinguish configuration read failures from invalid input (#158671)
  test: remove retired progress coercion suppression allowance
  refactor(gateway): schedule worker placement maintenance (#158662)
  fix(daemon): keep native service checks within their timeout (#154565)
  fix(test): restore gateway steering fixture contracts (#158478)
  fix(acpx): use SDK filesystem publication boundary
  fix(agentsapi): load OpenClaw persona and workspace context (#158328)
  fix(gateway): drop progress snapshot coercion suppression
  fix(qa): accept native Codex truncation in cache evidence (#158454)
  fix(gateway): keep chat subscriptions stable during unrelated approvals (#158633)
  perf(gateway): release event payloads from live text guards (#158643)
  perf(sessions): reduce stalls when saving large chat messages (#158402)
  fix(qa): reject history-bearing utility requests without session affinity (#158496)
  test: allow intentional progress snapshot coercion
  ...
vincentkoc added a commit that referenced this pull request Sep 26, 2026
* fix(test): verify followup completion ordering

Exercise the real presentation settlement helper with asynchronous cleanup, preserve continuation and admission semantics, and unconditionally release and join the held work. Remote proof covers the strengthened ordering contract and both missing-await faults.

* fix(test): verify followup completion ordering

* chore: retain followup test branch ancestry

The current-main reconstruction preserves the original reviewed scope and supersedes its stale base. Keep the remotely qualified candidate tree unchanged while retaining the original PR ancestry for a non-force branch update.

* commit 'ff35145de21cf6296bec05e86bee37b5ed53bcb8':
  fix(test): verify followup completion ordering

* test(auto-reply): signal queued presentation entry

* chore: refresh followup test on boundary fix

* commit '66b812f26e725cd709e08860d2cb46ba496cd308': (70 commits)
  fix(gateway): preserve typed boxed-number coercion
  chore(ui): refresh control ui locales (#158689)
  fix(gateway): reset staged headers on authority errors (#158669)
  fix(workers): keep inbound staging stable during quota scans
  fix: preserve Telegram delivery after bot identity changes (#158612)
  fix(ui): keep automation starter prompts out of startup (#158482)
  fix(cli): distinguish configuration read failures from invalid input (#158671)
  test: remove retired progress coercion suppression allowance
  refactor(gateway): schedule worker placement maintenance (#158662)
  fix(daemon): keep native service checks within their timeout (#154565)
  fix(test): restore gateway steering fixture contracts (#158478)
  fix(acpx): use SDK filesystem publication boundary
  fix(agentsapi): load OpenClaw persona and workspace context (#158328)
  fix(gateway): drop progress snapshot coercion suppression
  fix(qa): accept native Codex truncation in cache evidence (#158454)
  fix(gateway): keep chat subscriptions stable during unrelated approvals (#158633)
  perf(gateway): release event payloads from live text guards (#158643)
  perf(sessions): reduce stalls when saving large chat messages (#158402)
  fix(qa): reject history-bearing utility requests without session affinity (#158496)
  test: allow intentional progress snapshot coercion
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
* fix(test): verify followup completion ordering

Exercise the real presentation settlement helper with asynchronous cleanup, preserve continuation and admission semantics, and unconditionally release and join the held work. Remote proof covers the strengthened ordering contract and both missing-await faults.

* fix(test): verify followup completion ordering

* chore: retain followup test branch ancestry

The current-main reconstruction preserves the original reviewed scope and supersedes its stale base. Keep the remotely qualified candidate tree unchanged while retaining the original PR ancestry for a non-force branch update.

* commit 'ff35145de21cf6296bec05e86bee37b5ed53bcb8':
  fix(test): verify followup completion ordering

* test(auto-reply): signal queued presentation entry

* chore: refresh followup test on boundary fix

* commit '622be54be3ffe0fce27d6a4b147c76d4b19c528c': (70 commits)
  fix(gateway): preserve typed boxed-number coercion
  chore(ui): refresh control ui locales (openclaw#158689)
  fix(gateway): reset staged headers on authority errors (openclaw#158669)
  fix(workers): keep inbound staging stable during quota scans
  fix: preserve Telegram delivery after bot identity changes (openclaw#158612)
  fix(ui): keep automation starter prompts out of startup (openclaw#158482)
  fix(cli): distinguish configuration read failures from invalid input (openclaw#158671)
  test: remove retired progress coercion suppression allowance
  refactor(gateway): schedule worker placement maintenance (openclaw#158662)
  fix(daemon): keep native service checks within their timeout (openclaw#154565)
  fix(test): restore gateway steering fixture contracts (openclaw#158478)
  fix(acpx): use SDK filesystem publication boundary
  fix(agentsapi): load OpenClaw persona and workspace context (openclaw#158328)
  fix(gateway): drop progress snapshot coercion suppression
  fix(qa): accept native Codex truncation in cache evidence (openclaw#158454)
  fix(gateway): keep chat subscriptions stable during unrelated approvals (openclaw#158633)
  perf(gateway): release event payloads from live text guards (openclaw#158643)
  perf(sessions): reduce stalls when saving large chat messages (openclaw#158402)
  fix(qa): reject history-bearing utility requests without session affinity (openclaw#158496)
  test: allow intentional progress snapshot coercion
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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