Commit Graph

1269 Commits

Author SHA1 Message Date
Mark IJbema 6f7df50b45 Revert "fix(cli): prevent zombie kilo serve processes on extension host crash" 2026-04-01 14:16:01 +02:00
kiloconnect[bot] 2de6c363e3 fix(cli): prevent zombie kilo serve processes on extension host crash
When the VS Code extension host is hard-killed (crash, OOM, kill -9),
dispose() is never called and the kilo serve child process is orphaned.

Fix by using a stdin keepalive pipe: the extension keeps stdin open after
spawning the CLI. The CLI watches for EOF on stdin (only when
KILO_CLIENT=vscode) and triggers a clean shutdown. The OS closes the
write-end of the pipe on any parent death, so the CLI always exits
regardless of how the extension host terminates.

On clean dispose(), stdin is explicitly closed before sending SIGTERM,
so the shutdown path is consistent in both the crash and clean cases.

Closes #8050
2026-04-01 09:04:30 +00:00
Mark IJbema 9a23857265 Merge pull request #7906 from Kilo-Org/mark/fix-windows-hide-regression-7896
fix: add windowsHide:true to remaining spawn/exec calls to prevent CMD flash on Windows
2026-03-31 09:17:32 +02:00
Alex Alecu c4732a6c8c fix(cli): restore agent picker labels 2026-03-31 09:02:11 +03:00
Aarav Sharma 12d292ec08 fix: propagate deprecated field in agent merge and show description in dialog 2026-03-30 16:50:38 -06:00
kiloconnect[bot] 482bf89b69 fix: add windowsHide:true to remaining spawn/exec calls to prevent CMD flash on Windows
Previous fixes in #6813 and subsequent PRs added windowsHide:true to most
spawn sites, but several call sites were missed or regressed:

- SDK server.ts (v1 + v2): kilo serve and TUI spawn
- ts-check.ts: Bun.spawn for tsc invocation
- github.ts: exec for browser open
- desktop-electron cli.ts: install script spawn and version check
- desktop-electron ipc.ts: open-path execFile
- desktop-electron apps.ts: wsl/where execFileSync calls

Without windowsHide:true, each of these subprocess invocations causes a
visible cmd.exe console window to briefly flash on Windows.

Closes #7896
2026-03-30 07:03:58 +00: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
Marian Alexandru Alecu ed03c64710 Merge branch 'main' into feat/config-permission-protection 2026-03-26 17:01:41 +02:00
Alex Alecu 1cb4b5c8c0 refactor(cli): clean up code quality issues 2026-03-26 14:11:54 +02:00
Alex Alecu 721b3d0630 chore(cli): add missing kilocode_change markers 2026-03-26 13:59:08 +02:00
Alex Alecu bfbfbb967c chore(cli): add kilocode_change markers 2026-03-26 13:52:48 +02:00
Alex Alecu 5d611d6da6 revert: remove /new worker/subprocess restart
The subprocess restart approach did not solve the underlying Bun native
memory retention issue (oven-sh/bun#28318). Remove all restart plumbing
from rpc.ts, thread.ts, worker.ts, app.tsx, and sdk.tsx to keep the
diff clean. The diff-size and store-eviction fixes remain.
2026-03-26 11:40:49 +02:00
Alex Alecu 1596cae383 fix(cli): use subprocess instead of Worker thread for actual memory reclamation
Bun Workers are threads within the same OS process — terminate() frees
the JSC context but mimalloc retains every page process-wide, so the
previous Worker-restart approach had zero effect on RSS.

Switch to Bun.spawn() with IPC which creates a separate child process.
Killing that process returns all its native memory to the OS.

The IPC relay pattern means the RPC client persists across subprocess
restarts — event listeners, fetch proxy, and SDK all continue working
without getter-indirection or rebinding.

Workaround for https://github.com/oven-sh/bun/issues/28318
2026-03-26 11:28:14 +02:00
Alex Alecu a7d37318cb fix(cli): replay workspace after restart 2026-03-26 10:46:45 +02:00
Alex Alecu 1a0536daf3 fix(cli): detach RPC listener on cleanup 2026-03-26 10:46:23 +02:00
Alex Alecu 10e3b12b13 fix(cli): evict child sessions recursively 2026-03-26 10:46:09 +02:00
Alex Alecu 6819ee7580 fix(cli): restart worker on /new to reclaim native memory
Bun's JSC does not return freed native heap pages to the OS within a
single Worker lifetime. After large sessions, the only way to reclaim
that 2-3 GB of native allocator retention is to terminate the worker
and spawn a fresh one.

Workaround for https://github.com/oven-sh/bun/issues/28318

- Add getter-indirection layer so fetch/events transparently follow
  worker replacement without rebuilding the TUI
- Add rejectAll() to RPC client to fail in-flight calls on termination
- Add rebindable event source that re-registers handlers on new client
- Wire /new command to fire-and-forget restart; sync layer re-bootstraps
  via server.instance.disposed event from the new worker
- Guard against re-entry and skip in external server mode
2026-03-26 10:28:20 +02:00
Alex Alecu 6878ddb03d fix(cli): strip summary.diffs from messages in TUI store
User messages carry summary.diffs with full before/after file content
(the same giant strings as session_diff). The TUI never reads this
field. Strip it at both entry points (SSE handler + full sync) to
prevent multi-MB strings from accumulating in the Solid store.
2026-03-25 17:52:05 +02:00
Alex Alecu a3c8340401 fix(cli): keep permission and question on evict 2026-03-25 17:40:22 +02:00
Alex Alecu 1a07ad1a56 fix(cli): evict per-session data from TUI store on navigation
The Solid store accumulated messages, parts, diffs, todos, status, and
permissions for every session visited during a TUI lifetime. Navigating
away via /new or the session list never freed the old session's data.

Add an evict() function that deletes all per-session entries from the
store maps and clears the fullSyncedSessions cache. Wire it into:
- A createEffect in app.tsx that fires when the route changes away
  from a session (on() tracks prev vs current sessionID)
- The session.deleted SSE handler, which previously only removed the
  session list entry but left orphaned per-session data
2026-03-25 17:33:05 +02:00
Alex Alecu 7f57983c14 fix(cli): strip before/after from TUI session_diff store
Defense-in-depth: destructure away before/after content from FileDiff
objects at both TUI store entry points (SSE handler + full sync). The
sidebar only reads file, additions, deletions — carrying full file content
in the Solid store is unnecessary and risks memory bloat.
2026-03-25 15:32:33 +02: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
Alex Alecu c2969d296e fix(cli): close absolute-path bypass and extract DISABLE_ALWAYS_KEY constant
- Check absolute patterns in isRequest via isAbsolute() to match the
  existing metadata.filepath dual-dispatch logic, preventing a bypass
  where tools pass absolute project-level config paths in patterns
- Export ConfigProtection.DISABLE_ALWAYS_KEY constant to replace the
  'disableAlways' magic string across config-paths.ts, next.ts, and
  permission.tsx so renames/typos are caught at compile time
2026-03-25 11:52:42 +02:00
Alex Alecu 21902b1dd1 feat(cli): hide 'Always allow' in TUI for config file edits
When the disableAlways metadata flag is set on a permission request,
only show 'Allow once' and 'Reject' options in the TUI prompt.
2026-03-25 11:16:51 +02: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 54e14d7f87 fix: remove dead docs link from github setup wizard output 2026-03-23 11:22:27 +01:00
Mark IJbema 1461b57952 fix: replace dead docs/github link, exclude vercel.link from lychee
- kilo.ai/docs/github/#usage-examples was a 404 (page never created).
  Replaced with kilo.ai/docs/automate/integrations in github.ts:245.
- vercel.link redirects to a login page that blocks bots — added to
  lychee.toml exclusions.
2026-03-23 11:22:07 +01:00
Johnny Amancio 6e4c57f328 fix: Adjust missing merge conflicts not caught before 2026-03-20 12:33:10 +01:00
Johnny Amancio a49820192d resolve merge conflicts 2026-03-20 12:18:26 +01:00
Johnny Amancio f3a327d265 refactor: kilo compat for v1.2.24 2026-03-20 11:56:07 +01:00
Eric Clemmons a75008864f fix(opencode): pass missing auth headers in run --attach (#16097)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
2026-03-19 19:43:43 +01:00
Marian Alexandru Alecu b0bf365e70 Merge pull request #7313 from Kilo-Org/onboarding-improvement 2026-03-19 20:04:36 +02:00
Alex Alecu 4be714dbf9 fix(cli): exclude anonymous kilo provider from connected check
The kilo provider always autoloads with free models and apiKey="anonymous",
causing useConnected() to return true even for first-time users without any
API key. This prevented the onboarding tip from ever appearing.
2026-03-19 16:20:06 +02:00
Alex Alecu 6d42e22a6e fix(cli): show tips for connected first-time users 2026-03-19 16:01:59 +02:00
Alex Alecu c263032282 fix(cli): respect tips toggle during onboarding
The onboarding tip now honors the tips_hidden setting so users
can dismiss it via the command palette if they choose to.
2026-03-19 15:03:49 +02:00
Alex Alecu 4c8df7d336 feat(cli): show onboarding tip for first-time users on free model
First-time users with no connected provider now see a targeted tip
on the home screen: 'Using a free model — run /connect to add your
API key'. Once a provider is connected or the user has sessions,
normal random tip behavior resumes.
2026-03-19 14:31:54 +02:00
Alex Alecu 1ac86e5c36 feat(cli): show config and project paths in /status dialog
Display global config path (from Global.Path.config) and project
directory in the status dialog so users can quickly verify which
config files are being loaded. Paths are shortened with ~ for
readability, matching existing TUI conventions.
2026-03-19 14:28:59 +02:00
Catriel Müller 30d39649aa refactor: merge main 2026-03-18 18:18:38 -03:00
Catriel Müller 7edd3f6fc2 Merge branch 'main' into catrielmuller/kilo-opencode-v1.2.21 2026-03-18 17:10:56 -03:00
Marian Alexandru Alecu 48504430f5 Merge pull request #7252 from Kilo-Org/fix/cli-paste-summary-thresholds
feat(cli): delay paste summary
2026-03-18 18:15:31 +02:00
Marian Alexandru Alecu 82d6b73c91 Merge pull request #7246 from Kilo-Org/feat/cli-terminal-bell
feat(cli): add notifications - ring terminal bell on task done and input prompts
2026-03-18 16:14:05 +02:00
Alex Alecu 773212863c fix(cli): delay paste summary 2026-03-18 16:09:37 +02:00
Marius d85430c0ea feat(vscode): add prompt history navigation with ArrowUp/ArrowDown (#7188)
* feat(vscode): add prompt history navigation with ArrowUp/ArrowDown

* fix: address review bot findings — seed order and session leak

- seedEntries now reverses chronological input so newest message is
  closest to entries[0], matching navigate()'s newest-first expectation
- history.reset() called on session switch to clear stale index/draft
- Updated tests to match corrected seed order

* fix: prevent duplicate entries when append overlaps with seeded history

appendEntry now does full dedup (indexOf + splice) instead of only
checking entries[0]. This prevents the wrap-around bug where seeded
session messages create duplicates when the user re-sends the same
prompts.

* fix: guard history navigation on collapsed selection, use draft not message

- Skip history navigation when text is selected (matches desktop app's
  collapsed-selection check)
- Append draft (user's typed text) instead of message (which includes
  rendered review-comment markdown) to history
- Images are not affected: they're sent as attachments, not part of text
2026-03-18 13:33:02 +00:00
Alex Alecu 98dc60c368 fix(cli): show notifications in ctrl+p 2026-03-18 15:17:54 +02:00
Alex Alecu 70d2906149 fix(cli): add notifications toggle 2026-03-18 15:12:18 +02:00
Alex Alecu 1ddaae711a fix(cli): add bell toggle 2026-03-18 15:12:00 +02:00
Alex Alecu 95131dada7 fix(cli): remove run bell 2026-03-18 15:11:39 +02:00
Alex Alecu 3ce6dd9505 fix(cli): skip input bell on route change 2026-03-18 14:44:43 +02:00
Alex Alecu 929aea38d1 fix(cli): skip bell on session route change 2026-03-18 14:44:13 +02:00