Skip to content

fix(apple): start no host runner cache build while a provider serves Apple tooling - #3225

Merged
thymikee merged 1 commit into
mainfrom
claude/blissful-shannon-0c549f
Oct 5, 2026
Merged

thymikee merged 1 commit into
mainfrom
claude/blissful-shannon-0c549f

Conversation

@thymikee

@thymikee thymikee commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

On macOS, remote-proxy-parity.test.ts > "proxy lease expiry tears the session down…" fails (also on main): the hermetic signal guard refuses pkill -TERM/-KILL -P <pid> aimed at a real xcodebuild build-for-testing the test started by accident. Linux passes because it has no xcodebuild.

The build comes from readiness keep-hot (ensureAppleReady → appleAutomation.keepHot → prewarmAppleRunnerCache(device, {})). It never asked either provider seam. It also passes no request id, so ADR 0001's request-id-scoped runner provider could never cover it for proxied requests. Across provider scenarios, 52 keep-hot calls started real host prewarm work.

prewarmAppleRunnerCache is speculative host work. It now declines, with a debug ios_runner_cache_prewarm_unavailable diagnostic, while a scoped Apple tool provider serves the request. That is the rule the macOS helper build already follows. Production behavior is unchanged: the daemon never scopes an Apple tool provider. The hermetic guard is untouched.

4 files; the scope query goes through the runner host port (R77).

Not covered: doctor.test.ts still starts 5 real warmups through host-scoped appleRunnerWarmupCheck. Its world supplies no Apple providers, so it is a separate follow-up.

Validation

Tested commit 9eec6cc7a8, macOS:

  • New test in runner-client-prewarm.test.ts: fails without the gate, passes with it.
  • Target test: fails on main, passes here.
  • vitest run --project provider-integration test/integration/provider-scenarios/: 70/70 files. Instrumented real cache prewarms: 57 → 5 (doctor only).
  • pnpm check:affected --run: all runnable checks pass.

Linux has not been run locally; the PR's Integration Tests job covers it.

Review in cubic

…Apple tooling

The readiness keep-hot prewarm called prewarmAppleRunnerCache with no request
id, so it reached the host xcodebuild even when a scoped Apple tool provider
served the request. On macOS every provider-scenario iOS open started a real
build-for-testing in the background; the lease-expiry parity test then hit
the hermetic signal guard when teardown pkill'd that build's children.

The cache prewarm is speculative host work, so it now declines (debug
diagnostic ios_runner_cache_prewarm_unavailable) while a provider serves Apple
tooling, the same rule the macOS helper build already follows.
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.06 MB 5.06 MB +186 B
Package (unpacked) 5.06 MB 5.06 MB +186 B
Package (download) 1.52 MB 1.52 MB +28 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.6 ms 27.3 ms +0.7 ms
CLI --help 79.9 ms 83.6 ms +3.7 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

@thymikee

thymikee commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

I found no problems in 9eec6cc. The runner prewarm gate and host port now skip the host build while a provider serves Apple tooling, and nothing else in the diff changes behavior. All 19 checks pass, and the platform-apple unit tests and provider scenarios cover the touched code. I know of no conflicts, and nothing else stands in the way of merging.

I did not run the test suites, the macOS target test or the provider-scenario instrumentation myself. Those numbers come from the PR body. The new test calls prewarmAppleRunnerCache directly inside withAppleToolProvider, so it does not drive the keepHot route through ensureAppleReady. I checked that AsyncLocalStorage context survives void import().then() with a standalone node snippet, not through the daemon.

Two notes that need no change here. Embedders that supply an appleToolProvider resolver but build the runner with host xcodebuild lose the speculative runner build, which costs some first-command latency. So "production unchanged" holds only for the default daemon. Also, doctor.ts:44 still starts a real prewarm outside any provider scope, which the PR body already lists as a follow-up.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 5, 2026
@thymikee
thymikee merged commit 7c1489b into main Oct 5, 2026
19 checks passed
@thymikee
thymikee deleted the claude/blissful-shannon-0c549f branch October 5, 2026 11:34
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-05 11:35 UTC

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

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant