Repository navigation
fix(test): ACP native execution tests fail since config reads need a published snapshot - #170236
Conversation
#169714 made getRuntimeConfig() a strict read of the Gateway-published runtime snapshot. acp-native-execution.process.test.ts never published one, so transcript persistence threw "Runtime config is not prepared" and 12 of 17 tests failed whenever changed-file selection ran the file. registerNative now publishes the snapshot the way the Gateway does, and the duplicated inline setRuntimeConfigSnapshot calls in its other consumers are removed. withOpenClawTestState resets runtime config on entry and exit.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR publishes runtime config in the shared ACP native-process fixture and removes duplicate publication from two consumers. Example: Run acp-native-execution.process.test.ts with its existing native-agent fixtures.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a concrete test-fixture omission that remains on main, preserves existing assertions, and changes no production behavior. No actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe test fixture connects isolated OpenClaw state and config to the ACPX harness and synthetic ACP subprocesses, allowing existing tests to inspect execution effects, transcripts, approvals, and consent. flowchart TD
A[Isolated test state] --> B[Shared native fixture]
B --> C[Runtime config snapshot]
B --> D[ACPX harness]
D --> E[Synthetic ACP subprocess]
D --> F[Transcript persistence]
C --> F
Technical reviewBest possible solution: Publish the existing config once in the shared fixture while retaining all execution, approval, and consent assertions. Do we have a high-confidence way to reproduce the issue? Source inspection confirms the missing-publication path, and the PR records a matching failing baseline; tests were not run during this read-only review. Is this the best way to solve the issue? The shared fixture is the appropriate setup owner: all three consumers use it, the two existing publication paths are removed, and isolated-state cleanup already resets the snapshot. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d7be70250a4b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -4. Total -4 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 5:07 PM ET / 21:07 UTC. |
Adapt direct runtime fixtures to 7e48efb (#169714), which intentionally made getRuntimeConfig consume an already prepared snapshot. Publish each fixture's authored config after selecting isolated state, or carry it in its existing transcript target. Production preparation is unchanged. Keep generic cold-load helpers cold and preserve assertions, authority inputs, and timeouts. The shared-store seed uses its logical ops owner; the physical database remains main, matching #138380's ownership contract. Exclude the execution-eligibility and verbose-worker fixtures already fixed by 996b35c and d7be702; leave active #170236's ACP fixtures alone. Local proof: 44 changed unit/integration files, 533 cases passed across seven owning configs, plus unchanged cold-config and transcript controls. Targeted types, lint, boundary guards, format, check-changed and P2 review passed. No shared test helper or production source changes. Remote-managed-skills E2E was not executed: standalone declaration builds blocked it. Its fixture receives the same authored-config preparation. Testbox stop reported success; subsequent GitHub settlement timed out. The stopped lease is abandoned per coordinator instruction. #169757 carries overlapping fixture hunks and will rebase.
|
Merged via squash.
|
Adapt direct runtime fixtures to 5dbf215 (openclaw#169714), which intentionally made getRuntimeConfig consume an already prepared snapshot. Publish each fixture's authored config after selecting isolated state, or carry it in its existing transcript target. Production preparation is unchanged. Keep generic cold-load helpers cold and preserve assertions, authority inputs, and timeouts. The shared-store seed uses its logical ops owner; the physical database remains main, matching openclaw#138380's ownership contract. Exclude the execution-eligibility and verbose-worker fixtures already fixed by 565065f and 78e6e96; leave active openclaw#170236's ACP fixtures alone. Local proof: 44 changed unit/integration files, 533 cases passed across seven owning configs, plus unchanged cold-config and transcript controls. Targeted types, lint, boundary guards, format, check-changed and P2 review passed. No shared test helper or production source changes. Remote-managed-skills E2E was not executed: standalone declaration builds blocked it. Its fixture receives the same authored-config preparation. Testbox stop reported success; subsequent GitHub settlement timed out. The stopped lease is abandoned per coordinator instruction. openclaw#169757 carries overlapping fixture hunks and will rebase.
…penclaw#170236) openclaw#169714 made getRuntimeConfig() a strict read of the Gateway-published runtime snapshot. acp-native-execution.process.test.ts never published one, so transcript persistence threw "Runtime config is not prepared" and 12 of 17 tests failed whenever changed-file selection ran the file. registerNative now publishes the snapshot the way the Gateway does, and the duplicated inline setRuntimeConfigSnapshot calls in its other consumers are removed. withOpenClawTestState resets runtime config on entry and exit.
What Problem This Solves
Fixes:
src/agents/harness/acp-native-execution.process.test.tsfails 12 of 17 tests on every run withRuntime config is not prepared. Await captureRuntimeConfigAsyncReader()() first.It looked intermittent in hosted CI (seen on #170048, run 38289582158, shardcore-runtime-infra-storage-state-hosted-9) only because the file runs when changed-file selection picks it up.User Impact
No user-visible change. The ACP native execution process tests pass again, so PRs that select this file are no longer red for an unrelated reason.
Why This Change Was Made
#169714 turned
getRuntimeConfig()into a strict read of the Gateway-published runtime snapshot. It updated the other consumers of the shared native-process fixture (acp-native-approval-effect.process.test.ts,chat.native-runtime-consent.test.ts) to callsetRuntimeConfigSnapshot(config)right beforeregisterNative(state, config, ...), but missed this file. The child-process errors (Child failed before writing .../session-new-entered,.../prompt-reply-entered) and the generic-failure copy assertions are downstream of the same throw from in-process transcript persistence.registerNativestands up the ACPX plugin the way the Gateway would, so it now publishes the runtime snapshot itself, and the five duplicated inline calls in the other two consumers are removed.withOpenClawTestStateresets config runtime state on entry and exit, so nothing leaks between tests. Production code is unchanged: real recorder targets carryconfig, and the Gateway always publishes its snapshot at startup.Evidence
Reproduced locally on
origin/main(24dec4d) before the fix: same 12 failed / 5 passed split as CI, with the same stacks.After the fix:
pnpm test src/agents/harness/acp-native-execution.process.test.ts --maxWorkers=1: 17/17 passed (Vitest 65.6 s, 141.6 s wall including compile; about 31 s in the hosted shard).pnpm test src/agents/harness/acp-native-approval-effect.process.test.ts src/gateway/server-methods/chat.native-runtime-consent.test.ts --maxWorkers=1: 4/4 (infra, 48.0 s) and 10/10 (gateway, 82.4 s).pnpm tsgo:core:testpasses.oxfmt --checkandoxlint(core tsconfig) are clean on the three touched files.bundle-infra-small-private-qa-17(64 files, including both ACP native process files): 59/64 files pass. The 5 failing files don't import the changed fixture or either edited test, so these failures already exist on main. 4 hit the same missing-snapshot cause from refactor(runtime): prepare config, auth, and session facts asynchronously #169714:src/sessions/user-turn-transcript.test.ts,src/agents/tools/message-tool.internal-source-reply.integration.test.ts,src/sessions/session-state-events.ownership.test.ts, andsrc/state/openclaw-agent-execution-incognito.completion-lineage.test.ts. The fifth,src/state/openclaw-agent-db.integrity-lease.test.ts, has a separateclean_closeassertion failure. Main push CI doesn't run these infra bundles, so the follow-up sweep is tracked separately.No new tests: this repairs existing coverage.
Note for #169763: that PR edits the same
setRuntimeConfigSnapshot(config)context lines in the two sibling tests, so expect a trivial rebase conflict. It also wraps sibling attempts in plugin-metadata scopes but does not touchacp-native-execution.process.test.ts, which may need the same treatment once it lands.