Skip to content

fix(ci): isolate config recovery proof - #120847

Merged
vincentkoc merged 1 commit into
mainfrom
fix/config-recovery-test-isolation
Aug 9, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/config-recovery-test-isolation

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the config recovery proof could time out in the compact Node CI shard while cold-loading bundled channel doctor contracts that the tested recovery behavior did not require. This currently blocks otherwise unrelated pull requests, including #119520.

Why This Change Was Made

The recovery integration helper now owns an isolated per-case HOME, config path, state directory, and plugin-discovery environment while preserving caller-provided environment object identity for rollback assertions. Generic recovery fixtures use core-owned gateway data for size-drop and restore scenarios; the separate channel- and plugin-specific recovery cases remain unchanged.

This keeps the real createConfigIO recovery, migration, validation, recursive reread, SQLite health state, audit, and clobber-snapshot path under test without charging an unrelated bundled Telegram doctor-contract module graph to the first generic case.

User Impact

No product behavior changes. CI no longer flakes at the 120-second per-test limit because generic config recovery proof is independent of ambient host/workspace plugin state.

Evidence

Current-main reproduction before the fix:

src/config/io.observe-recovery.test.ts:455
read snapshots auto-restore tiny valid clobbers before recording them observed
Test timed out in 120000ms
1 failed | 50 passed
case duration: 161028ms

The same untouched case failed twice in exact-head CI jobs 93184843124 and 93186417445 after 3,132 sibling tests passed. Sampling showed synchronous dynamic module evaluation rather than SQLite lock waiting.

After the isolation repair:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/config/io.observe-recovery.test.ts
Test Files  1 passed (1)
Tests       51 passed (51)
Duration    9.26s
[test] passed 1 Vitest shard in 12.66s

The formerly failing exact case completes in 213ms. git diff --check, targeted formatting, and fresh autoreview passed with no accepted/actionable findings.

@steipete steipete self-assigned this Aug 9, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 9, 2026
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

This exact head repairs a current-main CI blocker reproduced twice on #119520 and once from a fresh current-main clone. The generic recovery integration fixtures now isolate HOME/config/state/plugin discovery and use core-owned gateway data; channel- and plugin-specific recovery cases remain unchanged. Full focused proof passes 51/51 in 9.26 seconds, the former timeout case completes in 213ms, and fresh autoreview is clean.

@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@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 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 12:41 AM ET / 04:41 UTC.

ClawSweeper review

What this changes

The PR gives config-recovery tests an isolated home, config, state, and plugin-discovery environment while using core-only data for generic recovery cases.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: this is a focused, correct test-fixture isolation repair for a current-main CI timeout. It is maintainer-labeled and should follow normal maintainer merge handling rather than automated cleanup.

Priority: P2
Reviewed head: 95b36b1d52f7ca7346e4eab73a17acfca89e53ba

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrowly scoped test-boundary repair with convincing focused evidence and no actionable correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer PR is exempt from the external-contributor proof gate; its body nevertheless includes before/after focused terminal evidence and successful exact-head CI.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer PR is exempt from the external-contributor proof gate; its body nevertheless includes before/after focused terminal evidence and successful exact-head CI.
Evidence reviewed 5 items PR fixture isolation: The PR injects a case-specific environment into the existing configuration-I/O helper while preserving a supplied environment object's identity for rollback assertions.
Runtime ownership: Recovery validation passes the injected environment into plugin metadata, so the fixture isolation reaches the actual plugin-aware validation path rather than mocking recovery behavior.
Bundled-plugin contract: Bundled discovery explicitly recognizes OPENCLAW_DISABLE_BUNDLED_PLUGINS=1, making the fixture's empty bundled-plugin surface an intentional supported test boundary.
Findings None None.
Security None None.

How this fits together

Config recovery reads backup and current configuration data, validates it through plugin-aware config metadata, and restores suspicious reads. This test suite drives that real recovery path and reports CI reliability for the configuration boundary.

flowchart LR
  A[Test fixture] --> B[Case-specific environment]
  B --> C[Configuration I/O]
  C --> D[Plugin-aware validation]
  D --> E[Recovery and audit state]
  E --> F[Focused CI proof]
Loading

Before merge

  • Complete next step (P2) - No mechanical repair is needed; the protected maintainer PR should proceed through ordinary merge review.
Agent review details

Security

None.

PR surface

Tests -2. Total -2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 31 33 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 31 33 -2

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +31/-33 The patch changes only the recovery proof harness, so it avoids changing user configuration or runtime behavior.

Technical review

Best possible solution:

Keep the hermetic fixture boundary, retain the direct channel-bearing recovery cases, and merge after normal exact-head maintainer checks.

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

Yes: the PR records the exact current-main recovery test timing out at 120 seconds, and the inspected fixture path explains its ambient bundled-plugin discovery dependency.

Is this the best way to solve the issue?

Yes: isolating the test-owned environment fixes the nondeterministic fixture boundary while preserving real configuration recovery and separate channel-specific coverage.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This fixes a bounded CI reliability regression that can delay otherwise unrelated PR validation, without changing shipped behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer PR is exempt from the external-contributor proof gate; its body nevertheless includes before/after focused terminal evidence and successful exact-head CI.

Label justifications:

  • P2: This fixes a bounded CI reliability regression that can delay otherwise unrelated PR validation, without changing shipped behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer PR is exempt from the external-contributor proof gate; its body nevertheless includes before/after focused terminal evidence and successful exact-head CI.

Evidence

What I checked:

  • PR fixture isolation: The PR injects a case-specific environment into the existing configuration-I/O helper while preserving a supplied environment object's identity for rollback assertions. (src/config/io.observe-recovery.test.ts:191, 95b36b1d52f7)
  • Runtime ownership: Recovery validation passes the injected environment into plugin metadata, so the fixture isolation reaches the actual plugin-aware validation path rather than mocking recovery behavior. (src/config/io.context.ts:121, 7f3cc6995bc6)
  • Bundled-plugin contract: Bundled discovery explicitly recognizes OPENCLAW_DISABLE_BUNDLED_PLUGINS=1, making the fixture's empty bundled-plugin surface an intentional supported test boundary. (src/plugins/bundled-dir.ts:23, 7f3cc6995bc6)
  • History and current-main gap: Blame attributes the pre-fix helper and generic Telegram fixture on current main to the surrounding recovery-suite change; the PR head is not contained in current main. (src/config/io.observe-recovery.test.ts:459, a26959b9270c)
  • After-fix proof and CI: The PR body records the formerly timing-out focused case completing in 213ms and the 51-test file passing in 9.26 seconds; exact-head config-boundary and CI-gate checks are successful in the supplied context. (src/config/io.observe-recovery.test.ts:455, 95b36b1d52f7)

Likely related people:

  • steipete: Current-main blame attributes the affected fixture path to this author, who also authored the focused repair. (role: original recovery-suite author and recent area contributor; confidence: high; commits: a26959b9270c, 95b36b1d52f7; files: src/config/io.observe-recovery.test.ts, src/config/io.context.ts)
  • vincentkoc: History shows earlier work on the recovery behavior adjacent to this test boundary. (role: historical recovery-area contributor; confidence: medium; commits: 5d174a5bec; files: src/config/io.observe-recovery.test.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.

@vincentkoc vincentkoc self-assigned this Aug 9, 2026
@vincentkoc
vincentkoc merged commit cb9bf8c into main Aug 9, 2026
104 checks passed
@vincentkoc
vincentkoc deleted the fix/config-recovery-test-isolation branch August 9, 2026 04:51
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR 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.

2 participants