316 Commits
Author SHA1 Message Date
Catriel Müller 581f90f9ae Merge pull request #7800 from Kilo-Org/catrielmuller/kiloclaw-client
feat(cli): KiloClaw Chat on TUI
2026-04-02 07:39:54 -03:00
AaravandMarius 2e3b9a2432 fix: RevertBanner UI shows no changes after successful file revert (#8121)
* core: fix revert diff showing incorrect changes after file restore

When reverting a session, the diff was computed after files were already
reverted to their pre-change state, producing an empty or wrong diff.
By computing the diff before restoring files, the revert summary now
correctly reflects what was actually undone for the user.

* core: reduce revert diff size in DB to save storage

Full file contents were being stored in the session summary diffs,
causing unnecessary database bloat. The webview RevertBanner only
needs file path, line counts, and status — not the full diff content.

* chore(cli): add kilocode_change markers to revert diff changes

---------

Co-authored-by: Marius <marius@kilocode.ai>
2026-04-02 12:21:43 +02:00
Catriel Müller 32f670e1cc Merge branch 'main' into catrielmuller/kiloclaw-client 2026-04-01 16:20:14 -03:00
Catriel Müller 964cc74007 refactor: improve SDK claw types 2026-04-01 16:04:32 -03:00
80f187ebba feat(kilo-vscode): migrate legacy sessions into new extension (#7924)
* feat(vscode): detect sessions in old extension

* feat(vscode): added session types

* feat(cli): add endpoints for inserting a session

* feat(vscode): use session types from sdk for parsing

* feat(kilo-vscode): parsing session project

* feat(vscode): parse legacy session details

* feat(kilo-vscode): refactoring

* feat(vscode): parse legacy session messages

* feat(vscode): parse legacy session parts

* feat(vscode): added testing files and id creation

* feat(vscode): merge tool parts on imported session

* feat(vscode): session message part refactoring

* feat(vscode): cover provider-specific reasoning parts on session migration

* feat(kilo-vscode): handle completion result parts

* feat: type hardening on session migration

* feat(kilo-vscode): create tool part correctly

* feat(kilo-vscode): adjust session part processing

* feat(vscode): persist migrated session in kilo.db

* feat(vscode): add error handling to session migration

* feat(vscode): add directory field to session migration

* feat(kilo-vscode): display completion check on session migration

* feat(vscode): prevent migrating sessions twice

* feat(cli): use correct project id when inserting migrated session

* feat(kilo-vscode): Use correct project id for session migration

* feat(kilo-vscode): load sessions on migration complete

* feat(kilo-vscode): ignore environment details user part when migrating sessions

* feat(cli): create project details following current backend logic

* feat(kilo-vscode): cleaner messages without environment_details parts

* feat(kilo-vscode): refactoring

* feat(kilo-vscode): refactoring and organization

* feat(kilo-vscode): method renaming to improve clarity

* feat(kilo-vscode): added session migration test strategy

* test(kilo-vscode): implement legacy migration unit tests for all migration modules

Replace todo stubs with full test implementations across messages,
parts, tools, reasoning, parser, migrate, project, and session test
files. Add new project.test.ts and session.test.ts covering project
construction, session metadata, and deterministic ID generation.

* style(kilo-vscode): apply prettier formatting across legacy migration source and test files

* fix(legacy-migration): filter out non-user/assistant entries before parsing messages

Exclude system and other non-conversational roles from the conversation
array prior to mapping, ensuring parentID references remain consistent
across imported messages when skipped entries exist.

* refactor(parts): skip part generation for non-conversational message roles

Entries with roles other than user or assistant should not produce
parts, keeping part output consistent with the messages that are
actually imported during legacy migration.

* fix(ids): use semantic kind strings to prevent part ID collisions for reasoning entries

Replace numeric indices with descriptive kind strings ("reasoning",
"provider-reasoning") in extra part ID generation to avoid collisions
between reasoning parts and regular content parts within the same
message.

Introduce `createExtraPartID` to distinguish reasoning-specific IDs
from standard sequential part IDs produced by `createPartID`.

* refactor(session-import): guard against empty worktree in legacy project import

Prevent silent misattribution of migrated sessions by rejecting empty
worktree paths before resolving the project directory. Without this
check, an empty string would fall back to the current process directory,
causing the imported session to be attached to the wrong project.

* perf(cli): cache MCP listTools results to avoid redundant RPCs per loop step (#7922)

MCP.tools() called client.listTools() for every connected server on
every agent loop iteration. With multiple servers this added hundreds
of milliseconds of overhead per step (measured ~300-750ms for remote
servers like Vercel).

Cache listTools results in a module-level Map and return them on
subsequent calls. The cache is invalidated on:
- ToolListChangedNotification from the MCP server
- Server add/connect/disconnect
- Instance dispose (config change, project switch, shutdown)

* fix(agent-manager): add retries to worktree cleanup for macOS .app bundles (#7921)

* chore: hide non-English localization files in GitHub PR diffs

Mark all non-English i18n locale files as linguist-generated=true so
they are collapsed by default in GitHub PR diffs, reducing noise when
reviewing changes that touch translation files.

* feat(vscode): add Browse Marketplace button to MCP settings

Add a "Browse Marketplace" button to the MCP Servers subtab in Agent
Behaviour settings, guiding users to discover and install MCPs from the
marketplace rather than only configuring them manually.

- Add button above the MCP server list that opens the Marketplace panel
- Add openMarketplacePanel webview message type and handler
- Add translations for all 18 supported languages

* fix(vscode): preserve project directory when opening marketplace from settings

Pass the current panel's project directory through to the marketplace
panel so project-scoped MCP installs work correctly in multi-root
workspaces. Without this, the marketplace panel would fall back to
null project directory since there is no active text editor when
clicking from a webview.

* feat(vscode): add Browse Marketplace button to agents and skills tabs

Add the Browse Marketplace button to the Agents and Skills subtabs in
Agent Behaviour settings, matching the existing button in the MCP
Servers subtab. This lets users discover marketplace items from any
of the three configuration tabs.

- Agents tab: added as a ghost button in the header row alongside
  Import and Create Mode buttons
- Skills tab: added as a secondary button at the top-right, matching
  the MCP tab layout
- Extracted the browse handler to the component scope for reuse

* chore: update kilo-vscode visual regression baselines

* perf(agent-manager): extend slimPart to strip heavy tool metadata for faster session switching (#7927)

Extend slim-metadata.ts to handle apply_patch, multiedit, write, and bash
tools in addition to edit. Previously only edit tool parts had their heavy
metadata stripped before IPC serialization. apply_patch parts carried full
file before/after contents per file, write parts carried the entire written
file, and bash parts carried up to 30KB of output — all serialized on every
session switch.

This reduces session-switch time by ~2x for sessions with many tool calls.

* style(legacy-migration): reformat long reasoning push call for readability

* refactor(legacy-migration): filter non-user/assistant entries before indexing

Move the role filter from inside `parseParts` to `parsePartsFromConversation`
so that message indices are derived only from the filtered list. This ensures
part message IDs stay aligned with the imported messages and skipped entries
(e.g. system role) do not cause index gaps in the generated IDs.

* fix(legacy-migration): add `_migrated_` infix to generated IDs

Prefix all migrated entity IDs (sessions, messages, parts) with a
`_migrated_` segment so they are clearly distinguishable from IDs
produced by the regular runtime. Updates tests to assert the new
prefix format.

* refactor(legacy-migration): consolidate conversation parsing into `parseSession`

Remove the intermediate `createMessages` and `createParts` async
wrappers that each independently read and parsed the conversation
file. The file is now fetched and parsed once in `parseSession`,
with the resulting conversation passed directly to
`parseMessagesFromConversation` and `parsePartsFromConversation`,
eliminating redundant I/O.

* fix(parts-builder): remove `toTextWithinMessage` and use `toText` directly

`toTextWithinMessage` was a duplicate of `toText` with identical
behavior. Replace all call sites with `toText` and delete the
redundant function.

* fix(parts-builder): skip provider-specific reasoning when explicit reasoning entry exists

Guard `isProviderSpecificReasoning` with `!isReasoning` to prevent
duplicate reasoning parts when an entry carries both a `type:
"reasoning"` field and a provider-specific reasoning field (e.g.
`reasoning_content`). The explicit reasoning entry takes precedence.

* test(legacy-migration): add coverage for edge cases in parts and tools parsing

Add unit tests for two previously uncovered scenarios:

- Task block extraction: verify only the content inside `<task>` tags
  is kept when text exists outside the legacy task wrapper
- Empty tool result: verify the tool name is used as fallback output
  when `tool_result` carries no readable text content

Also replace the dynamic `FileType.Directory` workaround with the
direct `vscode.FileType.Directory` enum reference, and harden
`parseFile` to throw on non-array JSON instead of silently returning
an empty array.

* feat(legacy-migration): remove session migration tracking from global state

Drop the `readSessionsToMigrate` filter and the post-migration
`globalState` flag that tracked which sessions had already been
migrated. Detection now returns all sessions found in global storage
without filtering by prior migration status.

* fix(session-import): skip duplicate session imports and child data

Check for an existing session row before inserting and return a
`skipped: true` flag when the session already exists. The migration
client honours this flag to bypass message and part imports, avoiding
redundant work when migration is re-run.

Replace `onConflictDoUpdate` with `onConflictDoNothing` on the session
insert path to align with the new pre-check behaviour. Propagate the
optional `skipped` field through the result types and generated SDK
types for project, session, message, and part responses.

* refactor(parts-builder): mark legacy system error text parts as ignored

Tag text parts whose content begins with `[ERROR]` with `ignored: true`
and a `legacy-system-error` metadata source. Introduces a new
`isLegacySystemErrorText` utility in `parts-util` to encapsulate the
detection logic.

* feat(parts-util): extract feedback text from tool_result content into visible parts

Parse `<feedback>` tags embedded in `tool_result` content and emit a
dedicated text part so user feedback is surfaced as a visible message
rather than buried inside tool result data.

Introduces `getFeedbackText` utility to extract and trim the inner
content of `<feedback>` blocks from arbitrary input.

* fix: formatting

---------

Co-authored-by: Marius <marius@kilocode.ai>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: Mark IJbema <mark@kilocode.ai>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-31 17:13:34 +02:00
Aarav Sharma e9060468a1 core: deprecate orchestrator agent with visual badge across UI
Mark the orchestrator agent as deprecated so users see a warning badge
in the mode switcher and agent settings, signaling they should migrate
to other agent configurations for task delegation.
2026-03-29 17:24:52 -06:00
Catriel Müller 8737bdfb19 feat: KiloClaw Chat on TUI 2026-03-27 10:48:01 -03:00
Evgeny Shurakov 508378464a Merge pull request #7446 from Kilo-Org/eshurakov/ingest-stream
Remote - add real-time session relay and remote control over WebSocket
2026-03-25 13:43:17 +01:00
Catriel Müller a8e0da3da7 feat: Kilo gateway custom modes 2026-03-24 10:22:54 -03:00
Evgeny Shurakov 37b866f1ef feat(cli): add remote session relay over WebSocket
Introduce WebSocket-based remote session relay so external clients can
subscribe to sessions, send messages, answer questions, and respond to
permissions in real time.

- RemoteWS manages the authenticated WebSocket lifecycle with reconnect
- RemoteSender dispatches inbound commands and forwards server events
- Backfill pending questions/permissions when a client subscribes
- Add question_reject command for dismissing questions remotely
- Consolidate /remote TUI command into kilo-commands
- Add session.viewed endpoint to the generated SDK
- RemoteProtocol.Preview schema for diagnostic logging
2026-03-24 13:54:30 +01:00
Mark IJbema b1c91bcbbc Merge pull request #6225 from Kilo-Org/mark/move-dynamic-context-to-user-message
refactor: move dynamic editor context from system prompt to user message
2026-03-19 12:04:48 +01:00
Catriel Müller 7edd3f6fc2 Merge branch 'main' into catrielmuller/kilo-opencode-v1.2.21 2026-03-18 17:10:56 -03:00
kirillk 4e628a8cc0 feat(vscode): propagate isFree from cloud API through CLI to extension
Add isFree field to the full model data pipeline: gateway schema,
ModelsDev.Model, Provider.Model, OpenAPI spec, and SDK types.
Remove cost-based isFree fallback in the extension model selector —
rely solely on the backend-provided value.
2026-03-17 13:33:58 -04:00
Catriel Müller 426521468f resolve merge conflicts 2026-03-17 11:37:03 -03:00
Mark IJbema 2ddf739cd3 refactor: remove timezone from editor context prompt options 2026-03-17 15:09:39 +01:00
Catriel Müller c0a3b2f325 fix: fix sdk generation // vscode test 2026-03-17 07:27:25 -03:00
Imanol Maiztegui 0484318191 Granular bash permission rules (#7091)
* fix: renamed pattern arrays used for permission rules

* fix: rename savePatternRules to saveAlwaysRules

* feat: generate hierarchical always patterns in bash tool

* feat: validate saveAlwaysRules against always array only

* feat: pass always field through extension bridge to webview

* feat: show hierarchical always patterns in PermissionDock dropdown

* fix: rename pattern to rule in PermissionDock translations, styles, and data-slots

* fix(vscode): correct auto-run comment in PermissionDock

* feat(kilo-vscode): strip trailing wildcard from permission rule labels

* fix: deduplicate permission rules and strip wildcards from display labels

* refactor: move hierarchy to metadata.rules, restore always to arity prefix

* feat: pass always field to permission dock for non-bash tool rules

* fix: correct bash test assertion to check metadata.rules and fix indentation

* fix: hide permission rules dropdown for non-bash tools

* fix: align always-rules route descriptions, whitespace, and restore multi-command tests
2026-03-16 17:43:16 +01:00
Mark IJbema 0b702ea1d7 feat: add backend route to delete custom mode files from disk
Replace the config disable:true approach with a proper Agent.remove()
function that scans config directories for the agent's markdown file
and deletes it, then refreshes state via Instance.dispose().

- Add Agent.remove() in agent.ts with RemoveError
- Add POST /kilocode/agent/remove route
- Mount KilocodeRoutes in server.ts
- Update KiloProvider to call the new backend route
- Regenerate SDK
2026-03-16 15:54:45 +01:00
Mark IJbema cfe4e8c46c fix: switch skill removal to POST with JSON body instead of DELETE with query params
File paths as query parameters can fail due to URL encoding issues.
Switch to POST /kilocode/skill/remove with the location in the JSON
request body, which avoids encoding problems entirely.

Also log the SDK error response to aid debugging.
2026-03-16 13:04:07 +01:00
Mark IJbema 9507b01c4c fix: rely on optimistic removal instead of stale backend response
The DELETE endpoint was returning data that somehow rendered as empty
rows in the webview. Simplify the approach:

- Webview optimistically removes the skill from its signal immediately
- Extension fires DELETE to the backend (deletes from disk + cache)
- Extension invalidates cachedSkillsMessage so next tab visit fetches
  fresh data
- No second skillsLoaded message is sent after removal, avoiding the
  stale data overwrite that caused the UI corruption
2026-03-16 13:04:07 +01:00
Mark IJbema f998ee32dc fix: return updated skills list from DELETE endpoint to fix stale UI
The DELETE /kilocode/skill endpoint now returns the updated skills
list (Skill.Info[]) instead of a boolean. The extension uses this
response directly to update the webview, eliminating the need for a
separate GET /skill round-trip that could return stale cached data.

Also normalize paths in Skill.remove() with path.resolve() to ensure
location strings match regardless of path format differences.
2026-03-16 13:04:07 +01:00
Mark IJbema 2d9e447399 refactor: rename to KilocodeRoutes at /kilocode prefix
Rename routes/skill.ts to routes/kilocode.ts with KilocodeRoutes
export, mounted at /kilocode. This is the single home for all future
kilo-specific CLI endpoints, avoiding conflicts with the existing
/kilo gateway routes and keeping all kilo changes out of server.ts.

SDK: client.kilocode.removeSkill()
2026-03-16 13:04:07 +01:00
Mark IJbema 07d16dff23 refactor: move DELETE /skill to dedicated route file
Extract the inline DELETE /skill endpoint from server.ts into a
dedicated packages/opencode/src/server/routes/skill.ts file, reducing
kilo-specific changes in the shared server.ts and minimizing future
merge conflicts with upstream.

The route is mounted at /skill and uses the same lazy() pattern as
other kilo-specific route files (telemetry, enhance-prompt, etc.).
2026-03-16 13:04:07 +01:00
Mark IJbema ec544e8288 feat: add DELETE /skill endpoint and use CLI backend for skill removal
Add Skill.remove() that deletes the skill directory from disk and
mutates the cached Instance.state in-place so subsequent GET /skill
calls return the updated list.

Add DELETE /skill?location=... server endpoint, regenerate the SDK,
and update KiloProvider to call the SDK method instead of deleting
files directly from the extension.
2026-03-16 13:04:07 +01:00
Imanol Maiztegui 146da40471 chore(sdk): regenerate endpoints (#7062) 2026-03-15 20:18:18 +01:00
Kevin van Dijk b83c848909 Resolve merge conflicts 2026-03-12 12:42:48 +01:00
Kevin van Dijk e6d04c204b refactor: kilo compat for v1.2.17 2026-03-12 12:19:04 +01:00
Marius 2bca0ac9f1 feat(agent-manager): lazy-load worktree diff details (#6945)
* feat(agent-manager): lazy-load worktree diff details

* fix(agent-manager): remove unused diff helper

* fix(agent-manager): preserve summary diff accuracy

* fix(agent-manager): avoid stale diff summary targets

* perf(agent-manager): avoid rescanning diff details
2026-03-12 11:43:38 +01:00
Kevin van Dijk 312733ebd6 Resolve merge conflicts 2026-03-09 13:02:22 +01:00
Kevin van Dijk 2d33025ecb refactor: kilo compat for v1.2.16 2026-03-09 11:31:51 +01:00
opencode-agent[bot] 7da24ebf5d chore: generate 2026-03-06 19:40:36 +00:00
opencode-agent[bot] 2a0be8316b chore: generate 2026-03-04 02:36:18 +00:00
Mark IJbema 6f9a0f0c5a feat(vscode): Enhance Prompt — ✨ sparkle button to improve prompts before sending
Add the Enhance Prompt feature to the VS Code extension, matching the
legacy extension's behaviour. A ✨ sparkle button in the chat input
toolbar rewrites the user's draft prompt using an LLM.

CLI:
- POST /enhance-prompt endpoint using LLM.stream with small model
- System prompt as agent.prompt for caching; user text as user message
- clean() strips code fences and surrounding quotes from LLM output

Extension:
- KiloProvider handler using SDK client.enhancePrompt.enhance()
- Shows VS Code error notification on failure
- WandSparkles icon from lucide-solid via @kilocode/kilo-ui
- Spin animation while enhancement is in flight
- Empty-input click shows feature description (all 16 i18n locales)
- Ctrl+Z / ⌘Z undo restores original draft
- Guard checks isBusy/isDisabled/enhancing matching canEnhance()

Tests:
- 11 unit tests for clean() in enhance-prompt.test.ts

Migration plan:
- Removed feature row (parity achieved)
- Deleted prompt-improvement.md spec doc
2026-03-03 13:21:45 +01:00
opencode-agent[bot] 4b9e19f72f chore: generate 2026-03-02 07:41:53 +00:00
opencode-agent[bot] b88e8e0e0b chore: generate 2026-03-01 03:10:46 +00:00
opencode-agent[bot] fcd733e3d6 chore: generate 2026-03-01 01:45:44 +00:00
opencode-agent[bot] 7ff2710ce3 chore: generate 2026-02-27 20:37:28 +00:00
Kevin van Dijk fccf5544d9 Resolve merge conflicts 2026-02-26 14:46:06 +01:00
opencode-agent[bot] 4551282a4b chore: generate 2026-02-25 22:55:09 +00:00
Kevin van Dijk 2b05e4f40b Resolve merge conflicts 2026-02-25 18:34:18 +01:00
opencode-agent[bot] 5e5823ed85 chore: generate 2026-02-25 14:56:03 +00:00
Igor Šćekić 47352448d8 fix: support ses_ session IDs in cloud import dialog, remove cloud_agent_session_id 2026-02-23 22:03:58 +01:00
Igor Šćekić 2e7a307076 chore(sdk): regenerate SDK for cloud session endpoints
Adds types and client methods for:
- GET /kilo/cloud/session/:id (preview)
- POST /kilo/cloud/session/import
2026-02-23 17:27:33 +01:00
Kevin van Dijk 7ac4e68dc8 Resolve merge conflicts 2026-02-23 13:54:54 +01:00
opencode-agent[bot] 7867ba441f chore: generate 2026-02-20 13:46:03 +00:00
kilo-maintainer[bot] 3c8fc231d0 chore: generate 2026-02-19 15:40:27 +00:00
Christiaan Arnoldus 51a1297d9c Merge branch 'dev' into feat/dynamic-recommended-models 2026-02-19 11:50:21 +01:00
kilo-maintainer[bot] f62e953b48 chore: generate 2026-02-18 17:27:24 +00:00
kilo-maintainer[bot] 18ca6ef192 chore: generate 2026-02-18 14:56:46 +00:00
Kevin van Dijk 6f9f7443ef Resolve merge conflicts 2026-02-18 13:26:43 +01:00