fix(config): handle 'local-agent' provider in getLLMConfig#118
fix(config): handle 'local-agent' provider in getLLMConfig#118hoptoad-off wants to merge 2 commits into
Conversation
Routing a mission through a connected local CLI agent (Claude Code / Codex /
Hermes) sets the provider to `local-agent`, but getLLMConfig's switch had no
case for it, so it fell through to `default` and threw
`Unknown provider: local-agent`. This aborted every keyless mission with a
REFUSED, even though `local-agent` is a registered provider wired to
LocalAgentAdapter everywhere else.
Add a `case 'local-agent'` mirroring `codex`: keyless (no apiKey/baseUrl), with
the connected agent id (codex|claude|hermes) carried in `model` and a sensible
default. Verified getLLMConfig('local-agent','claude') now resolves to
{provider:'local-agent', model:'claude'} instead of throwing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Triage note: this is backend-only ( This PR only fixes |
jmagly
left a comment
There was a problem hiding this comment.
Reviewed PR #118 at 2f081b668b8594516e18ef4a0ff97dc43e0f5dc2.
The implementation is small and locally behaves correctly, but the changed failure branch has no regression test. Existing provider and local-agent tests do not call config.getLLMConfig with local-agent, so removing this case would leave CI green and restore the keyless-mission failure.
Please add focused assertions that:
- local-agent with model claude returns provider/model without API key or base URL
- omitting the model uses the intended default
Verification:
- npm run typecheck: pass
- targeted provider/local-agent tests: 37/37 pass, but do not cover this branch
- npm test: 644/644 pass
- No GitHub checks reported on this head
- Public-input threat preflight: low risk
…nius#118) Addresses review feedback: the fix had no test, so removing the `case 'local-agent'` would leave CI green while re-breaking keyless missions. Adds focused assertions in src/__tests__/local-agent-provider.test.ts: - local-agent + model `claude` resolves to provider/model with no apiKey/baseUrl - any supported agent id (codex|claude|hermes) passed as model is preserved - omitting the model falls back to the default agent id - getLLMConfig('local-agent') no longer throws - AVAILABLE_MODELS['local-agent'] surfaces the connected-agent ids Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @jmagly — added the regression coverage in
Verification here: new file 5/5 pass, Note (unrelated to this change): |
What & why
Routing a mission through a connected local CLI agent (Claude Code / Codex /
Hermes) sets the LLM provider to
local-agent. ButgetLLMConfig'sswitchin
src/config/index.tshad nocase 'local-agent', so it fell through todefaultand threwUnknown provider: local-agent— aborting every keylessmission with a
REFUSED, even thoughlocal-agentis a registered providerwired to
LocalAgentAdaptereverywhere else in the codebase.Repro: connect a local agent in the War Room (no API key), launch a mission →
Backend error: Unknown provider: local-agent.Fix
Add a
case 'local-agent'mirroringcodex: keyless (noapiKey/baseUrl),with the connected agent id (
codex|claude|hermes) carried inmodeland asensible default.
Verification
getLLMConfig('local-agent','claude')now resolves to{provider:'local-agent', model:'claude'}instead of throwing.npx tsc --noEmitclean;src/__tests__/provider-models.test.ts15/15 pass.the recon engine produces real tool-backed findings.