#16815: feat: add Kilo provider and OpenRouter routing params
agents
stale
size: M
Cluster:
Model Management Enhancements
## Summary
- add KILO_API_KEY support in model auth and expected shell env keys
- add OpenRouter-style routing extra params handling for kilo/openrouter payloads
- add disableTools resolution from model extra params in runner attempt logic
- extend e2e tests for Kilo extra params and routing behavior
## Validation
- corepack pnpm tsgo
- corepack pnpm exec vitest run -c vitest.e2e.config.ts src/agents/pi-embedded-runner-extraparams.e2e.test.ts
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds Kilo as a new OpenRouter-compatible provider with `KILO_API_KEY` env support, OpenRouter-style provider routing overrides (`provider: {...}` payload injection), and per-model `disableTools` resolution from extra params.
- Registers `KILO_API_KEY` in model auth (`model-auth.ts`) and shell env expected keys (`io.ts`)
- Extracts `mergeExtraParams` helper from inline logic in `applyExtraParamsToAgent` for reuse
- Adds `resolveOpenRouterRoutingFromExtraParams` to parse `openrouterDataCollection`, `openrouterAllowFallbacks`, `openrouterRequireParameters`, `openrouterProviderOnly`, and `openrouterProviderOrder` from model config params
- Adds `createOpenRouterRoutingWrapper` that injects `provider: {...}` into OpenAI-compatible payloads for `openrouter` and `kilo` providers (gated by `isOpenRouterLikeModel`)
- Adds `resolveDisableToolsFromExtraParams` to allow per-model tool disabling via config params, used in `attempt.ts` to determine whether to create tools
- Tests cover disableTools boolean/string parsing, override re-enabling, routing resolution, and end-to-end routing payload injection for Kilo models
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — well-structured additions with comprehensive test coverage and no logic errors found.
- The changes are clean and well-scoped: env key registration, helper extraction, new routing/tool-disable features, and thorough e2e tests. The code follows existing patterns, key parsing functions handle edge cases correctly, and the stream function wrapper chain is properly ordered. No security issues, no regressions to existing behavior, and the merge of inline logic into reusable helpers is a net improvement.
- No files require special attention.
<sub>Last reviewed commit: d8016c3</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#20212: feat: Add Kilo Gateway provider
by jrf0110 · 2026-02-18
80.6%
#7570: fix: allow models from providers with auth profiles configured
by DonSqualo · 2026-02-03
76.1%
#7770: feat(routing): Smart Router V2 - Configuration-driven model dispatc...
by zzjj7000 · 2026-02-03
74.1%
#16766: fix(model): apply provider baseUrl/headers override to registry-fou...
by dzianisv · 2026-02-15
74.1%
#4459: fix: enable image input for Kimi K2.5 and refresh stale config mode...
by manikv12 · 2026-01-30
73.6%
#20587: feat: add Tetrate Agent Router Service provider
by RicHincapie · 2026-02-19
73.0%
#6960: feat: Add kimi-coding provider support
by YYW0228 · 2026-02-02
72.9%
#7044: feat: Add local model tool calling support
by jokelord · 2026-02-02
72.3%
#15756: [Security]: strip provider apiKey from models.json before prompt se...
by SecBear · 2026-02-13
72.1%
#15571: feat: infrastructure foundation — hooks, model failover, sessions, ...
by tangcruz · 2026-02-13
71.8%