Skip to content

test(system-agent): reduce suite setup overhead - #119424

Merged
steipete merged 2 commits into
mainfrom
codex/test-performance-compact-large-2
Aug 5, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-performance-compact-large-2

Conversation

@steipete

@steipete steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reuse one prepared plugin-metadata inventory across system-agent setup projections while rebinding the exact config, environment, workspace, and policy fingerprint
  • keep expensive default TUI, agent-creation, and session-barrel imports out of injected test paths
  • move the output-capturing runtime fixture into a dependency-light support module and retain one explicit real TUI route-verification sentinel

Performance

  • focused four-file hotspot: 90/90 tests, 14.54s to 7.22s Vitest wall time (50.3% faster)
  • paired Linux CI groups on one c7a.8xlarge with four Vitest workers and shared caches:
    • isolated + fake timers: 48.944s to 47.898s
    • unit-src + security: 98.165s to 93.967s
    • combined sequential wall: 147.109s to 141.865s (5.244s faster)
  • exact passing/skipped membership was preserved in every paired group

Proof

  • focused system-agent suites: 254/254 tests
  • metadata lease, verified-inference, audit, and restart owner suites: 72/72 tests
  • paired Linux groups: 5,997 passing tests and 36 skips in both baseline and candidate
  • formatting, diff checks, and Codex autoreview clean

No changelog entry: this is test-performance work plus behavior-preserving lazy imports.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete steipete self-assigned this Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 11:05 PM ET / August 5, 2026, 03:05 UTC.

ClawSweeper review

What this changes

This PR reduces system-agent test setup overhead by reusing prepared plugin metadata, isolating a lightweight runtime fixture, and deferring heavy agent-creation and TUI imports until they are needed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. Current main has not absorbed this PR, the protected maintainer label requires human handling, and the exact-head diff shows no actionable correctness or security defect.

Priority: P3
Reviewed head: 081b3eb6c6a83dbc3195ffbd775b6ca82a41c9d6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving performance patch with source-backed boundary review and passing CI evidence in the PR context.
Proof confidence 🌊 off-meta tidepool Not applicable: This protected maintainer-labeled internal test-performance PR is supported by supplied benchmark and CI evidence; no separate user-visible behavior proof is applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This protected maintainer-labeled internal test-performance PR is supported by supplied benchmark and CI evidence; no separate user-visible behavior proof is applicable.
Evidence reviewed 5 items Current main does not subsume the PR: The PR head is not an ancestor of current main, and no system-agent paths changed between the PR base and current main.
Lazy import preserves existing owner boundaries: The PR defers the default agent-creation import only after approval while retaining injected test dependencies; current production uses the same async commit boundary for the operation.
Metadata fixture keeps the current compatibility contract: The new binder recomputes the policy hash and control-plane fingerprint for each authored config; system-agent route projection consumes manifest metadata, which the metadata loader intentionally includes even for disabled plugins.
Findings None None.
Security None None.

How this fits together

System-agent setup projects configuration and plugin metadata into safe agent operations and an interactive terminal setup flow. This PR reduces test-time initialization around those paths while preserving production creation and TUI execution boundaries.

flowchart LR
  Config[Config and environment] --> Metadata[Plugin metadata]
  Metadata --> Setup[System-agent setup]
  Setup --> Operations[Agent operations]
  Operations --> Creation[Agent creation]
  Setup --> Terminal[Interactive terminal setup]
  Tests[Test fixtures] --> Setup
Loading

Before merge

  • Add real behavior proof - Not applicable: This protected maintainer-labeled internal test-performance PR is supported by supplied benchmark and CI evidence; no separate user-visible behavior proof is applicable.
Agent review details

Security

None.

PR surface

Source +28, Tests +42. Total +70 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 5 60 32 +28
Tests 8 106 64 +42
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 166 96 +70

Review metrics

Metric Value Why it matters
Production versus test LOC production +6/-6; tests and test support +160/-90 The production delta is limited to behavior-preserving import boundaries, while most of the change establishes focused test-performance fixtures and coverage.

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.

Technical review

Best possible solution:

Preserve the lazy runtime boundaries and metadata rebinding, then merge through the normal exact-head maintainer review once the branch is ready.

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

Not applicable: this is test-performance maintenance. The PR body supplies before/after benchmark and CI evidence, while the source review confirms the targeted lazy boundaries.

Is this the best way to solve the issue?

Yes. Reusing process-stable metadata while rebinding config fingerprints, plus narrowing imports at the actual runtime boundaries, is the maintainable way to reduce setup cost without adding production policy paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 22de30f99821.

Labels

Label changes:

  • add P3: This is a bounded internal test-performance cleanup with no reported user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This protected maintainer-labeled internal test-performance PR is supported by supplied benchmark and CI evidence; no separate user-visible behavior proof is applicable.

Label justifications:

  • P3: This is a bounded internal test-performance cleanup with no reported user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This protected maintainer-labeled internal test-performance PR is supported by supplied benchmark and CI evidence; no separate user-visible behavior proof is applicable.

Evidence

What I checked:

  • Current main does not subsume the PR: The PR head is not an ancestor of current main, and no system-agent paths changed between the PR base and current main. (22de30f99821)
  • Lazy import preserves existing owner boundaries: The PR defers the default agent-creation import only after approval while retaining injected test dependencies; current production uses the same async commit boundary for the operation. (src/system-agent/operations-execute.ts:404, 081b3eb6c6a8)
  • Metadata fixture keeps the current compatibility contract: The new binder recomputes the policy hash and control-plane fingerprint for each authored config; system-agent route projection consumes manifest metadata, which the metadata loader intentionally includes even for disabled plugins. (src/system-agent/system-agent.test-helpers.ts:81, 081b3eb6c6a8)
  • Area provenance: Current system-agent operation and TUI lines trace to Peter Steinberger's recent system-agent work; the PR's two commits are also authored by steipete. (src/system-agent/tui-backend.ts:560, 7a0a4c5f2a3b)
  • Release provenance: The open PR head is not contained by a local release tag, so this work is neither shipped nor an implemented-on-main close candidate. (081b3eb6c6a8)

Likely related people:

  • steipete: Current main blames the central system-agent paths to Peter Steinberger, and the supplied PR context identifies steipete as author of both proposed commits. (role: recent area contributor and PR author; confidence: high; commits: 7a0a4c5f2a3b, 5d4c749439db, 081b3eb6c6a8; files: src/system-agent/operations-execute.ts, src/system-agent/tui-backend.ts, src/system-agent/system-agent.test-helpers.ts)

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 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper's remaining real-behavior checkbox is explicitly marked not applicable for this internal test-performance PR. The applicable proof is the paired exact-group benchmark and unchanged test membership in the PR body, plus the green exact-head CI run. No user-visible media proof exists or is required for this change.

@steipete
steipete merged commit 23c7981 into main Aug 5, 2026
127 of 129 checks passed
@steipete
steipete deleted the codex/test-performance-compact-large-2 branch August 5, 2026 03:08
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main: (22 commits)
  refactor(plugins): consolidate lifecycle hook dispatch (#119429)
  fix(ci): stabilize TUI PTY proof ownership (#119420)
  test(system-agent): reduce suite setup overhead (#119424)
  fix(ui): keep session rail pill status from overlapping the headline (#119397)
  fix(discord): avoid doctor runtime loading (#119391)
  fix(media): decouple playback cache retention (#119417)
  fix(slack): infer upload filename extensions from MIME types (#119399)
  refactor(channels): unify configured binding resolution (#119414)
  refactor(google-meet): unify gateway and tool dispatch (#119413)
  test(state): reuse legacy database fixtures (#119423)
  fix(reset): preserve bootstrap guidance for dynamic models (#119179)
  fix(chutes): honor serving context limits (#119196)
  refactor(status): consolidate scan projections and lazy loaders (#119412)
  fix(status): status --all slows down with missing plugins (#119203)
  refactor(gateway): consolidate usage reporting and caches (#119409)
  perf(gateway): keep reload and recovery machinery off gateway cold start (#119094)
  fix(cli): align TaskFlow controller columns for wide text (#118801)
  fix: make startup migration restart guidance install-neutral (#119406)
  fix(ci): preserve cache warmer shard envelopes (#119403)
  fix(sessions): preserve compatible auth profiles on model changes (#117550)
  ...
steipete added a commit that referenced this pull request Aug 5, 2026
* test(system-agent): reduce suite setup overhead

* test(system-agent): type-check TUI call ordering

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
* test(system-agent): reduce suite setup overhead

* test(system-agent): type-check TUI call ordering

---------

Co-authored-by: Peter Steinberger <[email protected]>
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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