The JetBrains backend eagerly warmed the v2 location stack for every
instance, which starts a native @parcel/watcher subscription that lives
for the whole session. On macOS FSEvents watches the entire subtree
recursively (the ignore list is only a userspace filter), so this
always-on watcher burns CPU and leaks native memory while the IDE is
idle — the cause of the 150%+ CPU and multi-GB RSS growth reported in
`kilo serve` on macOS.
The watcher's only consumer is the CLI/TUI sidebar branch label via the
vcs.branch.updated event. JetBrains, like VS Code, has its own git
integration and does not consume that event, so eager watchers are pure
overhead for it. Extend the existing VS Code gate to also exclude
jetbrains; the standalone CLI/TUI stays eager, and editor clients still
build the stack lazily if a real file/pty route needs it.
Fixes#12721
The /privacy command wrote only to global config but read the effective
config, so a project-level privacy_mode could shadow the global toggle
and the UI would not change even though the command reported success.
Since privacy mode is a personal preference, persist and read it only
from the global config.
The sidebar footer used tone() for both the bullet and masked balance,
so the bullet color still revealed whether the balance was low. Use
theme().textMuted for both while masked, retaining tone() only when
privacy mode is off.
* fix: make tool invalid-arguments errors clearly actionable to the model
* fix: address kilo-code-bot review on schema error formatting
Return a jargon-free actionable message when the schema formatter yields no issues (instead of the raw SchemaError), and match Effect's missing-key message case-insensitively so it survives library wording changes.
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
* Address review: cap rendered issues, isolate Kilo logic, harden the fallbacks
- Move formatter/format/path/reason out of the shared upstream tool.ts into
packages/opencode/src/kilocode/tool/tool.ts.
- Cap output at 20 issues / 4 KiB with an '...and N more' suffix, since
validation fails before the normal output truncation.
- Return a readable message when the formatter yields zero issues instead of
falling back to SchemaError jargon.
- Match missing-key messages with a regex instead of an exact string compare.
- Rewrite the changeset around the user-visible outcome.
* chore: annotate the reformatted decode call with kilocode_change markers
The multi-line reformat left lines 122-125 unannotated in a shared upstream
file. Wrap the whole statement in a start/end block instead of per-line inline
markers, and drop the two now-redundant inline ones. Comments only.
---------
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Christiaan Arnoldus <christiaan.arnoldus@outlook.com>
* feat(tui): expand a collapsed paste on a second identical paste
* chore: retrigger review
* chore(tui): add paste expansion changeset
* fix(cli): target paste changeset
* fix(tui): refresh autocomplete after expanding a paste
Call auto()?.onInput on the expand-placeholder path so open autocomplete
matches onContentChange when a second identical paste expands text.
* feat: add signal-to-noise controls to grep tool
Add configurable options to reduce noise in grep results:
- context: show N lines before/after each match
- limit: bound maximum matches (default 100) with early termination
- literal: treat pattern as plain text instead of regex
- ignoreCase: case-insensitive matching
These controls help models avoid overwhelming context windows with too
many matches and provide clear guidance when results are truncated.
Implementation preserves upstream ripgrep structure with minimal Kilo
hooks for additive behavior only. Shared-file changes reduced from 183
to 60 lines compared to initial implementation.
* test(core): tolerate PTY event publication race
* fix(cli): count grep matches independently of context
* feat(agent-manager): allow sessions to move their worktree between sections or ungroup
Add a new to the tool so a session can
reassign its own worktree to another section or ungroup it by passing
. The move operation validates the target section and
the session's worktree, then pushes refreshed state to the panel.
Also tighten the model-facing contract so the list-to-move workflow is
unambiguous: is required first, its result is the
source of truth for section and session IDs, and direct edits to
are rejected by , , and
with an explicit pointer to the tool.
- New / in the Agent Manager protocol
- New domain function with section/session validation
- New OpenAPI hook so stays
nullable in the generated SDK
- Tool schema descriptions now spell out the list-first workflow and
the no-direct-edit rule
- List output now includes an instruction block and is pretty-printed
- Optional nullable Task fields tolerate from models
- Focused CLI tests, bridge unit test, and protection test
* chore: remove local PR screenshot
* style(vscode): format agent manager orchestration
* fix(agent-manager): protect state paths on Windows
* feat(opencode): remote create_session fields, rename adoption, title sync
Extend create_session wire with optional agent/model/orgId (strict v1,
old-CLI degrade via client retry); claim org via session metadata
(metadata > KILO_ORG_ID > auth); adopt system session.renamed via
setTitle with consume-on-failure adoption marks; POST generation-aware
title changes through readiness (auto-titles marked by ensureTitle,
same-title Updated consumes pending adoptions).
* test(opencode): prove cancel→reprompt reaches idle; lock exit survivor
Item 14 CLI prove-it at SessionPrompt level: cancel-when-idle,
mid-stream, mid-tool, queued follow-up (deterministic queue wait), and
abortIntakes all settle to idle and reprompt completes — no production
hang found, no src change. Item 8: lock survivor session send_message
after sibling exit_cli.
* test(opencode): drop AppRuntime spy from create_session default test
Satisfies check-opencode-promise-facades while still proving the
production default forwards {agent, model, metadata} into
Session.Service.create.
* fix(opencode): bound rename marks, wire title report path, harden title tests
Kilobot review on #12704: adoption/auto-title maps now carry timestamps,
prune on write (60s TTL), and clear on Session.Event.Deleted (exported
clear/clearAll); the Updated watcher calls the interface
reportSessionTitle and fullSync passes preloaded info into meta();
ensureTitle's Kilo logic lives in kilocode/session/prompt.ts behind one
kilocode_change call site; title tests poll instead of sleeping and lock
mark-before-write plus clear-on-failure for real; meta() get-failure
org fallback covered via the _metaForTests seam.
* fix(kilo-sessions): mark bookkeeping before ingest sync, AppRuntime, test cleanup
Kilobot round 2 on #12704: consume rename/auto-title marks before the
ingest.sync network hop so the 60s TTL spans only the in-process hop;
call reportSessionTitle via AppRuntime.runPromise; auth cleanup back
under Effect.ensuring; restore the upstream blank line in prompt.ts so
the fork diff is only the kilocode_change call site.
* fix(kilo-sessions): keep title report self-healing if ingest.sync fails
Advance knownTitles only after successful sync; restore consumed rename/
auto-title marks on failure so the next Updated can re-POST. IIFE keeps
const-style outcome derivation.
* fix(kilo-sessions): optimistic knownTitles with full title-path rollback
Advance knownTitles before the network hop so concurrent Updated handlers
see sameTitle and cannot POST the same title with a wrong generated flag.
Restore prev + consumed marks when ingest.sync throws or reportSessionTitle
returns not-ok, so the next Updated retries the full self-healing path.
* style(kilo-sessions): prettier title Updated handler
* fix(kilo-sessions): preserve newer title state
* refactor(kilo-sessions): simplify title reporting tests
* fix(kilo-sessions): report unseeded title updates
* fix(kilo-sessions): consume unseeded title marks
* test(kilo-sessions): cover unseeded title marks
* test(kilo-sessions): unique ids for unseeded title tests
Thread a distinct session id through unseededMockSessionLayer so
session_share Storage records do not couple the three unseeded cases.
Applies the kilocode-merge-minimizer skill to the prior fix. The
hard-veto and headless-subagent DeniedError sites are reverted to
their exact pre-fix shape -- neither carries a specific rule anyway,
so wrapping their ruleset in a { rule, matches } object added shared
upstream diff for no benefit. Only the main deny path (which already
had the deciding rule in scope) still changes, and now passes the
bare rule instead of a wrapper object, shrinking that hunk from a
multi-line block to a single-line swap.
PermissionProvenance.classifyDenial now duck-types ruleset as a
possible bare Permission.Rule (checking action === "deny" and a
string pattern) instead of expecting a { rule } wrapper, so it still
reads the main deny path's rule directly while falling back to a
synthesized deny rule for the other paths, exactly as before.
Net shared-file diff across permission/index.ts, session/tools.ts, and
the TUI's routes/session/index.tsx for this whole feature is now 9
insertions / 12 deletions, down from ~50+ lines.
DeniedError.ruleset only carried the deny-permission subset, so
PermissionProvenance.classifyDenial had to guess the deciding rule via
findLast(action === "deny"). With two deny rules for different
patterns under the same permission (e.g. bash: { "git push *": deny,
"rm -rf *": deny }), this could attribute a denial to whichever rule
sorted last instead of the one that actually matched the request.
Permission.ask now embeds the exact rule resolve()/evaluate() matched
against the request's pattern directly on the error (ruleset: { rule,
matches }), so classifyDenial reads it instead of re-deriving it.
Some denials carry no rule at all (e.g. the headless-subagent policy
denial), where classify({ rule: undefined }) reports the same
{ source: "default" } shape as the *approval* fallback -- silently
rendering a refusal as an auto-approval in the TUI and kilo export.
classifyDenial now synthesizes an explicit deny rule for the request's
permission/pattern in that case, so rule.action always reflects the
real outcome.
Adds test/kilocode/permission/deny-provenance.test.ts covering both
regressions against the real Permission.Service, and updates the
existing session-tools.test.ts denial fixture to the new ruleset
shape.