Skip to content

fix(ci): restore approval resource fixture coverage - #170772

Merged
obviyus merged 1 commit into
mainfrom
fix/ci-approval-memory-reload
Oct 13, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/ci-approval-memory-reload

Conversation

@obviyus

@obviyus obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes three approval-intent resource tests failing before inference because their credential fixture runs in an unhosted worker thread.

User Impact

No production behavior change, migration, or operator action. Approval overlap, cancellation-drain, and credential-rotation coverage runs again with its existing assertions.

Why This Change Was Made

Route the resource test through the existing database-worker project, alongside other native credential fixtures that require host-owned offline writer custody. The test, shared fixture, production custody checks, timeouts, and concurrency assertions are unchanged.

The stale test routing was exposed by 50414196f1912053abee1ddcab595fca3c7e7889 (#170632), which introduced src/agents/auth-profiles/credential-write-custody.ts:71-72. The direct fixture write at src/test-utils/openclaw-test-state.ts:355, called from src/system-agent/approval-intent.resources.test.ts:120, cannot acquire that custody in an ordinary Vitest thread. This adds the missing routing entry rather than weakening the credential boundary.

Memory background reload is intentionally not changed: #170612 already contains its maintainer-owned fixture repair.

Evidence

On main 0348a2526c561d8ccce61bfd23931024a6b8f13e:

  • node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/plugins/memory-background-reload.test.ts stopped in the first shard: all 3 approval resource cases failed with Auth profile credential writes require an admitted worker (23.86 s wrapper).

After the routing repair and rebasing onto main c1f504ab456:

  • node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/system-agent/approval-intent.test.ts src/system-agent/verified-inference.test.ts test/vitest-scoped-config.test.ts test/vitest-cli-ownership.test.ts: 68 passed across 5 files (68.03 s wrapper). This includes all 3 resource cases, 31 approval/verified-inference sibling cases, and 34 routing cases.
  • pnpm exec oxfmt --check test/vitest/vitest.database-worker-core-paths.mjs: passed.
  • node scripts/run-oxlint.mjs test/vitest/vitest.database-worker-core-paths.mjs: passed.

No assertions, retries, or timeouts changed. No production code changed.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@obviyus obviyus changed the title test(system-agent): restore approval resource fixture coverage fix(ci): restore approval resource fixture coverage Oct 13, 2026
@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 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

Routes the approval resource test suite through the existing fork-based database-worker project.

Example: Run the three approval resource cases: overlap, cancel-drain, and route-drift.

  • Before: Credential fixture setup fails with “Auth profile credential writes require an admitted worker.”
  • After: The fixture can acquire offline custody in a forked process, allowing the existing assertions to run.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct routing repair supported by source inspection, reported targeted execution, and successful exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) This collaborator-authored test-only PR is outside the ordinary runtime-proof gate; its reported runner execution covers the changed routing and all three existing resource cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Approval resource regression coverage fails during credential setup before exercising inference.
Reason: The collaborator-authored change restores existing coverage through its established execution owner with no production behavior change.

Regression provenance

Regression provenance — verified: source commit 50414196f191 by Peter Steinberger; canonical PR #170632 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a concrete test-routing failure still present on main, preserves credential custody checks, and introduces no actionable defect.

Priority: P2
Reviewed head: f26670bf93bed776cd75f92a64f5072a637c8bf1

Before merge

None.

Findings

None.

Agent review details

How this fits together

Vitest routing assigns test files to execution projects; the database-worker registry selects forked processes for fixtures that require host-owned SQLite custody.

flowchart LR
  A[Test runner] --> B[Test routing registry]
  B --> C[Infra fork project]
  C --> D[Approval resource fixture]
  D --> E[Credential custody owner]
  E --> F[Existing resource assertions]
Loading

Technical review

Best possible solution:

Land the routing entry while retaining the existing fixture, assertions, and production custody enforcement.

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

The fixture's synchronous credential write and the unadmitted-thread rejection establish the failure path; the author reports matching before-and-after runs, and this read-only review executed no tests.

Is this the best way to solve the issue?

Using the existing fork-project registry fixes execution ownership without weakening credential enforcement or changing test expectations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3f1a962d4488.

Provenance checked

  • Credential fixture routing keeps the original intent (5041419: Synchronous credential mutations require owner-held custody; related native credential fixtures were assigned to forked database-worker hosts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5041419 adds test/vitest/vitest.database-worker-core-paths.mjs:148 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 50414196f191; files: test/vitest/vitest.database-worker-core-paths.mjs)

PR surface

Tests +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 0 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 0 +1

Labels

Label changes:

  • add P2: Repairs a bounded CI fixture failure that prevents existing approval resource coverage from running.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 a bounded CI fixture failure that prevents existing approval resource coverage from running.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 13, 2026, 4:07 AM ET / 08:07 UTC.

@obviyus
obviyus merged commit 72e0482 into main Oct 13, 2026
94 checks passed
@obviyus
obviyus deleted the fix/ci-approval-memory-reload branch October 13, 2026 08:10
@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 72e0482. approval-intent.resources.test.ts seeds auth-profile credentials, which since #170632 require an admitted database worker; the file now runs in the existing host-owned database-worker Vitest project. Proof: 3/3 failed on main 0348a25, 3/3 pass after; 68 related tests pass; exact-head CI green.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
## What Problem This Solves

Fixes three approval-intent resource tests failing before inference because their credential fixture runs in an unhosted worker thread.

## User Impact

No production behavior change, migration, or operator action. Approval overlap, cancellation-drain, and credential-rotation coverage runs again with its existing assertions.

## Why This Change Was Made

Route the resource test through the existing database-worker project, alongside other native credential fixtures that require host-owned offline writer custody. The test, shared fixture, production custody checks, timeouts, and concurrency assertions are unchanged.

The stale test routing was exposed by `c3b5d0c7bc15f2f497247c3127cfa844d34c6e74` (openclaw#170632), which introduced `src/agents/auth-profiles/credential-write-custody.ts:71-72`. The direct fixture write at `src/test-utils/openclaw-test-state.ts:355`, called from `src/system-agent/approval-intent.resources.test.ts:120`, cannot acquire that custody in an ordinary Vitest thread. This adds the missing routing entry rather than weakening the credential boundary.

Memory background reload is intentionally not changed: openclaw#170612 already contains its maintainer-owned fixture repair.

## Evidence

On main `116f0502239e7f1cd4a85f57331f986f616e8939`:

- `node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/plugins/memory-background-reload.test.ts` stopped in the first shard: all 3 approval resource cases failed with `Auth profile credential writes require an admitted worker` (23.86 s wrapper).

After the routing repair and rebasing onto main `7f29537f79a`:

- `node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/system-agent/approval-intent.test.ts src/system-agent/verified-inference.test.ts test/vitest-scoped-config.test.ts test/vitest-cli-ownership.test.ts`: **68 passed across 5 files** (68.03 s wrapper). This includes all 3 resource cases, 31 approval/verified-inference sibling cases, and 34 routing cases.
- `pnpm exec oxfmt --check test/vitest/vitest.database-worker-core-paths.mjs`: passed.
- `node scripts/run-oxlint.mjs test/vitest/vitest.database-worker-core-paths.mjs`: passed.

No assertions, retries, or timeouts changed. No production code changed.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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