mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
The session previously called resolveClaudeBinary() directly in buildOptions(), with no seam for tests. CI ran without claude on PATH, so every test that exercised buildOptions hit the production throw. Apply the ports-and-adapters pattern at the client boundary (the same place tests already configure queryFactory): - ClaudeAgentClient takes optional resolveBinary, defaults to resolveClaudeBinary which throws "Claude binary not found..." when the executable is missing — preserving production fail-fast. - Client passes resolveBinary through to ClaudeAgentSession options. - buildOptions calls this.resolveBinary() instead of importing the free function directly. - Tests construct the public client with a stub resolver. No __claudeAgentInternals export, no reaching into the session. User-facing fail-fast still lives where it always did — AgentManager gates start/resume/draft flows on client.isAvailable(). The throw in resolveClaudeBinary is defense-in-depth that mirrors Codex.