fix(apple-runner): resend a read only on the runner's busy refusal

Merged
TH
2mo ago
+124-33

Summary

A read-only runner command is now resent inside one request only when the runner refused it with RUNNER_BUSY. Before, any COMMAND_FAILED with details.retriable: true was resent. That flag is for a caller's poll (wait); #1126 added the check for RUNNER_BUSY only. The rule is renamed flagged_retriable → runner_busy and keys on details.runnerErrorCode. The app_not_running row and its ordering note are deleted.

Producers of retriable: true that reach the classifier:

  • RUNNER_BUSY: still resent.
  • APP_NOT_RUNNING: not resent, as before.
  • runner_phase_budget_exhausted and apple_toolchain_probe_unavailable (thrown in ensureRunnerSession): no longer resent. Each resend opened a fresh startup budget, which defeated the #2423 cap. A probe timeout already gets one retry inside that budget.
  • External AppleRunnerProviders: no resend on the flag alone. A provider that forwards the runner's RUNNER_BUSY code is still resent.

All keep retriable, so the caller retries on its next request. CHANGELOG updated. 4 files. Closes #2862.

With #2804: its runner_busy_refusal row matches this runner_busy row. When it rebases, it adds drainResend: true here and drops its duplicate row. The new busy test does not assert the status probe that #2804 removes.

Validation

Tested at 7a24d34091. pnpm check:affected --run passed: 387 files, 2669 tests. The first run had one timeout in the unrelated runner-client.test.ts; it passed on the rerun.

All tests go through runAppleRunnerCommand. Mutations that each turn tests red:

  • Key the rule on retriable: APP_NOT_RUNNING, startup-phase and provider tests fail.
  • Restore main's classifier: the three retriable-producer tests fail.
  • Set retryable: false on runner_busy: the busy-resend and alert-provider tests fail.

No device run: no Swift or wire change.