Repository navigation
fix(server): warn at startup when only half of the LLM gateway is configured - #236
Conversation
…figured The gateway is used only when both PI_PROXY_URL and PI_PROXY_API_KEY are set. With just one, agents silently call providers directly and the mistake only shows up as a failed turn. Log one warning at server start naming the missing variable and what happens instead; with a model catalog, warn that gateway requests will carry no key. Startup is never blocked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hey @camielvs, I did a pre-review pass over the diff and the code it relies on: the catalog startup assertion in Worth acting on
Checked and fine · what was run · not checkedWhat was run
Checked and fine
Good to know
Not checked
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thanks @EdwardGallant. Added the case in 8f9cdbf: with a catalog (file or URL) and only I also checked whether |
Description
The shell routes models through an LLM gateway only when both
PI_PROXY_URLandPI_PROXY_API_KEYare set. If only one is set, agents silently call each provider directly, and you only find out when an agent turn fails.The server now logs one warning at startup (not on every agent spawn) when exactly one of the two is set. The warning says which variable is missing and what happens instead, for example:
With a model catalog configured, every model goes through the gateway anyway, so in that case the warning says requests will carry no API key.
Startup is never blocked: direct provider keys may be exactly what you want. The check follows the startup-check pattern from #223 (a catalog with no gateway). The README config table and
docs/server/orchestrator.mdeach gain one sentence about the both-or-neither rule.Screenshots
N/A
How to test
cd apps/server && pnpm exec tsx --test src/pi/gatewayEnv.test.ts: 5 tests pass.PI_PROXY_URL=https://gateway.example.comand noPI_PROXY_API_KEY. One warning namingPI_PROXY_API_KEYis printed before[server] listening …, and the server keeps running.PI_PROXY_API_KEYset). The warning namesPI_PROXY_URL.pnpm typecheck,pnpm lintandcd apps/server && pnpm testpass.Notes
🤖 Generated with Claude Code