The Kilocode extension stores project-level MCP settings in
.kilocode/mcp.json, but the migrator was looking for
.kilocode/mcp_settings.json (which is only used for global settings).
This meant local MCP servers were never picked up by the CLI.
refactor(opencode): improve project ID resolution and normalization
Implement logic to resolve a unique project identifier with priority given
to `.kilocode/config.json` and falling back to the git origin remote URL.
The resolved ID is normalized, cached per-instance, and sent as a header
to the Kilo Gateway provider to enable project-specific tracking.
* fix: use 'max' instead of 'xhigh' as highest reasoning effort for Anthropic models on Kilo Gateway
Anthropic's native effort levels are low/medium/high/max, not xhigh.
The upstream merge replaced the Kilo-specific effort mapping with
OPENAI_EFFORTS which uses xhigh. This restores 'max' as the
user-facing variant name while mapping it to 'xhigh' on the wire
for OpenRouter API compatibility.
* fix: clarify comment about OpenRouter effort naming vs Anthropic naming
Enterprise users logging in via OAuth had their organization ID stored
in auth.accountId but the model fetch code never read it, causing the
model list to be fetched from the personal endpoint instead of the
org-specific endpoint that applies the allow list.
Unify ingest queue and session close reasons via `Session.CloseReason` and
ensure `TurnOpen`/`TurnClose` publishing is awaited; mark close reason as
`error` on unexpected exceptions and handle abort-induced stops correctly.
Add ingest queue tests for stable-key coalescing of session open/close and for
including `?v=1` on flush requests.
Remove dynamic installation of built-in plugins. GitLab auth is now imported
directly as an internal plugin, eliminating network requests during startup
and simplifying the plugin loading logic.
Removes the need for test mocks since plugins are no longer
dynamically installed at runtime.
* feat: enable reasoning for Claude models via Kilo Gateway
Enable extended thinking/reasoning support for Claude models when using
Kilo Gateway (OpenRouter-based). This includes:
- Add Kilo Gateway to OpenRouter SDK key mapping
- Skip toolCallId normalization for OpenRouter/Kilo to preserve thinking blocks
- Strip thinking/reasoning blocks from messages before sending to avoid
Anthropic API signature validation errors (blocks must be unchanged)
- Skip caching for OpenRouter/Kilo to avoid modifying thinking blocks
- Add Claude-specific reasoning effort variants for Kilo Gateway
- Enable default medium reasoning effort for Claude via Kilo Gateway
- Add proper smallOptions handling for Claude vs other models
The key insight is that Anthropic's API requires thinking blocks to be
EXACTLY unchanged with valid signatures. Since our storage reconstructs
messages, we strip thinking blocks (already shown to user) rather than
risk signature validation failures.
* fix: drop empty messages after stripping thinking blocks
Enable reasoning effort level cycling (Ctrl+T) for Claude models through
Kilo Gateway by:
- Adding @kilocode/kilo-gateway to sdkKey() to use 'openrouter' key for
provider options
- Adding dedicated variants() case for Claude/Anthropic models with full
effort levels (none, minimal, low, medium, high, xhigh)
- Supporting grok-3-mini reasoning variants through Kilo Gateway
- Fixing smallOptions() to use correct reasoning.effort format
OpenRouter maps effort levels to budget_tokens percentages:
- xhigh: 95%, high: 80%, medium: 50%, low: 20%, minimal: 10%, none: 0%
Wrap callback execution in a promise microtask so synchronous errors flow
through the existing `.catch()` and the in-flight entry is reliably cleaned
up. Update tests to await the microtask before asserting call count.
Always return the in-flight promise when a refresh is running so callers
don’t receive an expired cached value. Preserve the original timestamp
until refresh succeeds and only update it on successful recompute to
avoid masking failed refreshes.