Skip to content

perf(ci): remove the anthropic-cli jiti stall and stripe the full-plan whales#109769

Merged
steipete merged 3 commits into
mainfrom
claude/ci-hint-refresh-full-plan-striping
Jul 17, 2026
Merged

perf(ci): remove the anthropic-cli jiti stall and stripe the full-plan whales#109769
steipete merged 3 commits into
mainfrom
claude/ci-hint-refresh-full-plan-striping

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #109332, attacking the two ~250s serial CI bins that now own main-run wall time, plus a profiled 130s module-evaluation stall:

  1. src/plugin-sdk/anthropic-cli.ts stalled ~131s per cold worker on CI. It snapshots CLAUDE_CLI_BACKEND_ID at module scope through the sync facade loader, which on source checkouts jiti-evaluates the anthropic plugin's full api.js barrel (Testbox import profile: anthropic-cli.ts self-time 130.86s). Every graph that reaches src/agents/cli-runner/prepare.ts paid it — this is why agentic-agents-core-runner-cli stripes ran 157–245s for two files whose tests finish in 1s, and why yesterday's timing census concluded the file "cannot be split further".
  2. core-fast (268s) and core-tooling (265s) ran as single jobs on the full/main plan. core-fast is import-bound (247s vitest: 181s module evaluation vs 49s tests); core-tooling is test-time bound (173s of spawned-process tests). The compact PR plan already stripes tooling; the full plan did not.

Why This Change Was Made

Maintainer-requested bundled follow-up ("do all of it, one larger PR"). After #109332 and the caching waves (#109330/#109425/#109593), these were the measured critical-path items.

User Impact

  • CI main-run wall time: the two ~265s bins become ~5 jobs of ~60–110s each; the cli stripes drop from a 245s tail to ordinary ~15s bins.
  • Contributors on source checkouts stop paying a silent 130s jiti stall in any test whose graph touches cli-runner/prepare.ts.
  • Compact PR plans gain the docker tooling helper coverage they previously dropped (the docker config now rides with the isolated shard on both plans), and the compact-only tooling expansion is deleted (one striping path).

Evidence

  • Testbox proof of the stall fix: vitest.agents-core on cli-runner.reliability + helpers: 157.6s → 14.25s (import 155.7s → 12.8s); import profile before/after names src/plugin-sdk/anthropic-cli.ts (130.86s self) as the sole whale. New narrow artifact extensions/anthropic/cli-api.ts follows the documented lightweight-artifact pattern (extensions/CLAUDE.md), knip models it like the browser artifacts, and pnpm plugin-sdk:surface:check is clean (facade exports unchanged).
  • Full-plan striping: core-unit-fast → 2 include-list stripes (8 vCPU, admission wave 0, stripe 1 is the vitest fs-cache writer) + a whole core-unit-fast-isolated shard (isolated + fake-timer projects stay unsliced); core-tooling → 4 stripes + combined docker+isolated shard, shared by full and compact plans. Planner invariants tested: stripes partition files with no overlap, bundled include coverage equals base coverage, cache-warm workflow warms the union of unit-fast configs.
  • Hints: rebased onto the fresh 5-run census (perf(ci): recalibrate compact shard hints to 5-run measured means #109717) and corrected only the entries the stall fix invalidates (cli stripes 245/18/8 → 15/15/8, with the measured Testbox rationale in the comment).
  • Tests: ci-node-test-plan, ci-workflow-guards, ci-changed-node-test-plan, ci-run-node-test-shard, plugin-sdk-subpaths contract, extensions/anthropic/cli-shared, cli-runner/prepare — all green post-rebase (300+ assertions). Remote pnpm build green (facade/lazy-boundary rule). Codex autoreview (gpt-5.6-sol, xhigh): clean.
  • Not addressed here (measured, needs its own session): check-prompt-snapshots stays ~196s — still ~304s on a 16 vCPU Testbox with the facade fix, so its cost is broad graph execution under tsx, not the stall.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts extensions: anthropic size: M maintainer Maintainer-authored PR labels Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 3:46 AM ET / 07:46 UTC.

Summary
The PR replaces the Anthropic CLI facade’s full plugin-barrel load with a lightweight artifact, stripes full-plan unit/tooling CI shards, updates cache warming and guards, and tolerates SQLite sidecars disappearing during permission tightening.

PR surface: Source +15, Tests +14, Config +5, Other +4. Total +38 across 9 files.

Reproducibility: yes. at source level for the module-scope full-barrel load and the sidecar TOCTOU window, with supplied Testbox timing evidence for the former. The full-plan automation result has not been demonstrated after the change.

Review metrics: 2 noteworthy metrics.

  • CI topology: 2 unit-fast stripes, 1 isolated unit-fast shard, 4 tooling stripes, 1 combined tooling shard. The full plan’s execution and cache topology changes materially, so exact-plan proof matters beyond planner unit tests.
  • Runtime scope added after review: 1 agent-database permission path changed. The newest commit broadens this CI-performance PR into runtime state handling and needs its own observed behavior evidence.

Stored data model
Persistent data-model change detected: persistent cache schema: .github/workflows/vitest-cache-warm.yml, serialized state: .github/workflows/vitest-cache-warm.yml. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Resolve the current base conflict and refresh review on the rebased exact head.
  • Attach a successful full/main Actions run covering all new shards and cache warming.
  • [P1] Add redacted logs or a reproducible transcript for the SQLite sidecar race fix.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The Testbox timing output demonstrates the Anthropic import improvement, but no exact-head full/main Actions run proves the new topology and no runtime log proves the newly added SQLite sidecar-race repair; redact private data in added evidence and update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The full/main shard topology still lacks an after-fix GitHub Actions run, so planner tests and compact-plan CI do not prove job generation, cache warming, coverage, and timing under the actual changed plan.
  • [P1] The latest commit adds agent-database permission behavior after the prior review, but the PR body does not provide after-fix runtime evidence for the observed SQLite sidecar race.
  • [P1] GitHub reports the current head as dirty against an advanced base, so the exact merge result is not yet reviewable.

Maintainer options:

  1. Prove the exact full plan (recommended)
    Resolve the base conflict and attach a successful exact-head full/main run covering all striped jobs and the cache warmer.
  2. Accept the unobserved topology risk
    A maintainer may explicitly override proof after reviewing the planner invariants and current exact-head checks.
  3. Split the SQLite repair
    If the sidecar race cannot be proven promptly, move that unrelated runtime fix to a focused PR and keep this branch CI-only.

Next step before merge

  • [P1] No mechanical code repair is identified; the contributor must resolve the dirty base and supply the missing exact-head behavior proof, after which a maintainer decides whether the evidence clears the automation risk.

Maintainer decision needed

  • Question: Must this PR provide an exact-head full/main Actions run plus runtime evidence for the SQLite sidecar race, or is the current Testbox, planner-test, compact-CI, and build evidence sufficient?
  • Rationale: The central change alters CI automation that compact PR checks do not fully exercise, and the latest head adds runtime state handling after the prior proof review.
  • Likely owner: steipete — The strongest available history trail is the recent merged CI planner and cache work this PR extends.
  • Options:
    • Require full-plan proof (recommended): Rebase, run the full/main workflow, and add redacted SQLite race evidence before merge.
    • Override the proof gate: A responsible maintainer accepts the current measured Testbox and test evidence and explicitly owns the unobserved full-plan and runtime risk.

Security
Cleared: No new dependency, action source, secret access, permission broadening, or supply-chain execution path is introduced; the SQLite change preserves the existing mode and ignores only ENOENT.

Review details

Best possible solution:

Rebase the exact head, run the full/main workflow that exercises every new shard and cache-warm path, and add redacted runtime or CI logs showing the SQLite permission sweep survives disappearing WAL/SHM sidecars.

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

Yes at source level for the module-scope full-barrel load and the sidecar TOCTOU window, with supplied Testbox timing evidence for the former. The full-plan automation result has not been demonstrated after the change.

Is this the best way to solve the issue?

Yes for the core implementation shape: the lightweight plugin-owned artifact and centralized shard plan fit existing boundaries. It is not yet merge-ready because the final exact head lacks full-plan and SQLite runtime proof.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is low-urgency CI performance and reliability maintenance rather than a user-facing product regression.
  • merge-risk: 🚨 automation: The branch changes test-shard generation, runner setup, and cache warming, where an incorrect plan could omit coverage or destabilize main CI despite unit-level planner checks.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The Testbox timing output demonstrates the Anthropic import improvement, but no exact-head full/main Actions run proves the new topology and no runtime log proves the newly added SQLite sidecar-race repair; redact private data in added evidence and update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +15, Tests +14, Config +5, Other +4. Total +38 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 3 17 2 +15
Tests 2 60 46 +14
Docs 0 0 0 0
Config 2 11 6 +5
Generated 0 0 0 0
Other 2 89 85 +4
Total 9 177 139 +38

What I checked:

Likely related people:

  • steipete: Prior merged PRs 109330, 109332, and 109717 established the cache, striping, and timing-hint behavior this branch extends. (role: recent CI planner contributor; confidence: high; commits: 7bf5c772be3e, 093b8859c47d, f1fc40ff34a6; files: scripts/lib/ci-node-test-plan.mjs, .github/workflows/vitest-cache-warm.yml, test/scripts/ci-node-test-plan.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-17T07:36:25.438Z sha b26d338 :: needs real behavior proof before merge. :: none

steipete added 3 commits July 17, 2026 00:48
src/plugin-sdk/anthropic-cli.ts snapshots CLAUDE_CLI_BACKEND_ID at module
scope through the sync facade loader, which jiti-evaluates the full
anthropic api.js barrel on source checkouts: 130.86s of self time per
cold worker on CI (Testbox import profile), silently stalling every job
whose graph reaches cli-runner/prepare.ts. A narrow cli-api.js artifact
carries the two static facts; Testbox proof: the reliability+helpers
agents-core pair drops from 157.6s to 14.3s.
core-fast ran the import-bound unit-fast graph as one job (247s vitest,
181s module evaluation) and core-tooling as one serial job (241s); both
now stripe on the full plan like the compact plan, so the compact-only
expansion is deleted and the docker helper config rides with the
isolated shard on both plans. Group hints refreshed from main run
29551077288; stale per-file commands hints dropped (the consolidation
landed); cache-writer selection and the warm workflow track the stripe
names.
…sweep

existsSync+chmodSync raced SQLite's own WAL/SHM cleanup: a checkpoint or
close between the two calls throws ENOENT (observed from the transcript
reconcile worker in server-startup-web-fetch-bind on CI). chmod directly
and swallow only ENOENT, which removes the TOCTOU window.
@steipete
steipete force-pushed the claude/ci-hint-refresh-full-plan-striping branch from 329d5e7 to 9493d36 Compare July 17, 2026 07:51
@steipete
steipete merged commit 543244e into main Jul 17, 2026
122 checks passed
@steipete
steipete deleted the claude/ci-hint-refresh-full-plan-striping branch July 17, 2026 07:58
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 17, 2026
Group walls measured from compact run 29564411446 (post-#109769):
core-unit-fast-isolated runs 78.6s on 4 vCPU because fork-per-file
isolation parallelizes poorly there; pin it to the 8 vCPU class where
the same segment runs ~50s. Unit-fast stripes measure ~25-37s (hinted
100/60) and tooling stripes 71-87s; refresh both so the packer stops
overfilling small bins (the 299s compact tail this run produced).
Cheap stripes may now co-locate in one bin, so the compact test only
requires their presence.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…n whales (openclaw#109769)

* perf(sdk): load Claude CLI identity from a narrow plugin artifact

src/plugin-sdk/anthropic-cli.ts snapshots CLAUDE_CLI_BACKEND_ID at module
scope through the sync facade loader, which jiti-evaluates the full
anthropic api.js barrel on source checkouts: 130.86s of self time per
cold worker on CI (Testbox import profile), silently stalling every job
whose graph reaches cli-runner/prepare.ts. A narrow cli-api.js artifact
carries the two static facts; Testbox proof: the reliability+helpers
agents-core pair drops from 157.6s to 14.3s.

* perf(ci): stripe unit-fast and tooling node tests on the full plan

core-fast ran the import-bound unit-fast graph as one job (247s vitest,
181s module evaluation) and core-tooling as one serial job (241s); both
now stripe on the full plan like the compact plan, so the compact-only
expansion is deleted and the docker helper config rides with the
isolated shard on both plans. Group hints refreshed from main run
29551077288; stale per-file commands hints dropped (the consolidation
landed); cache-writer selection and the warm workflow track the stripe
names.

* fix(state): tolerate vanished sqlite sidecars in agent-db permission sweep

existsSync+chmodSync raced SQLite's own WAL/SHM cleanup: a checkpoint or
close between the two calls throws ENOENT (observed from the transcript
reconcile worker in server-startup-web-fetch-bind on CI). chmod directly
and swallow only ENOENT, which removes the TOCTOU window.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
)

Group walls measured from compact run 29564411446 (post-openclaw#109769):
core-unit-fast-isolated runs 78.6s on 4 vCPU because fork-per-file
isolation parallelizes poorly there; pin it to the 8 vCPU class where
the same segment runs ~50s. Unit-fast stripes measure ~25-37s (hinted
100/60) and tooling stripes 71-87s; refresh both so the packer stops
overfilling small bins (the 299s compact tail this run produced).
Cheap stripes may now co-locate in one bin, so the compact test only
requires their presence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: anthropic maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant