Introduce X-KILOCODE-FEATURE header for tracking request origin
across different entry points (CLI, VSCode extension, autocomplete).
- Add HEADER_FEATURE, DEFAULT_FEATURE, and ENV_FEATURE constants
- Add getFeatureHeader() helper reading from KILOCODE_FEATURE env var
- Include feature header in buildKiloHeaders() when env var is set
- Set feature to "autocomplete" for FIM/completion requests
- Set KILOCODE_FEATURE="vscode-extension" when spawning CLI from VSCode
- Default to "cli" feature in opencode entry point
- Add unit tests for feature header logic
* fix: support remote MCP server migration in mcp-migrator
The MCP migrator only handled stdio/local MCP servers. When a user
configured a remote streamable-http or sse MCP server in
.kilocode/mcp_settings.json, it failed with:
The "file" argument must be of type string. Received undefined
This happened because convertServer() always assumed local servers,
building a command array from server.command (which is undefined for
remote servers).
Changes:
- Add remote transport type detection (streamable-http, sse)
- Convert remote servers to Config.McpRemote (type: "remote")
- Pass through url and headers fields
- Make command optional in KilocodeMcpServer interface
- Add comprehensive tests for remote server migration
* fix: validate url/command before use in mcp-migrator
Add guard clauses for missing url on remote servers and missing command
on local servers instead of using non-null assertions that could crash
on malformed config files.
---------
Co-authored-by: Kilo Agent <agent@kilo.ai>
Co-authored-by: marius-kilocode <marius@kilocode.ai>
* feat: changelog generation
* refactor: rename all ENV variables to KILO prefix
* refactor: publish rework
* refactor: publish rework
* refactor: unify git commiter action
* refactor: add all kilobots to the team
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.
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.
Migrate Kilocode rules from .kilocoderules and .kilocode/rules/ to
Opencode's instructions config array.
Features:
- Discover rules from .kilocoderules, .kilocode/rules/*.md, and
mode-specific variants
- Support global rules from ~/.kilocode/rules/
- Read-only migration (never modifies project files)
- Combines with existing opencode config (never overwrites)
- Kilocode-only (no .roorules or .clinerules migration)
Files:
- rules-migrator.ts: Core migration logic
- config.ts: Integration point for direct CLI usage
- config-injector.ts: Integration for VSCode extension path
- rules-migrator.test.ts: 13 unit tests
- config-injector.test.ts: 4 new integration tests
- rules-migration.md: Documentation
Migrate Kilocode MCP server configurations from the VSCode extension's
mcp_settings.json to Opencode's native MCP config format.
Features:
- Read MCP settings from VSCode extension global storage
- Convert Kilocode format (command + args) to Opencode format (command array)
- Handle disabled servers (skip them)
- Warn about alwaysAllow permissions that cannot be migrated
- Support project-level .kilocode/mcp_settings.json
Config precedence (lowest to highest):
1. Kilocode MCP settings (new)
2. Remote/well-known config
3. Global user config
4. Project config (opencode.json)
5. OPENCODE_CONFIG_CONTENT
This allows users to configure MCP servers in the Kilocode VSCode extension
and have them automatically available in kilo-cli without any manual setup.
Native opencode config takes precedence over legacy Kilocode settings.