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.
Improved translation for Kilo Gateway description and added new desktop-related translation strings for reload webview, update installation failure, and CLI installation confirmation.
* 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
* feat: add Kilo soul prompt for consistent personality across all models
* fix: gate soul prompt behind Codex check to match existing prompt delivery pattern
Codex sessions deliver prompts via options.instructions, not system messages.
Prepend the soul to options.instructions for Codex, and skip it from the
system array, matching how SystemPrompt.provider() is already handled.
* fix: make Ctrl+C interrupt instead of kill, require double-press to exit
* fix: revert config changes, handle ctrl+c double-press in event handlers only
Reverts keybind default changes (unnecessary — ctrl+c overlap is handled
by event priority in onKeyDown). Adds missing preventDefault() in
child-session ctrl+c handler to prevent SIGINT.
Remove noisy console.log statements that were useful during development
but too verbose for production:
- resolveWebviewView/Webview HTML lifecycle logs
- Providers loaded diagnostic log with counts
- postMessage result log (fired on every single message)
- sendMessage request body diagnostic log
- messageCounter field (only supported debug logging)
Keep error/warn logging that aids production troubleshooting:
- postMessage dropped (no webview) warning
- postMessage delivery failure error
- HTTP request/response errors (failed, empty body, invalid JSON)
- Provider fetch failure error
The prepare-cli-binary script would fail when opencode dependencies
weren't installed, because bunfig.toml requires @opentui/solid/preload.
Adding a bun install step before the build ensures deps are available.
When sending the first message, the extension creates a session via HTTP
and sends sessionCreated. Then the SSE session.created event sends a
duplicate. Between the two, a createEffect restores pendingModelSelection
to the provider default. The second handleSessionCreated would read this
default and overwrite the user's stored selection.
Guard with !store.modelSelections[session.id] so the pending selection
is only applied to truly new sessions.
Two root causes fixed:
1. Model ID mismatch: backend model keys use provider prefix (e.g. 'kilo/auto')
but KILO_AUTO constant and settings default used 'auto' without prefix.
findModel() never matched. Fixed defaults everywhere.
2. Message delivery race: ProviderProvider registered its providersLoaded handler
in onMount (too late). Moved to component body, added requestProviders retry
with 500ms interval, and extension-side provider caching.
- Default model is now kilo/auto
- Model changes only affect the current chat session
- Global VSCode config serves as default for new sessions
- Remove saveModel global persistence
- Normalize provider catalog keys from numeric indices to provider.id
(backend /provider returns array-indexed keys like '0','1',... but
the prompt endpoint expects real provider IDs like 'anthropic','openai')
- Improve HTTP error handling: read response text first, then parse JSON
to avoid cryptic 'Unexpected end of JSON input' errors
- Handle empty 200 responses gracefully (message endpoint returns no body,
results arrive via SSE)
- Add diagnostic logging for sendMessage request body