mirror of
https://github.com/wu736139669/hapi.git
synced 2026-12-05 07:07:04 +00:00
`hapi runner start` spawned `runner start-sync` with `env: process.env`, so a
runner restarted from an interactive shell inherited that shell's provider
credentials. On a machine where the login shell also drives a provider
directly (e.g. official DeepSeek in ~/.zshrc), the restarted runner silently
lost the `~/.hapi/runner.env.local` overrides and every spawned Claude session
hit the wrong endpoint — 400 "supported API model names are ..." — while
sessions on the previous runner kept working.
The launchd launcher already sources both env files; only the terminal path
did not. Load `runner.env.local` in the parent before spawning, with the same
precedence (overrides win). Shell `$VAR`/`${VAR}` references expand from the
inherited env (single quotes stay literal), so paths like
`"$HOME/.dsh/hapi-token"` survive without a shell.
The interactive shell's own exports are untouched: official-provider use and
HAPI-spawned agents no longer share one set of credentials.
via [HAPI](https://hapi.run)
Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>