Skip to content

test: publish runtime config at fixture owners and repair remaining #169714 fallout - #170433

Merged
steipete merged 5 commits into
mainfrom
fix/runtime-config-fixture-owners
Oct 13, 2026
Merged

steipete merged 5 commits into
mainfrom
fix/runtime-config-fixture-owners

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: four test files still fail or time out on main after #169714 (7e48efb) made getRuntimeConfig() a strict read of the published runtime-config snapshot, and fifteen fixture consumers carry hand-copied config publishes that belong to their shared fixture. Main push CI runs only changed-file selections and no infra bundles, so these reds surface only in nightly full CI or when selection happens to pick the file.

User Impact

No user-visible change. Test-only; production code is unchanged.

Why This Change Was Made

  • Publish at the owning fixture, the way Gateway startup does. setupWorkerEnvironmentServiceSuite() now publishes testState.config when it authors it and clears it after service shutdown; ComposedGatewayHarness publishes this.cfg in start() and clears it in close(). Fifteen consumers drop their now-duplicate publish/clear pairs (including copies that landed in refactor: move bundled session reads and authority into workers #169622 and earlier sweeps). Publishes of a different config object, the shutdown-replay post-mutation republish, and chat-abort's pre-harness snapshot restore are kept.
  • Incognito lifetime hang. The removed cold config load had a side effect: its config-health write opened the shared-state SQLite database. With the snapshot now published directly, nothing opened it, so every Incognito deletion-fence check fell back to the synchronous snapshot path (one child process per read, 0.7 to 4.3 s each) until cases hit the 120 s timeout. The fixture now opens shared state, as Gateway startup does.
  • Embedded lane-controller fixtures publish their empty authored config. Session placement admission (session-placement-admission.ts:238) and fallback transcript-target resolution (run-session-target.ts:57) read config; holdLane swallowed the rejection and kept waiting for an entry signal, which is why lane-controller.attempt-controls showed 18 timeouts instead of an error.
  • No shared cold-load helper (openclaw-test-state, command-queue support) was changed, matching 2dc1dad. Net diff: 21 files, +58/−117.

Evidence

Census

Source: nightly Full Release Validation child CI run 38292371460 at 6112e37e00, the first full run containing #169714. 61 test files logged Runtime config is not prepared, 10 more failed for other reasons, and shard agentic-gateway-server-isolated-7 stalled (no output for 300 s, exit 143), so 57 of its 64 files never reported. checks-ui failures contained no runtime-config errors and are out of scope.

Already repaired on main by parallel work (not duplicated here): 2dc1dad (44 files), be7696c, d7be702, 996b35c, f10cc08, f1aee76, d8253ad, 7e596d5, a919b21, #170236 (ACP native process fixture), #169622 (placement-abandon-lifecycle, native-worker.integration), #170292 (integrity-lease).

Local census (macOS, OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1 pnpm test <files> on main 8f4cf41/8de511a5d808) of every candidate those commits did not touch, plus all 57 unreported stalled-shard files:

Result Files
Fixed in this PR server.incognito-lifetime (6 timeouts), lane-controller (2 failed + 3 unhandled rejections), lane-controller.attempt-controls (18 timeouts), settled-turn-finalization.unavailable (1 failed)
Failed locally, then fixed on main concurrently placement-abandon-lifecycle (25), native-worker.integration (6), session-cost-usage-cache.creation-race (4: same shared-state side effect as incognito), openclaw-agent-db.integrity-lease (1; see below)
Pass on current main session-accessor, doctor-config-preflight, doctor-session-canonical-keys.scale, server-restart-update-run, session-observer-model, chat-reply-media.authority, server-methods.canonical-validation, server.chat-dashboard-title-rollover, run-entry.cleanup, media-generate-background-retention, agent-runner-result-accounting.fallback, state-migrations.transcript-directives, update-managed-service-handoff-lifecycle, openclaw-agent-worker-store, openclaw-state-db-cron-delivery-migration, ci-changed-node-test-plan.policy, and 56 of the 57 stalled-shard files
Not #169714 fallout or not reproduced pre-bootstrap.process "Doctor-repaired escaped reference": finite work at 54 to 56 s against its 60 s subprocess deadline (33 s in Doctor preflight); CI killed it at 60 s; not a hang and not attributable without bisect. client-native-actions: failed on 8de511a, passes after #170359. worker.fault-injection cancellation case: failed once, passed in two later runs. server.agents.config-readiness: times out locally, and was already failing in the pre-#169714 nightly at 5066848.

integrity-lease is #169983 fallout, not #169714, and not macOS-specific: the infra lane runs it in a forks pool (isMainThread), so the agent database delegates WAL maintenance, walMaintenance.close() always returns false, and a native close with an empty WAL seals clean. #170292 already repaired the fixture.

Proof

pnpm test <file> --maxWorkers=1. Host load averaged 40 to 70 from other agents, so wall times are inflated.

Files Before After
server.incognito-lifetime 4 to 6 timeouts 9/9, 122 s wall (Vitest 105 s)
lane-controller 2 failed, 3 unhandled 6/6, 62 s wall
lane-controller.attempt-controls 18 timeouts, 2198 s wall 18/18, 19 s wall
settled-turn-finalization.unavailable 1 failed 1/1, 24 s wall
All four together on final head 62cec18 34/34, 182 s wall
placement-abandon-lifecycle with only the suite fixture change 0/9 (25 errors) 9/9
All 58 setupWorkerEnvironmentServiceSuite() consumers 666/666, 911 s wall
ComposedGatewayHarness consumers + placement-abandon-lifecycle after the duplicate cutover (7 files) 53/53, 210 s wall

Formatting passed via the pre-commit hook and oxfmt --check. Scoped oxlint and a scoped type check ran in the worker lanes. Codex autoreview of the branch (P0 to P2) was scoped-clean.

Gaps: E2E/live suites and darwin-only native tests were not censused beyond the nightly CI run. Windows was not run locally. Full typecheck and lint are left to PR CI.

The prepared config snapshot skips the former synchronous config load and
its config-health initialization of the shared-state handle. Without that
handle, Incognito deletion-fence checks repeatedly spawn synchronous SQLite
snapshot children and exhaust the case timeout.

Open the fixture-owned shared-state database explicitly, as Gateway startup
does. Existing fixture teardown closes it. Preserve all nine cases,
assertions, and timeouts.

Validation: baseline 4 passed / 5 failed (four timeouts and one assertion);
full file after the fix 9 passed in 135.07s wall time. Scoped format, lint,
and independent Codex review passed. No production files changed.
…ion harness

7e48efb (#169714) made getRuntimeConfig a strict read of the
published snapshot. ComposedGatewayHarness handed its config to services
but never published it, so chat-event admission
(resolveRestartRecoveryLifecycleState) threw "Runtime config is not
prepared" inside the composed Gateway and native-worker.integration
failed 6 of 9 cases on downstream admission assertions.

Publish the harness config at start, as Gateway startup does, and clear it
after session-state cleanup. Fold the duplicated worker handshake builder
into one helper so the harness stays within its line budget.
…ture

Publish the suite's Gateway config when authored and clear it after service
shutdown so runtime-config readers have the same startup state as production.

Remove equivalent placement dispatch/reclaim/targeted recovery, provisioning
replay, and Portal policy publications and redundant per-file clears. Keep
shutdown replay's post-mutation publication and all different-config overrides.
Remove duplicate fixture publishes and clears from placement abandonment, native-worker, fault-injection, and transcript-failure tests, plus the chat-abort mid-test publish.

Keep chat-abort pre-harness snapshot/source restoration, distinct-config overrides, and shutdown replay post-mutation publication.
After #169714, getRuntimeConfig reads only an already published snapshot.
The direct lane-controller fixtures reached that read through session
placement admission without preparing config, rejecting queue tasks before
their entry signals and leaving attempt-control cases to time out. The
unavailable-finalization fixture also missed the snapshot during fallback
transcript target resolution, so it never claimed transcript ownership.

Publish each fixture's authored empty config in its file-level setup and
clear it during teardown. Preserve all cases, assertions, and timeouts;
leave production code and generic cold-load helpers unchanged.

Validation: each file reproduced alone before and passed alone afterward
with pnpm test <file> --maxWorkers=1 (6, 18, and 1 cases). Targeted typecheck,
lint, formatting, diff checks, and isolated P2 autoreview passed.
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 13, 2026
@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 Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes shared test fixtures publish and clear their runtime config and prepares missing config and shared-state prerequisites in affected tests.

Example: Run lane-controller.attempt-controls.test.ts after runtime config reads became prepared-only.

  • Before: Missing config rejects queued work before its entry signal, leaving cases waiting until timeout.
  • After: The fixture publishes its empty config before execution and clears it after cleanup.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused fixture repair with no identified defect; validation consists of reported harness runs and pending exact-head CI.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only PR reports focused before/after fixture runs, including the final-head affected tests and shared-fixture consumers; shipped runtime behavior is unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Maintainers encounter failing or stalled regression tests because fixture initialization no longer matches runtime prerequisites.
Reason: The focused repair restores useful coverage, centralizes fixture-owned state, and preserves the intended production contract.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs concrete fixture failures and consolidates runtime-config ownership without weakening assertions; no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 62cec18f8b9a2c6301f70188f4cf1d3870d25a66

Before merge

None.

Findings

None.

Agent review details

How this fits together

These fixtures supply config and isolated state to production agent-admission, worker-placement, transcript, and Incognito lifecycle code, then drain their owners during teardown.

flowchart TD
  A[Test fixture setup] --> B[Published runtime config]
  A --> C[Isolated shared state]
  B --> D[Production runtime consumers]
  C --> D
  D --> E[Existing behavioral assertions]
  E --> F[Owner drainage and snapshot cleanup]
Loading

Technical review

Best possible solution:

Use the owning fixtures to prepare and retire runtime state while preserving the existing behavioral coverage.

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

Source confirms unprepared config reads in the affected fixture paths, and the PR records matching before/after failures; this read-only review ran no target code.

Is this the best way to solve the issue?

Preparing state at existing fixture owners addresses the setup failure directly and removes duplicate publications without restoring synchronous cold loading.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4ca02f6c720e.

Provenance checked

  • Runtime config preparation in direct and shared fixtures keeps the original intent (7e48efb: Core runtime reads intentionally stopped cold-loading config; subsequent repair guidance required explicit fixture preparation while leaving generic cold-load helpers unchanged.)
  • Worker artifact handshake construction keeps the original intent (c1005a2: The native-worker fixture carries the supplied artifact's bundle hash, version, and protocol features; the consolidated helper preserves those values and array copying.)
  • Composed Gateway cleanup keeps the original intent (ce08211: Fixture database owners must drain before their root is removed; snapshot clearing remains after that cleanup.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduction diff changes only tests and test support; existing cases, assertions, and timeout values remain intact. (62cec18f8b9a)
  • Strict runtime-config contract: readRuntimeConfig throws when no snapshot exists; session placement admission and fallback transcript-target resolution consume that getter. (src/config/runtime-snapshot.ts:394, 62cec18f8b9a)
  • Shared fixture ownership: The service fixture publishes its authored config and clears it after service shutdown and turn-owner release; the composed Gateway publishes at start and clears after session-state cleanup. (src/gateway/worker-environments/service.test-support.ts:173, 62cec18f8b9a)
  • Prior repair intent respected: The recorded reason for commit 2dc1dad explicitly keeps generic cold-load helpers cold and prepares config at direct fixture owners; this PR follows that approach. (2dc1dad964b2)
  • Current-main comparison: Fetched main retains the pre-PR implementation in the central service fixture, composed Gateway fixture, Incognito lifetime fixture, and lane-controller fixture. (src/gateway/worker-environments/service.test-support.ts, 4ca02f6c720e)
  • Validation and discussion: The full PR body reports before/after failures and passing focused fixture runs on the final head; discussion contains only the review-status comment, and exact-head CI remains pending without a demonstrated diff-caused failure. (62cec18f8b9a)

PR surface

Tests -59. Total -59 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 21 58 117 -59
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 58 117 -59

Labels

Label changes:

  • add P2: Repairs concrete test-suite failures and timeouts that obscure runtime regression detection, with no shipped behavior change.
  • 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.

Label justifications:

  • P2: Repairs concrete test-suite failures and timeouts that obscure runtime regression detection, with no shipped behavior change.
  • 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.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 12, 2026, 8:20 PM ET / October 13, 2026, 00:20 UTC.

@steipete
steipete merged commit 959426b into main Oct 13, 2026
122 of 123 checks passed
@steipete
steipete deleted the fix/runtime-config-fixture-owners branch October 13, 2026 01:29
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…penclaw#169714 fallout (openclaw#170433)

* test(gateway): retain shared state in incognito lifetime fixture

The prepared config snapshot skips the former synchronous config load and
its config-health initialization of the shared-state handle. Without that
handle, Incognito deletion-fence checks repeatedly spawn synchronous SQLite
snapshot children and exhaust the case timeout.

Open the fixture-owned shared-state database explicitly, as Gateway startup
does. Existing fixture teardown closes it. Preserve all nine cases,
assertions, and timeouts.

Validation: baseline 4 passed / 5 failed (four timeouts and one assertion);
full file after the fix 9 passed in 135.07s wall time. Scoped format, lint,
and independent Codex review passed. No production files changed.

* test(worker): publish the composed Gateway config in the fault-injection harness

5dbf215 (openclaw#169714) made getRuntimeConfig a strict read of the
published snapshot. ComposedGatewayHarness handed its config to services
but never published it, so chat-event admission
(resolveRestartRecoveryLifecycleState) threw "Runtime config is not
prepared" inside the composed Gateway and native-worker.integration
failed 6 of 9 cases on downstream admission assertions.

Publish the harness config at start, as Gateway startup does, and clear it
after session-state cleanup. Fold the duplicated worker handshake builder
into one helper so the harness stays within its line budget.

* test(gateway): publish the worker-environment suite config at its fixture

Publish the suite's Gateway config when authored and clear it after service
shutdown so runtime-config readers have the same startup state as production.

Remove equivalent placement dispatch/reclaim/targeted recovery, provisioning
replay, and Portal policy publications and redundant per-file clears. Keep
shutdown replay's post-mutation publication and all different-config overrides.

* test: drop per-file config publishes owned by their fixtures

Remove duplicate fixture publishes and clears from placement abandonment, native-worker, fault-injection, and transcript-failure tests, plus the chat-abort mid-test publish.

Keep chat-abort pre-harness snapshot/source restoration, distinct-config overrides, and shutdown replay post-mutation publication.

* test(agents): prepare embedded runtime fixture configs

After openclaw#169714, getRuntimeConfig reads only an already published snapshot.
The direct lane-controller fixtures reached that read through session
placement admission without preparing config, rejecting queue tasks before
their entry signals and leaving attempt-control cases to time out. The
unavailable-finalization fixture also missed the snapshot during fallback
transcript target resolution, so it never claimed transcript ownership.

Publish each fixture's authored empty config in its file-level setup and
clear it during teardown. Preserve all cases, assertions, and timeouts;
leave production code and generic cold-load helpers unchanged.

Validation: each file reproduced alone before and passed alone afterward
with pnpm test <file> --maxWorkers=1 (6, 18, and 1 cases). Targeted typecheck,
lint, formatting, diff checks, and isolated P2 autoreview passed.
steipete added a commit that referenced this pull request Oct 13, 2026
…re (#170630)

#170447 and #170433 both repaired the same #169714 fallout in three
embedded-agent fixtures, and both landed. Keep #170447's run-level owner,
which follows each run's authored config, and drop #170433's redundant
beforeEach publishes.

The lane-controller fixtures keep their controller-factory publish and
single afterEach clear. The settled-turn fixture keeps config: {} in its
run params. Without both that and the publish it fails with
assistantTranscriptOwned undefined; with config alone it passes and no
snapshot is published, so its clear and import are dropped as dead.

Assertions, timeouts and cases are unchanged; all three files now match
#170447's post-images.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…re (openclaw#170630)

openclaw#170447 and openclaw#170433 both repaired the same openclaw#169714 fallout in three
embedded-agent fixtures, and both landed. Keep openclaw#170447's run-level owner,
which follows each run's authored config, and drop openclaw#170433's redundant
beforeEach publishes.

The lane-controller fixtures keep their controller-factory publish and
single afterEach clear. The settled-turn fixture keeps config: {} in its
run params. Without both that and the publish it fails with
assistantTranscriptOwned undefined; with config alone it passes and no
snapshot is published, so its clear and import are dropped as dead.

Assertions, timeouts and cases are unchanged; all three files now match
openclaw#170447's post-images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant