Skip to content

perf(ci): trim plugin reload fixture compilation - #197783

Merged
vincentkoc merged 3 commits into
mainfrom
perf/ci-plugin-reload-runtime-20261112
Nov 12, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
perf/ci-plugin-reload-runtime-20261112

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Related: #197690

What Problem This Solves

Plugin-reload CI proofs compile the full test-worker graph twice even though their subprocesses only need production runtime entries.

User Impact

Less compiler work for the same plugin-reload regression coverage. No product behavior change; private child ownership, shutdown checks, and conservative selection fallbacks remain intact.

Why This Change Was Made

Qualify the two product fixtures for runtime workers and preserve that preset through their private child bootstrap. Previously the helper passed the artifact directory but the bootstrap defaulted to full. Migrate the existing Responses fixture to the helper-owned preset flag so it is forwarded exactly once.

The continuation proof also required an incidental main-thread temp-resolver witness from default logging. After #197742 moved that logging work to a worker, all continuation effects passed but that unrelated witness failed. Remove that assertion from the continuation scenario; retain the prebound child, private SQLite guard, exact-path checks, process-tree joining, all three continuation cases and both revocation cases. Direct handoff-consumer coverage is unchanged.

Evidence

  • Same 4-vCPU Linux Testbox, identical two targets, Node 24.22.1 and pinned Bun 1.4.4-canary.1+191755ec1. Full base a41c7111235f versus candidate e90764356fd3: both wrappers pass all five nested scenarios, with matching outcome counters, zero skips and both processTreeJoined receipts.
  • Combined emitted worker files: 49,368 → 15,198 (−69.2%). Combined preparation: 66.679 → 42.892 seconds (−35.7%).
  • Test payload including planning, compilation, tests and cleanup: 159.375 → 129.493 seconds (−18.7%). Child CPU, including preflight/version subprocesses: 271.557 → 219.890 seconds (−19.0%).
  • One full-then-runtime pair; cache/order noise is not isolated. Payload timings exclude source transfer and hydration. No production billing reduction is claimed.
  • Real bootstrap regression fails before the fix for runtime/tooling descriptors; all 155 focused tests pass after it. Targeted tooling typecheck and the test-line budget pass.
  • Independent review and complete local ClawSweeper review of a41c7111235f..e90764356fd3: no actionable findings. The subsequent CI repair and integration with logging base 5d6a026e4375 are separately validated below; the timing pair remains prior-base evidence.
  • Local gateway lint could not start: its SDK declaration prerequisite timed out after 300 seconds. This is a preparation gap, not a passing lint result; required PR CI must validate the Gateway surface. Scoped tooling lint, including the corrected regression, passes.

CI repair evidence

  • CI run 43242672638: traced the duplicated preset flag and the incidental witness failure to their owners.

  • Responses/bootstrap repair: seven outer tests passed, including five nested Responses cases; format and independent source review passed.

  • Current repair head: 769c58bc0ed7ed4203e7f5b93f211db0c21d7aed, integrated with the exact logging base used by the failing CI. Fresh complete local ClawSweeper review of 5d6a026e4375..769c58bc0ed7 found no actionable findings. Grouped local proof on the integrated head failed at both unchanged 120-second outer deadlines: compiler preparation took 162.952/165.482 seconds and continuation only reached Gateway startup. The host was heavily loaded with about 54 GiB of swap used. This is an unresolved local qualification gap; no timeout was increased and no passing result is claimed. Exact-head Linux PR CI must cover both fixtures before landing.

  • Repaired-head Linux CI passed: Responses settlement job and grouped plugin-reload job. The reload pair executed all five nested scenarios with zero skips and both processTreeJoined receipts. Runtime preparations were 30.376/30.752 seconds, 7,598 outputs each. This resolves the product-outcome gap from the timed-out local run; these CI timings are not a matched cost comparison.

@vincentkoc vincentkoc self-assigned this Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 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 scripts Repository scripts size: S labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 12, 2026 14:57
…plugin-reload-runtime-20261112

* commit '5d6a026e43757ea6302e4c1151d6ace28468ced0':
  fix(logging): avoid main-thread stalls when resolving default log files (#197742)
  fix(sessions): commit selected invitations with original messages (#184512)
  improve: make Telegram tool progress easier to scan (#197523)
  fix(test): keep queued Stop cleanup on real timers (#197734)
  fix: keep usage pricing from blocking the Gateway on filesystem lookups (#197599)
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR selects runtime workers for plugin-reload tests and forwards their preset through the private child bootstrap.

Example: CI runs the plugin-reload continuation and revocation product tests.

  • Before: The fixtures prepare full worker graphs, with 49,368 combined emitted files in the reported baseline.
  • After: The fixtures prepare runtime graphs, with 15,198 combined emitted files in the reported candidate.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful measured optimization with focused bootstrap coverage, but a verified caller regression blocks merge and another CI failure remains unattributed.
Proof confidence 🦐 gold shrimp (3/6) This changes test infrastructure without shipped user-visible behavior; the body supplies a bounded compiler comparison and scenario outcomes.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Plugin-reload CI proofs compile unused test-worker artifacts before running their regression scenarios.
Reason: The maintainer-authored direction reduces measured compiler work through existing owners while preserving the intended test coverage.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored optimization has clear value, but the new preset forwarding breaks an existing caller and causes a confirmed CI failure.

Priority: P2
Reviewed head: 29b7c355b0440a423ca60b8c05a80ba3547f21da

Before merge

  • Remove the existing caller’s manual preset argument (P2) - The Responses settlement fixture at test/non-isolated-runner.responses-settlement.test.ts:58 already passes --worker-preset=runtime in args with a runtime worker owner. These added lines prepend the same flag again. The bootstrap consumes one flag, then imports the second as its CLI module, producing ERR_MODULE_NOT_FOUND before the fixture runs. Exact-head CI check checks-node-compact-small-6 reports this failure. Remove the caller’s manual flag so the shared helper owns preset forwarding.

Findings

  • [P2] Remove the existing caller’s manual preset argument — test/helpers/vitest-shutdown-command.ts:41-43
Agent review details

How this fits together

The test runner selects a compiled worker preset, the fixture prepares its artifacts, and the shutdown helper launches a child bootstrap that installs the descriptor before running the selected tests.

flowchart LR
  A[Selected test files] --> B[Runtime worker selector]
  B --> C[Worker artifact owner]
  C --> D[Shutdown command helper]
  D --> E[Private child bootstrap]
  E --> F[Plugin reload scenarios]
Loading

Technical review

Best possible solution:

Keep preset forwarding in the shared helper and remove the existing caller’s manual preset argument so the bootstrap receives it exactly once.

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

Current main explicitly prepares full graphs for these fixtures; source tracing and exact-head CI independently establish the duplicate-preset regression introduced by this PR.

Is this the best way to solve the issue?

Reusing the existing selector and worker owner is appropriate, but the cutover must include the caller that previously forwarded its preset manually.

Full review comments:

  • [P2] Remove the existing caller’s manual preset argument — test/helpers/vitest-shutdown-command.ts:41-43
    The Responses settlement fixture at test/non-isolated-runner.responses-settlement.test.ts:58 already passes --worker-preset=runtime in args with a runtime worker owner. These added lines prepend the same flag again. The bootstrap consumes one flag, then imports the second as its CLI module, producing ERR_MODULE_NOT_FOUND before the fixture runs. Exact-head CI check checks-node-compact-small-6 reports this failure. Remove the caller’s manual flag so the shared helper owns preset forwarding.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared plugin-reload fixture preset changes intended behavior with a stated reason (ed40c47: The shared fixture consolidated private child setup and cleanup while retaining scenario imports, assertions, and worker claims.)
  • Shutdown helper bootstrap arguments keeps the original intent (8ee99d3: Prepare workers outside scenario deadlines and retain cleanup custody through verification; the new forwarding preserves that lifecycle.)
  • Runtime-worker qualification keeps the original intent (7a281c6: Use smaller graphs for qualified explicit selections while retaining conservative full-graph fallbacks.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test test/non-isolated-runner.responses-settlement.test.ts --maxWorkers=1
  • pnpm test test/scripts/vitest-worker-run.test.ts test/scripts/vitest-runtime-worker-selection.test.ts test/scripts/ci-run-node-test-shard.test.ts --maxWorkers=1
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.tooling.json --incremental

What I checked:

Likely related people:

  • Vincent Koc: Raw commit ed40c47 adds src/gateway/server.plugin-reload-product-fixture.test-support.ts:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ed40c476f3df; files: src/gateway/server.plugin-reload-product-fixture.test-support.ts)
  • Dallin Romney: Raw commit 8ee99d3 adds test/helpers/vitest-shutdown-command.ts:40 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8ee99d3560e6; files: test/helpers/vitest-shutdown-command.ts)
  • Peter Steinberger: Raw commit 9597c37 adds test/helpers/vitest-shutdown-command.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9597c371c74a; files: test/helpers/vitest-shutdown-command.ts)

PR surface

Tests +66, Other +2. Total +68 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 67 1 +66
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 69 1 +68

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Reported emitted worker outputs 49,368 → 15,198 (−69.2%) The same two product targets reportedly retain all five scenarios while compiling fewer outputs; the single ordered comparison does not establish a stable timing distribution.

Labels

Label changes:

  • add P2: The optimization is useful, but the introduced failure affects test infrastructure rather than a shipped user workflow.
  • add merge-risk: 🚨 automation: The helper change duplicates an existing bootstrap argument and prevents a CI regression fixture from starting.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The optimization is useful, but the introduced failure affects test infrastructure rather than a shipped user workflow.
  • merge-risk: 🚨 automation: The helper change duplicates an existing bootstrap argument and prevents a CI regression fixture from starting.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 November 12, 2026, 10:14 AM ET / 15:14 UTC.

@vincentkoc
vincentkoc enabled auto-merge (squash) November 12, 2026 15:35
@vincentkoc
vincentkoc merged commit 7cd1455 into main Nov 12, 2026
148 of 149 checks passed
@vincentkoc
vincentkoc deleted the perf/ci-plugin-reload-runtime-20261112 branch November 12, 2026 15:48
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant