Skip to content

fix(config): preserve plugin metadata for missing config - #119421

Merged
vincentkoc merged 1 commit into
mainfrom
fix/missing-config-plugin-metadata
Aug 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/missing-config-plugin-metadata

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where operators starting OpenClaw without an existing config file could have a second fresh process reject gateway startup because the validation snapshot omitted plugin metadata and could not prove convergence.

Why This Change Was Made

The config I/O owner now loads plugin metadata for explicit metadata reads whenever the config snapshot is valid, including the valid missing-file {} snapshot. Plain snapshot reads remain scan-free, invalid snapshots remain fail-closed, and the preflight checkpoint contract is unchanged.

Root cause: the missing-config fast path returned a valid source config without the plugin metadata snapshot required by the cross-process convergence comparison.

Architectural owner: src/config/io.snapshot.ts, where config snapshots and optional validation metadata are assembled.

Canonical fix: complete the explicit plugin-metadata read at the producer instead of adding another caller retry or weakening convergence checks.

Removed paths: none. No compatibility path, checkpoint fallback, retry, config persistence, public type, or schema change was added.

Production delta: +12/-3 lines (+9 net), justified by restoring the existing explicit metadata-read contract at its owner boundary. Tests add 190 net lines.

User Impact

Fresh gateway processes can converge when no config file exists. Ordinary config reads still avoid plugin discovery, invalid config remains invalid, and no config file is created as a side effect.

Evidence

  • Exact-head focused proof: 5/5 tests passed across the config snapshot and two-process doctor preflight surfaces.
  • The process test proves two fresh built processes both exit successfully, the second observes the checkpoint, and the config file remains absent.
  • Sibling coverage proves plain snapshot reads do not create the metadata loader and invalid snapshots are not upgraded with metadata.
  • git diff --check and targeted formatting passed.
  • The scoped changed gate reached a pre-existing plugin-sdk:surface:check baseline drift that was independently reproduced on clean base 50c7444edf4; this branch does not touch Plugin SDK or generated baseline files.
  • Remote Testbox run https://github.com/openclaw/openclaw/actions/runs/30966367254 was cancelled after the backend hung inside the Testbox step for 45 minutes; it produced no repository failure or log artifact.
  • Exact-commit autoreview thread 019fcfbf-192a-7f01-92e2-77632c90b2c7 reported no findings and rated the patch correct at 0.98 confidence.
  • The exact commit is signed, independently reviewed, and Punchcard-attested.

AI-assisted: yes. The maintainer understands the change and verified the exact diff and focused proof.

Punchcard-Session: amber-orchard-valley-s4

Punchcard-Session: amber-orchard-valley-s4
@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M labels Aug 5, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 5, 2026 02:28
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 11:17 PM ET / August 5, 2026, 03:17 UTC.

ClawSweeper review

What this changes

The PR loads plugin metadata for explicit valid missing-config snapshot reads and adds direct and two-process checkpoint regression coverage.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still omits plugin metadata for a valid missing config, while preflight uses that metadata in its checkpoint identity; this producer-side repair is targeted and has no concrete correctness finding. As a member-authored PR, it should remain for normal maintainer merge handling.

Priority: P2
Reviewed head: 1c871de871b33e187eb4233988bbb837ff5f9e99

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary fix with meaningful regression coverage and no identified correctness or security defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the supplied context nevertheless reports exact-head two-process proof and a successful real-behavior-proof check.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the supplied context nevertheless reports exact-head two-process proof and a successful real-behavior-proof check.
Evidence reviewed 8 items Current missing-config behavior: Current main returns a valid absent-file snapshot before validation constructs metadata, so the explicit metadata wrapper has nothing to return.
Producer-side repair: The PR reuses the existing metadata loader only when a snapshot is valid and metadata was not already produced; invalid snapshots remain metadata-free.
Preflight consumer: Checkpoint preflight reads the explicit metadata result and uses its fingerprint to construct the migration identity.
Findings None None.
Security None None.

How this fits together

Config I/O produces snapshots used by gateway startup and doctor preflight. Preflight includes plugin metadata in its migration checkpoint identity before reporting the gateway ready.

flowchart LR
  A[Config path] --> B[Config snapshot]
  B --> C{Snapshot valid?}
  C -->|Yes| D[Plugin metadata]
  C -->|No| E[Invalid snapshot]
  D --> F[Preflight checkpoint identity]
  E --> F
  F --> G[Gateway readiness]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +9, Tests +182. Total +191 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 3 +9
Tests 2 190 8 +182
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 202 11 +191

Review metrics

Metric Value Why it matters
Production and test delta production +12/-3 (+9); tests +190/-8 (+182) The small production increase restores the metadata contract at its owner boundary, while the test growth covers lazy, invalid, and cross-process behavior.
User config/default surface 0 added, 0 changed, 0 removed The patch changes an internal explicit read contract without adding configuration, defaults, migration, or upgrade action.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-preflight.process.test.ts, unknown-data-model-change: src/commands/doctor-config-preflight.process.test.ts, vector/embedding metadata: src/config/io.snapshot.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the metadata restoration at the explicit snapshot-read boundary after routine exact-head merge checks; do not weaken checkpoint convergence or add a caller-side retry.

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

Yes. Current source shows the valid missing-file fast path bypasses metadata creation, while preflight consumes that metadata's fingerprint for checkpoint identity.

Is this the best way to solve the issue?

Yes. Completing the explicit metadata read at the snapshot producer is narrower and safer than weakening the preflight comparison or adding retries.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The PR repairs a real gateway-startup checkpoint convergence failure on the valid missing-config path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 author is a repository member, so the external-contributor proof gate does not apply; the supplied context nevertheless reports exact-head two-process proof and a successful real-behavior-proof check.

Label justifications:

  • P2: The PR repairs a real gateway-startup checkpoint convergence failure on the valid missing-config path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 author is a repository member, so the external-contributor proof gate does not apply; the supplied context nevertheless reports exact-head two-process proof and a successful real-behavior-proof check.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Blame ties the current missing-config snapshot path to Vincent Koc, who also authored the focused repair. (role: introduced current behavior and proposed repair; confidence: high; commits: aa07d55ec98f, 1c871de871b3; files: src/config/io.snapshot.ts, src/commands/doctor-config-preflight.process.test.ts)
  • steipete: Peter Steinberger authored the recent config I/O split and include-ownership refactors that define the surrounding owner boundary. (role: config I/O refactor contributor; confidence: medium; commits: 290836cafd2c, 66714b862267; files: src/config/io.snapshot.ts, src/config/io.context.ts)

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.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(config): preserve plugin metadata for missing config This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@vincentkoc
vincentkoc merged commit 9371ddd into main Aug 5, 2026
194 of 203 checks passed
@vincentkoc
vincentkoc deleted the fix/missing-config-plugin-metadata branch August 5, 2026 03:22
vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main:
  fix(channels): honor explicit preview streaming settings
  refactor(telegram): consolidate outbound contracts and targets (#119438)
  fix(qa): retry transport cleanup and always stop owned labs (#119442)
  fix(mcp): guard stdio stdout frame parsing against oversized-buffer crash (#119379)
  refactor(auto-reply): centralize delivery deduplication and routing (#119436)
  fix(qa): preserve scenario isolation in serial suites (#119439)
  perf(xai): lazy-load optional capability runtimes (#119374)
  refactor(browser): consolidate browser CLI and normalization helpers (#119432)
  fix(qa): require ready transport accounts (#119431)
  refactor(media): share image and video geometry normalization (#119416)
  fix(config): preserve plugin metadata for missing config (#119421)
  fix: retry delivery when outbound adapter is unavailable (#119371)
  fix(cli): retire invalid secret flags and prove doctor recovery (#118926)
  refactor(signal): share outbound and reaction transport (#119415)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
…9421)

Restore plugin metadata for valid missing-config snapshot reads while preserving scan-free plain reads and fail-closed invalid snapshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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