Skip to content

fix: prevent embedded agent test-order SQLite failures - #120459

Merged
steipete merged 1 commit into
mainfrom
steipete/zen-nobel-24cf57
Aug 8, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/zen-nobel-24cf57

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The force-clear suite could leave agent/shared SQLite handles and schema-validation state alive across non-isolated Vitest module resets. A later persistence test could then report noncanonical claw_package_refs, making the result depend on test execution order.

Why This Change Was Made

This uses the canonical OpenClawTestState fixture cleanup so the suite releases the SQLite state it owns, and adds a deterministic same-worker order regression covering the force-clear-to-persistence sequence.

User Impact

There is no user-visible runtime change. The affected embedded-agent tests are isolated from prior same-worker SQLite state and remain deterministic across non-isolated module resets.

Evidence

  • Affected suites: 13/13 passing.
  • Tooling regression: 4/4 passing, including the exact shared-worker ordered pair.
  • oxfmt clean.
  • git diff --check clean.
  • Codex-backed autoreview clean.
  • TruffleHog clean.

AI-assisted: Yes.

@steipete
steipete marked this pull request as ready for review August 8, 2026 04:21
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 8, 2026
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready verification for head 1c4339e46fcb2f798420f99890fa56facffb0815:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/embedded-agent-runner/runs.force-clear-terminal.test.ts src/agents/embedded-agent-runner/runs.persistence.test.ts --no-file-parallelism --reporter=verbose — 13/13 passing across the affected configured shards.
  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs test/non-isolated-runner.test.ts --no-file-parallelism --reporter=verbose — 4/4 passing, including the deterministic force-clear → persistence run in one non-isolated worker with exact order-log verification.
  • oxfmt and git diff --check clean.
  • Codex-backed autoreview and TruffleHog clean with no actionable findings.
  • Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/31239244342 — 53 passed, 14 skipped, 0 failed.
  • Review artifacts validated with READY FOR /prepare-pr, zero findings, and issueValidation.status=valid.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 120459 succeeded using hosted exact-head CI evidence.

No user-visible runtime behavior, schema, config, or default changes. Production LOC delta is zero; this is fixture lifecycle cleanup plus order-regression coverage.

@steipete
steipete merged commit b855934 into main Aug 8, 2026
172 of 179 checks passed
@steipete
steipete deleted the steipete/zen-nobel-24cf57 branch August 8, 2026 04:35
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant