Skip to content

fix(update): keep config field details and distinguish read failures from invalid config - #158455

Merged
steipete merged 3 commits into
mainfrom
upd/closed-report-config-diagnostics
Sep 26, 2026
Merged

steipete merged 3 commits into
mainfrom
upd/closed-report-config-diagnostics

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes update refusals losing configuration-field details and mislabeling configuration loading failures as invalid configuration, including on same-version updates.

Refs #158191 #157873 #157846.

User Impact

Validation failures retain local file and field paths and sanitized public key families. File, include, and configuration-processing failures report config-read-failed with the appropriate next action. The distinction survives admission, post-core plugin convergence, and saved recovery.

Why This Change Was Made

One config-failure owner now supplies the reason, bounded facts, and guidance. The snapshot reader uses existing diagnostic metadata without broadening the unavailable-source write/reset guard. Existing candidate-protocol field lines are compacted before diagnostic normalization can discard them; the protocol and post-core assessment shapes remain unchanged.

Same-version updates still need usable configuration for channel persistence, state-path admission, and maintenance. Doctor remains the owner of supported legacy repairs. Typed SQLite maintenance errors already propagate on main; this change preserves that behavior and does not replace the separate database rollback repair. Older installed updaters cannot recover diagnostics they already discarded.

Evidence

  • Negative controls reproduced lost field facts, mislabeled file/materialization/include failures, the missing saved-recovery predicate, and package-manager probing that obscured the original config error. Post-core tests exercise real unreadable/invalid snapshots through the preparation owner. Three duplicate synthetic/helper assertions and their helper-only export were removed.
  • Five changed suites passed three times: 253 tests per pass. Following a strict-indexed-access correction, the affected public-report and redaction suites passed three times (106 + 31 tests per pass). Native build/declaration preparation passed; its 9m27s was compiler preparation.
  • The original broad import run passed 7,151 tests and caught a missing local config-file path. The path is restored and the original 17-test schema-preflight suite passed three times using pnpm test src/cli/update-cli/schema-preflight.test.ts --maxWorkers=1: 39.757 / 29.266 / 26.795 seconds wall, 10.239 / 10.028 / 9.401 seconds test time. Focused proof.
  • The remaining-file invocation stopped before assertions because the normal Gateway project excludes src/gateway/gateway-models.profiles.live.test.ts. That explicit live-only gap is recorded below. All other 45 remaining files passed: 1,065 tests, including both channel files, with production code unchanged by the final fixture-only lint repair (final runtime proof). The command took 1,411.956 seconds including 614.5 seconds of native build preparation. node scripts/check-changed.mjs -- <all 23 changed paths> passed on final tree 730cfa0cb0a7154cd02b975a7fcb715a2f753ac0 in 507.616 seconds, including all selected type graphs, lint (zero warnings/errors), dead-export scans, and subsequent guards (final changed-check proof, lease tbx_01m3dbhwebk3qw50rdxypqf30x). All 23 source hashes were reverified after execution. Fresh independent Codex autoreview of the complete final candidate passed with no actionable P0–P2 findings.
Focused test cost (three passes per file)

Measured with pnpm test <file> --maxWorkers=1; wall time includes shared preparation. These are the latest applicable runs, including the report/redaction repeat after the strict-indexed-access correction and schema-preflight after path restoration.

File Wall seconds Test seconds
update-command-invalid-config.test.ts 16.559–21.259 0.649–0.718
update-command-plugins.degradation.test.ts 28.985–56.190 14.056–25.609
update-command.test.ts 14.976–20.857 0.264–0.397
update-failure-report-prepare.test.ts 20.504–30.322 0.064–0.069
update-triage-resolution.test.ts 13.701–15.588 0.102–0.171
diagnostic-support-redaction.test.ts 2.032–3.125 0.136–0.239
schema-preflight.test.ts 26.795–39.757 9.401–10.239

Changed-file lint identified an unnecessary map/spread in the invalid-config case table. The fixture now constructs the same cases directly, preserving all assertions, and passed 8 tests three times.

The new post-core read cases take about 6–7 ms; existing plugin scenarios dominate that file's test time.

Change size: production +171/−96 lines; tests and fixture support +194/−105; docs +9/−3. Proof uses isolated Linux state. Hosted CI timing is pending the PR run.

Known gaps / follow-ups

src/gateway/server.chat-cli-auth.test.ts — chat.send keeps native account history when a saved token appears and uses it for a new session > preserves account selection and session history took 46.565 seconds in the broad run. This pre-existing scenario combines six real Gateway turns, account transitions, and a deliberate Gateway restart. Reducing that composition's cost belongs in a separate fixture/scenario follow-up; it is accepted as non-blocking for this PR. No timeout, retry, assertion, or skip was changed.

test/e2e/qa-lab/runtime/doctor-auth-secretref-checks.e2e.test.ts — preserves SecretRef ownership while proving resolution, fallback, exec gating, and token generation passed in 229.946 seconds. This pre-existing scenario composes six full Doctor CLI calls. Its process-composition cost is also retained as a follow-up under the slow-gate ruling; no test timeout, assertion, or execution path was changed.

src/gateway/gateway-models.profiles.live.test.ts is excluded by the normal Gateway configuration (**/*.live.test.ts). Selecting it alone for that shard produces “No test files found” and stops the serial runner. It remains an explicit live-provider coverage gap; the other remaining import files are checked separately.

The original reports omitted the rejected field, so this change cannot identify those installations' particular config error or establish a Node-version defect.

@clawsweeper

clawsweeper Bot commented Sep 25, 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 cli CLI command changes size: L labels Sep 25, 2026
@steipete
steipete marked this pull request as ready for review September 25, 2026 23:58
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 2288d9146c911645546be7284907dbe49e7136c2
  • 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.

@steipete
steipete enabled auto-merge (squash) September 26, 2026 00:06
@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 Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 25, 2026, 8:05 PM ET / September 26, 2026, 00:05 UTC.

ClawSweeper review

What this changes

The branch changes how OpenClaw's updater classifies configuration read and validation failures, carries field details into saved results, sanitizes public reports, and updates tests and CLI documentation.

Merge readiness

⛔ Blocked before merge - 2 items remain

Current main and the latest release still have the diagnostic gap this PR addresses. The branch is useful and recent; the remaining merge question is how its result behaves when a published updater invokes the candidate.

Priority: P2
Reviewed head: 2288d9146c911645546be7284907dbe49e7136c2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has focused boundary coverage and no identified correctness defect, with upgrade behavior still awaiting the repository's required production-path proof.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Isolated tests exercise updater admission, post-core classification, and report redaction, but the repository's published-updater × candidate proof is not shown. The stored reason field remains a free string, and saved recovery covers the new value.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Isolated tests exercise updater admission, post-core classification, and report redaction, but the repository's published-updater × candidate proof is not shown. The stored reason field remains a free string, and saved recovery covers the new value.
Evidence reviewed 9 items Current-main gap: Current main still reports unreadable candidate configuration as invalid configuration and has no shared config-failure owner.
Release check: The latest listed release, v2026.9.6, does not contain the new config-failure owner.
Introduced classification: The new owner distinguishes read failures from invalid fields and supplies bounded failure facts and different next actions.
Findings None None.
Security None None.

How this fits together

The CLI updater reads configuration during installed and candidate admission and again during plugin convergence. A refusal feeds local guidance, saved recovery, and an optional sanitized public report.

flowchart LR
 A[Installed updater] --> B[Candidate admission]
 B --> C[Configuration snapshot]
 C --> D{Read or validation failure}
 D --> E[Local refusal]
 E --> F[Saved recovery]
 F --> G[Sanitized public report]
Loading

Before merge

  • Resolve merge risk (P1) - The required published-updater × candidate proof is not shown. An installed updater runs first, so isolated candidate tests alone do not establish which refusal details reach an upgrading user.
  • Complete next step (P2) - Capture the repository-required published-updater × candidate result for invalid and unreadable configuration before merge.
Agent review details

Security

None.

PR surface

Source +75, Tests +89, Docs +6. Total +170 across 23 files.

View PR surface stats
Area Files Added Removed Net
Source 16 171 96 +75
Tests 6 194 105 +89
Docs 1 9 3 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 374 204 +170

Review metrics

Metric Value Why it matters
Failure classification 1 new reason; 1 saved-recovery family updated Saved recovery must recognize the same failure reason that admission records.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/cli/update-cli/schema-preflight.ts, migration/backfill/repair: src/cli/update-cli/update-command-config-failure.ts, migration/backfill/repair: src/cli/update-cli/update-command-plugins-internals.ts, unknown-data-model-change: src/cli/update-cli/schema-preflight.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Make local update refusals identify the actionable configuration field or read cause while public reports reveal only safe schema families, and verify that behavior through a published updater invoking the candidate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Make local update refusals identify the actionable configuration field or read cause while public reports reveal only safe schema families, and verify that behavior through a published updater invoking the candidate.

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

Yes, at source level: current main conflates unreadable and invalid configuration in candidate admission, and the PR's isolated tests exercise the affected updater paths. I did not run the updater.

Is this the best way to solve the issue?

Yes, a shared snapshot-derived classifier and the existing public-redaction owner form a narrow repair. Published-updater proof is still needed to establish the upgrade result.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This improves diagnosis of blocked updates, while the underlying invalid configuration or database rollback failures remain separate work.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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 maintainer-authored PR is exempt from the external-contributor proof gate. Isolated tests exercise updater admission, post-core classification, and report redaction, but the repository's published-updater × candidate proof is not shown. The stored reason field remains a free string, and saved recovery covers the new value.

Label justifications:

  • P2: This improves diagnosis of blocked updates, while the underlying invalid configuration or database rollback failures remain separate work.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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-authored PR is exempt from the external-contributor proof gate. Isolated tests exercise updater admission, post-core classification, and report redaction, but the repository's published-updater × candidate proof is not shown. The stored reason field remains a free string, and saved recovery covers the new value.

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)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

  • Show a published v2026.9.6 updater invoking this candidate for invalid and unreadable configuration, including the resulting local refusal and sanitized report.

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.

@steipete
steipete merged commit 31cd888 into main Sep 26, 2026
286 of 287 checks passed
@steipete
steipete deleted the upd/closed-report-config-diagnostics branch September 26, 2026 00:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…from invalid config (openclaw#158455)

* fix(update): retain config refusal details and distinguish read failures

* fix(update): retain config path in validation guidance

* test(update): construct config cases without map spreads
roboclaw-bot added a commit that referenced this pull request Sep 27, 2026
Backport #158354 from b31c0ac.
Backport #158455 from 31cd888.
Source author: Peter Steinberger.

Record otherwise-unreported settled failures before interactive reporting;
keep nested primary failures, pending recovery and committed outcomes intact.
Observer failures cannot replace or redeliver terminal results.

Distinguish config-read-failed from invalid-config at the target's existing
owners. Keep local rejected-field detail while masking operator keys and values
in public reports. Do not import main-only candidate admission or alter no-op
ordering. Preserve unavailable-source write fencing.

Move all three legacy result assertions to a complete typed snapshot fixture.
Repair the preexisting settlement test's incomplete ChildProcess cast with an
unspawned real ChildProcess, retaining the seven original assertions.

Proof: terminal 10 red then 77 green; installed config 8, classification 20,
public reporting 106, triage 66, migrated assertions 3, config siblings 79,
settlement fixture 7. These are distinct scoped receipts, not a full-suite claim.
Production and owning CLI/config/services types, lint, frozen ratchets and
independent review pass. Unchanged linked-plugin/real-npm baseline failures
remain recorded. Database composition proof and publication remain pending.

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: jalehman <[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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: L 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