test(cli): stub the Claude binary so the runner integration suite passes without a local Claude install - #1696
Open
junmo-kim wants to merge 1 commit into
Open
Conversation
… availability preflight The runner integration suite spawns sessions whose new agent-availability preflight requires an installable Claude CLI. CI runners have none, so every spawn returned agent_unavailable and four suite tests failed. The isolated test env now writes a minimal stub claude binary into the temp home and points workers at it via HAPI_CLAUDE_PATH (the same override the production launcher honors), keeping production behavior untouched.
junmo-kim
force-pushed
the
fix/runner-integration-agent-preflight
branch
from
August 26, 2026 10:02
2172ada to
f9ec890
Compare
There was a problem hiding this comment.
Findings
- None.
Summary
Review mode: initial
No Blocker, Major, Minor, or Nit issues found in the added or modified lines. Residual risk is limited to runtime behavior covered by the existing runner integration suite.
Testing
- Not run (automation); PR code was not executed. GitHub test and integration checks were pending at review time.
HAPI Bot
Contributor
Author
|
@tiann heads-up — this also fixes the currently red |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since e5a8212, the runner's agent-availability preflight rejects session spawns on machines without a Claude CLI — which includes CI runners. So the four spawn-based tests in
src/runner/runner.integration.test.tsfail on every recentmainrun, and that red integration check spills onto unrelated open PRs too.Solution
The isolated test env now writes a minimal stub
claudeinto the temp home (same pattern asagentAvailability.test.ts) and points workers at it viaHAPI_CLAUDE_PATH, the override the production launcher already honors. Production behavior is untouched; the suite still exercises the real preflight path. Windows skips the stub, and setup only injects the override when the config supplies one.Tests
claudeoffPATHand noHAPI_CLAUDE_PATH(4 failed | 9 passed); all pass after the change (13 passed | 1 skipped).bun typecheck && bun run testgreen on the fork.