Skip to content

fix(test): ACP native execution tests fail since config reads need a published snapshot - #170236

Merged
steipete merged 1 commit into
mainfrom
fix/acp-native-process-runtime-config
Oct 12, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/acp-native-process-runtime-config

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: src/agents/harness/acp-native-execution.process.test.ts fails 12 of 17 tests on every run with Runtime config is not prepared. Await captureRuntimeConfigAsyncReader()() first. It looked intermittent in hosted CI (seen on #170048, run 38289582158, shard core-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 call setRuntimeConfigSnapshot(config) right before registerNative(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.

registerNative stands 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. withOpenClawTestState resets config runtime state on entry and exit, so nothing leaks between tests. Production code is unchanged: real recorder targets carry config, 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:test passes. oxfmt --check and oxlint (core tsconfig) are clean on the three touched files.
  • Full-run shard bundle 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, and src/state/openclaw-agent-execution-incognito.completion-lineage.test.ts. The fifth, src/state/openclaw-agent-db.integrity-lease.test.ts, has a separate clean_close assertion 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 touch acp-native-execution.process.test.ts, which may need the same treatment once it lands.

#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.
@clawsweeper

clawsweeper Bot commented Oct 12, 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 gateway Gateway runtime agents Agent runtime and tooling size: XS labels Oct 12, 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 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The author reports 12 of 17 cases fail because transcript persistence reads an unpublished runtime config.
  • After: The shared fixture publishes the supplied config before execution; the author reports all 17 cases pass.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported fixture repair with reported baseline and sibling validation; reviewer verification was limited to read-only inspection.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only repair changes fixture initialization; reported validation exercises the existing ACP subprocess, approval, and consent suites.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: PRs selecting the ACP native execution suite fail on fixture initialization before the intended behavior can be validated.
Reason: This restores existing coverage through its shared setup owner without changing production contracts, adding options, or weakening tests.

Regression provenance

Possible 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
Reviewed head: 0585594b5e27d09d9a783963c89d8152b0a0f280

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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
Loading

Technical review

Best 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

  • Sibling snapshot publication and shared native-process setup keeps the original intent (7e48efb: Prepared runtime config replaces implicit synchronous loading; fixtures must publish their existing config before dependent operations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit cdeb1e3 adds src/agents/harness/acp-native-process.test-support.ts:64 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cdeb1e37adc6; files: src/agents/harness/acp-native-process.test-support.ts)

PR surface

Tests -4. Total -4 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 3 7 -4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 3 7 -4

Labels

Label changes:

  • add P2: A deterministic fixture failure blocks selected CI coverage and unrelated PR validation, with no demonstrated production impact.
  • 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: A deterministic fixture failure blocks selected CI coverage and unrelated PR validation, with no demonstrated production impact.
  • 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, 5:07 PM ET / 21:07 UTC.

steipete added a commit that referenced this pull request Oct 12, 2026
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.
@steipete
steipete merged commit 2244352 into main Oct 12, 2026
119 of 120 checks passed
@steipete
steipete deleted the fix/acp-native-process-runtime-config branch October 12, 2026 22:01
@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
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…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.
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: 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