Skip to content

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
tiann:mainfrom
junmo-kim:fix/runner-integration-agent-preflight
Open

test(cli): stub the Claude binary so the runner integration suite passes without a local Claude install#1696
junmo-kim wants to merge 1 commit into
tiann:mainfrom
junmo-kim:fix/runner-integration-agent-preflight

Conversation

@junmo-kim

@junmo-kim junmo-kim commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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.ts fail on every recent main run, and that red integration check spills onto unrelated open PRs too.

Solution

The isolated test env now writes a minimal stub claude into the temp home (same pattern as agentAvailability.test.ts) and points workers at it via HAPI_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

  • Reproduced the exact four CI failures locally with claude off PATH and no HAPI_CLAUDE_PATH (4 failed | 9 passed); all pass after the change (13 passed | 1 skipped).
  • Full bun typecheck && bun run test green on the fork.

… 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
junmo-kim force-pushed the fix/runner-integration-agent-preflight branch from 2172ada to f9ec890 Compare August 26, 2026 10:02

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@junmo-kim

Copy link
Copy Markdown
Contributor Author

@tiann heads-up — this also fixes the currently red integration check on main. Since e5a8212, the new agent-availability preflight rejects session spawns on machines without a Claude install, which includes CI runners, so every recent Test workflow run fails on the same 4 tests in src/runner/runner.integration.test.ts and the red check spills over onto unrelated open PRs. Happy to switch approaches if you'd rather solve it on the CI side (e.g., installing Claude in the workflow).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant