Skip to content

fix(test): live Gateway validation loses shared state - #150873

Merged
RomneyDa merged 2 commits into
mainfrom
fix/live-vitest-host-process-20260917
Sep 17, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
fix/live-vitest-host-process-20260917

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: live Gateway validation loses shared-state SQLite and automatic USER.md context when Vitest hosts the Gateway in an application worker thread.

User Impact

User impact: release live suites exercise the same main-process shared-state admission boundary as a real Gateway; no runtime behavior changes.

Why This Change Was Made

vitest.live.config.ts inherited the repository thread pool. The live suites start a real Gateway in that worker, so shared-state SQLite correctly rejected it with Shared-state admission requires the host broker. That rejection also made Memory Core provenance classification fail closed and excluded USER.md from the CLI-backend prompt report. Process forks preserve the existing one-worker serialization while making the test host a main process.

Evidence

  • Failed tuple 35199323060: ACP bind logged the shared-state admission error; CLI backend logged the same error and then missed USER.md.
  • pnpm exec vitest run --config test/vitest/vitest.tooling.config.ts test/vitest-projects-config.test.ts — 228 passed.
  • pnpm exec oxfmt --check test/vitest/vitest.live.config.ts test/vitest-projects-config.test.ts — passed.
  • pnpm exec oxlint test/vitest/vitest.live.config.ts test/vitest-projects-config.test.ts — passed.
  • Live provider Docker replay is deferred to exact-head CI because it requires release credentials.

@clawsweeper

clawsweeper Bot commented Sep 17, 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 size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@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 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 9:06 AM ET / 13:06 UTC (Revision 2).

ClawSweeper review

What this changes

Runs live Gateway tests in one process fork and updates configuration checks so shared-state storage can initialize through its existing host broker.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: current main still runs live Gateway suites in worker threads despite shared-state admission requiring a host process. No actionable correctness or security defect was found in the introduced patch.

Priority: P2
Reviewed head: 643006c7675cc25eb49aa51a7e19723e27641347

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, source-supported repair with aligned contract tests and no blocking findings; live replay is not claimed.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its configuration checks support pool selection, but after-fix Gateway shared-state recovery remains unobserved because the body defers live Docker replay.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its configuration checks support pool selection, but after-fix Gateway shared-state recovery remains unobserved because the body defers live Docker replay.
Evidence reviewed 9 items Verified introduced change: The pinned merge-base-to-head diff changes only the live pool selection and two configuration tests; it preserves the single-worker limit, setup files, test selection, and non-isolated runner.
Current admission boundary: openSharedStateSqliteWorkerStore rejects when isMainThread is false before opening the broker. This independently supports the reported worker-thread failure without changing runtime admission policy.
Still needed on main: Fetched main has no live-pool override and inherits pool: threads from the shared configuration. Existing Gateway database-worker lanes already use forks with the same non-isolated runner.
Findings None None.
Security None None.

How this fits together

OpenClaw’s live-test runner starts Gateway instances and exercises provider workflows. Its worker configuration determines whether those instances can access host-owned shared-state SQLite services.

flowchart LR
  A[Live test command] --> B[Live test configuration]
  B --> C[Single process fork]
  C --> D[Gateway instance]
  D --> E[Host broker admission]
  E --> F[Shared-state SQLite]
  F --> G[Live workflow assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +11. Total +11 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 13 2 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 13 2 +11

Review metrics

None.

Technical review

Best possible solution:

Keep live Gateway hosts in serialized process forks while preserving the production broker’s worker-thread rejection and existing test cleanup.

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

Yes, from source: live suites start a Gateway inside Vitest’s inherited thread pool, where shared-state admission explicitly rejects non-main threads. This review did not execute the credentialed failing scenario.

Is this the best way to solve the issue?

Yes. Selecting the existing process-fork pool repairs the test host’s execution context and follows other Gateway database test lanes without weakening storage admission.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs a concrete live-validation infrastructure failure without changing shipped runtime behavior.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate. Its configuration checks support pool selection, but after-fix Gateway shared-state recovery remains unobserved because the body defers live Docker replay.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head diff changes only the live pool selection and two configuration tests; it preserves the single-worker limit, setup files, test selection, and non-isolated runner. (test/vitest/vitest.live.config.ts:27, 643006c7675c)
  • Current admission boundary: openSharedStateSqliteWorkerStore rejects when isMainThread is false before opening the broker. This independently supports the reported worker-thread failure without changing runtime admission policy. (src/infra/sqlite-worker-store.ts:156, 324208c38245)
  • Still needed on main: Fetched main has no live-pool override and inherits pool: threads from the shared configuration. Existing Gateway database-worker lanes already use forks with the same non-isolated runner. (test/vitest/vitest.live.config.ts:20, 324208c38245)
  • Latest release comparison: The supplied latest release also lacks the live-pool override; this inspection does not establish that the older release had the same admission failure. (test/vitest/vitest.live.config.ts:20, 3a9d69db306c)
  • Dependency contract verified: The changed configuration directly uses Vitest’s pool contract, and OpenClaw pins Vitest 5.0.0. At that tag’s verified commit, ForksPoolWorker starts node:child_process.fork; the separately inspected ThreadsPoolWorker starts node:worker_threads.Worker. (packages/vitest/src/node/pools/workers/forksWorker.ts:64, f441c6fab25e)
  • Review continuity: The earlier completed review retained no findings or published rank-up moves. Comparing its head with this head confirms the follow-up changes the existing live-config assertion from threads to forks while retaining isolation and runner assertions. (src/infra/vitest-live-config.test.ts:15, 643006c7675c)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (1 earlier review cycle)
  • reviewed 2026-09-17T12:21:59.018Z sha e62cc24 :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa merged commit 493ad2f into main Sep 17, 2026
166 checks passed
@RomneyDa
RomneyDa deleted the fix/live-vitest-host-process-20260917 branch September 17, 2026 13:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
* fix(test): host live gateways in process forks

* test: align live config contract with process pool
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: XS 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