Skip to content

test(system-agent): reuse setup fixtures - #118636

Merged
steipete merged 1 commit into
mainfrom
codex/perf-large8-tail
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-large8-tail

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

System-agent unit tests repeatedly performed real CLI backend discovery and plugin metadata scans while exercising mocked routing and persistence behavior. This kept the compact large-8 test job on the critical path despite the tests not owning backend discovery.

Why This Change Was Made

The affected suites now reuse the existing contract-level Claude CLI fixture. Ordinary mocked Codex activations also reuse the suite's frozen plugin metadata snapshot, while the dedicated plugin-lifecycle test continues to inject the real resolver and prove the forced refresh path.

User Impact

No user-visible behavior changes. Maintainers get faster system-agent test feedback without changing test counts, workers, sharding, or lifecycle coverage.

Evidence

  • Focused proof: 7/7 isolated tests and 180/180 unit tests passed.
  • Same-host warm unit-src baseline: 339 files, 4,142 tests, 118.69 seconds.
  • Same-host warm unit-src after: 339 files, 4,142 tests, 109.28 seconds.
  • Improvement: 9.41 seconds (7.9%) with identical test membership and worker count.
  • Autoreview: clean, no accepted/actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@steipete steipete self-assigned this Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:13 AM ET / 11:13 UTC.

ClawSweeper review

What this changes

The branch replaces repeated system-agent CLI backend and plugin-metadata setup with shared fixtures so mocked setup tests avoid unnecessary runtime discovery.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer landing: it is a focused test-performance cleanup that reuses the established system-agent fixture pattern and preserves the dedicated real metadata-resolver lifecycle test. No concrete patch defect was found, but the protected maintainer label and still-running exact-head checks mean it should not be auto-closed or routed to an automated repair.

Priority: P3
Reviewed head: 7c35834b3ceab2aa8fcfe09d8fa1fa26752c3d68

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, established-pattern test refactor with concrete timing evidence and no actionable correctness or security finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body provides after-change focused test counts plus same-host before/after timing with unchanged test membership and worker count; this test-only change has no separate user-facing runtime behavior to demonstrate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides after-change focused test counts plus same-host before/after timing with unchanged test membership and worker count; this test-only change has no separate user-facing runtime behavior to demonstrate.
Evidence reviewed 6 items Focused fixture refactor: The branch changes only system-agent test setup: three suites install the existing shared Claude CLI fixture, while setup-inference reuses prepared plugin metadata for ordinary mocked Codex activations.
Shared helper owns cleanup: The shared helper installs a contract-level Claude CLI backend and returns the reset function, matching the branch's beforeAll/afterAll usage.
Sibling pattern: Current-main system-agent tests already use this same helper with beforeAll/afterAll cleanup, so the refactor follows an established local fixture lifecycle rather than adding a second mechanism.
Findings None None.
Security None None.

How this fits together

System-agent setup tests exercise inference route selection and plugin lifecycle behavior using mocked configuration, CLI backend, and plugin metadata dependencies. The shared fixtures feed those tests while the production activation path continues to obtain metadata after a Codex runtime install and registry refresh.

flowchart LR
  A[System-agent test suites] --> B[Shared CLI backend fixture]
  A --> C[Prepared plugin metadata fixture]
  B --> D[Mocked setup activation]
  C --> D
  D --> E[Route and lifecycle assertions]
  E --> F[Faster unit-test feedback]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still in progress, including the compact large-8 lane this PR is intended to improve.
  • Resolve merge risk (P1) - The repository's Codex-related review policy calls for direct sibling Codex-source inspection, but ../codex is absent in this read-only environment; a maintainer-side final review should satisfy that local policy gate before merge.
Agent review details

Security

None.

PR surface

Tests +17. Total +17 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 36 19 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 36 19 +17

Review metrics

Metric Value Why it matters
Test performance evidence 118.69s to 109.28s, 9.41s faster (7.9%) The PR body reports identical warm unit-src membership and worker count, directly measuring the intended critical-path reduction.
Production versus test LOC production +0/-0, tests +36/-19 All changed lines are test-only fixture setup, so no runtime product surface grows.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/system-agent/setup-inference.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one shared fixture path for mocked system-agent tests, retain real resolver injection for registry-refresh lifecycle coverage, and merge once exact-head CI and the repository-local Codex review gate are complete.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one shared fixture path for mocked system-agent tests, retain real resolver injection for registry-refresh lifecycle coverage, and merge once exact-head CI and the repository-local Codex review gate are complete.

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

Not applicable: this PR changes test-fixture setup rather than repairing a reported operator-visible defect. The body provides focused test and timing results for the affected test behavior.

Is this the best way to solve the issue?

Yes, with pending validation: the shared helper is the established owner for this mocked CLI backend contract, and the branch preserves the real resolver where plugin-install lifecycle behavior is specifically asserted.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5b7272f9b55d.

Labels

Label changes:

  • add P3: This is a small internal test-speed improvement with no intended user-visible or runtime behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-change focused test counts plus same-host before/after timing with unchanged test membership and worker count; this test-only change has no separate user-facing runtime behavior to demonstrate.
  • 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. Sufficient (terminal): The PR body provides after-change focused test counts plus same-host before/after timing with unchanged test membership and worker count; this test-only change has no separate user-facing runtime behavior to demonstrate.

Label justifications:

  • P3: This is a small internal test-speed improvement with no intended user-visible or runtime behavior change.
  • 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. Sufficient (terminal): The PR body provides after-change focused test counts plus same-host before/after timing with unchanged test membership and worker count; this test-only change has no separate user-facing runtime behavior to demonstrate.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-change focused test counts plus same-host before/after timing with unchanged test membership and worker count; this test-only change has no separate user-facing runtime behavior to demonstrate.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger introduced the shared CLI backend fixture and recent setup-inference fixture deduplication on current main; the PR extends that same test-owner boundary. (role: recent area contributor; confidence: high; commits: c40faefcf522, e9bd45d38d4f; files: src/system-agent/system-agent.test-helpers.ts, src/system-agent/setup-inference.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for exact-head CI, especially the compact large-8 lane, to complete successfully.
  • Complete the repository-required direct Codex-source inspection before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 1af8bdd into main Aug 3, 2026
128 of 134 checks passed
@steipete
steipete deleted the codex/perf-large8-tail branch August 3, 2026 11:18
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: test(system-agent): reuse setup fixtures This is item 3/3 in the current shard. Shard 5/25.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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