Commit Graph

1430 Commits

Author SHA1 Message Date
Johnny Eric Amancio b976b5a013 feat(cli): opt-in project memory (#11921)
* feat(memory): opt-in project memory — capture, recall, CLI + TUI integration

Add project memory: the standalone @kilocode/kilo-memory effect layer plus the
opencode CLI/server/TUI integration. Memory is disabled by default, so it is a
no-op until enabled (no behavior change when off).

Capture (turn-close consolidation): per-op parse salvage, secret redaction that
skips the offending op instead of aborting the batch, supersede-only auto-updates
(never model-driven deletes), correction-aware echo handling, non-LLM fallback
digests on interrupted/error turns, a shared interval throttle with idle-flush.

Recall + injection: keyword tokenizer with camelCase/compound splitting, light
stemming, and an English-first stopword filter (Unicode-aware; non-English falls
back to plain token-overlap), a live relevance floor, a budget-reserved startup
index, a session-digest catalog, and per-session prompt-cache pinning of the
injected memory block.

Surfaces: kilo_memory_save / kilo_memory_recall tools, the memory HTTP API
(contract schemas live in the package), and a status-focused TUI sidebar showing
auto-save, loaded context, and active recall, plus the /memory dialog.

* fix(memory): address PR review feedback

- C1: bump @kilocode/kilo-memory in the changeset
- C2: redact secrets before they hit the audit log (skip + salvage paths);
  redact before truncating in salvageTyped so a secret straddling the
  500-char cap can't leak an unmatched fragment; opText -> salvageText
- C3: de-abbreviate savedOperations, "changes" wording, ops.ts -> operations.ts
- C4: log.warn on the remaining silent-catch fallbacks (turn diff, memory
  context injection, tool-visibility check)
- C5: relocate memory storage from ~/.kilo to Global.Path.data, delete the
  now-dead needsDependencyInstall guard, add /memory status (root path) and
  /memory edit ($VISUAL/$EDITOR + auto-rebuild)
- C6: replace the hardcoded English stopword list with corpus-derived
  ubiquitous-term filtering (df across the user's own entries) and the
  English suffix stemmer with suffix-tolerant term matching, so recall
  noise-filtering works in any language
- C8: delete the CORRECTION_INTENT English regex; echo turns now run typed
  capture (digest stays echo-gated), bounded by the interval throttle, with
  the typed prompt as the language-agnostic content filter
- C9: exclude generated paths (dist/build/coverage/*.gen.*/*.map/snapshots)
  from the durable-diff churn fallback so generated churn can't burn a
  consolidation call
- C11: fix duplicated assert in httpapi-memory test; assert the error body
- kilo-code-bot batch: clause-boundary regex fix, byte-safe catalog
  truncation, max-length guards on remember/correct/forget payloads (text,
  query, key, sessionID), trim consistency in reconcile, param-shadowing
  rename, missing doc entry for kilo_memory_recall, dead-code removal,
  dialog UI fixes, memoryEnabledCache eviction bound, dedicated Configure
  schema, recall permission renderer, covered-session pointer cap, redact
  chat transcript before the consolidation model call, split configProtected
  metadata from disableAlways so memory-save prompts don't show config-file
  copy, drop unused MemoryService.layer provide from tool registry
- redact colon-separated low-entropy secrets too (password: hunterx),
  accepting the prose false-positive tradeoff (secret: enabled) in favor of
  not missing a real secret
- rename lastConsolidatedAt -> lastTypedConsolidationAt to make its narrow
  scope (typed-consolidation throttle clock) explicit; regen openapi/SDK
- drop now-dead home/config fields from MemoryPaths.Host after the data-dir
  relocation; add Process.splitCommand for quoted $EDITOR/$VISUAL paths with
  spaces, used by /memory edit and the pre-existing Editor.open utility

* refactor(memory): shared client helpers, capture hardening, /memory UX rework

- extract client-side derivations into kilo-memory so both frontends share
  one implementation: MemoryDecisions.summarize (decision-log summary),
  MemoryAutosaveStatus.summarize (autosave-status semantics), and
  MemoryMarkerMeta (marker wire contract encode/decode)
- match exact-key upserts via the canonical stored id (slugged key,
  normalized section) so a re-emitted spaced/uppercase key updates the
  entry instead of falling to fuzzy dedupe
- salvageTyped throws on valid JSON without an operations array so the
  caller's fallback path records a parse error instead of a silent
  zero-op success
- rename memory tool metadata files -> sources (stripPartMetadata rewrites
  tool-part metadata.files assuming apply_patch records, mangling string[])
- read state instead of status for tool enabled checks; dedupe TUI helpers
  (errorMessage, shared route(), Locale.number, relativeTime)
- /memory UX: bare /memory opens a help modal driven by a structured
  command catalog in kilo-memory; /memory on|off become the canonical
  toggle verbs (enable/disable kept as quiet aliases); /memory status opens
  a clean overview dialog (root path, autosave, startup context, source
  counts, index size) instead of a toast; /memory show is the single full
  audit view (inspect removed)
2026-07-06 17:45:49 +02:00
Christiaan Arnoldus 75715088b1 fix(cli): restore Amazon Bedrock output by pinning @smithy/util-buffer-from
@smithy/util-buffer-from >=4.3.0 became a re-export shim of @smithy/core/serde.
Under the browser build condition, @smithy/core's serde exposes fromArrayBuffer
as Symbol.for("node-only"), so @smithy/util-utf8's toUtf8 throws inside the
Bedrock event-stream decoder, whose catch { break } silently ends the stream.
Every Bedrock request completed with empty output on HTTP 200.

Pin to 4.2.2 (last self-contained 4.x) so fromArrayBuffer stays a real function.
2026-07-06 14:02:57 +02:00
kilo-maintainer[bot] 4ed43ab7c5 release: v7.4.1 2026-07-03 17:10:11 +00:00
kilo-maintainer[bot] c78d44a143 release: v7.4.0 2026-07-03 14:40:55 +00:00
marius-kilocode 9066bac142 Merge remote-tracking branch 'origin/main' into caramel-turner
# Conflicts:
#	packages/opencode/src/session/llm.ts
2026-07-03 11:59:03 +02:00
Johnny Eric Amancio 394346247d feat(vscode): add soft max-cost nudge (#11832)
* feat(vscode): add soft max-cost nudge

* fix(vscode): add closeQuestion stub to StoryProviders mock

* fix(vscode): extract cost alert handler to stay under session.tsx max-lines

* fix(vscode): track active cost alerts to dismiss stale prompts on setting change

* fix(vscode): use if/return instead of ternary-with-comma in cost alert close

* fix(vscode): remove dead nudgeWaiters and resolveCostWaiters code

* fix(vscode): use inset box-shadow for warning tone to avoid layout changes

* fix(vscode): disable custom answer input on cost alert question
2026-07-02 12:36:13 +02:00
Jean du Plessis b2f9eb93ac chore: bump vite to 7.3.5 2026-07-02 10:51:02 +02:00
Johnny Eric Amancio b48570e93b feat(memory): add @kilocode/kilo-memory effect runtime layer (#11845)
* feat(memory): add @kilocode/kilo-memory effect runtime layer

* refactor(memory): drop dead defaultLayer alias

* chore: restore @kilocode/kilo-memory changeset from core

* fix(memory): isolate event sink failures and release per-session turn locks

- events: swallow+log host sink failures so best-effort event wiring never
  fails a memory op that already persisted (restores guard the port dropped)
- service/turn: drop the memoized turn lock once a session settles so the
  lock map no longer grows unbounded in a long-lived shared backend

* fix(memory): scope model-reported duplicate skips to claimed file/section

verifySkips() verified model-claimed duplicates against all stored items
regardless of scope. Add optional file/section to the skip schema, instruct
the model to report them for duplicate skips, and thread them into the
duplicate check so a cross-scope match downgrades to 'unsupported' instead
of confirming. Matches the scoping duplicateOps() already applies to adds.

* fix(memory): release per-root abort controllers and reject unscoped duplicate skips

- timers: ref-count the per-root AbortController and drop it when the last
  in-flight capture settles (released via an ensuring finalizer in capture),
  so the signals map no longer grows for every root a shared backend touches
- outcome/prompt: a 'duplicate' skip that names a file but no section can't be
  verified without risking a cross-section false confirm, so treat it as
  unverified; instruct the model to report both file and section

* fix(memory): only confirm duplicate skips that name the exact file+section

Extend the guard so any 'duplicate' skip missing either scope field — not just
section — is treated as unverified. A fully-unscoped claim could otherwise still
confirm against unrelated memory via fuzzy text matching. Confirm only when the
model pins the exact file+section; everything else downgrades to advisory.

* fix(memory): ref-count session turn locks instead of eager delete

Eager delete could hand a queued close() a fresh semaphore while a peer still
held the old one, reintroducing overlapping turn-close work. Ref-count holders
(queued acquirers included) and drop the entry only when the last holder
leaves; close() always releases its own holder and a deferred flush takes its
own turnLock/dropLock pair.
2026-07-01 14:48:32 +02:00
Johnny Eric Amancio 566e069532 fix(memory): add core project memory package (#11355) 2026-07-01 12:08:28 +02:00
kilo-maintainer[bot] 82da283d1d release: v7.3.63 2026-06-30 09:55:39 +00:00
marius-kilocode 53baaed119 Merge remote-tracking branch 'origin/main' into honored-sing 2026-06-23 12:14:54 +02:00
kilo-maintainer[bot] 0f55066dc7 release: v7.3.54 2026-06-23 01:51:02 +00:00
marius-kilocode c55e804c1c refactor(sandbox): centralize agent capability enforcement 2026-06-22 20:02:38 +02:00
kilo-maintainer[bot] 90643d2325 release: v7.3.53 2026-06-22 17:12:51 +00:00
kilo-maintainer[bot] e3da86822f release: v7.3.52 2026-06-22 09:15:48 +00:00
Imanol Maiztegui 1961f6363f Merge pull request #11450 from Kilo-Org/imanolmaiztegui/kilo-opencode-v1.15.13
OpenCode v1.15.13
2026-06-22 10:52:59 +02:00
kilo-maintainer[bot] 2e89ea4027 release: v7.3.51 2026-06-22 08:45:30 +00:00
kilo-maintainer[bot] 533c2017fa release: v7.3.50 2026-06-19 18:12:57 +00:00
Imanol Maiztegui 0ab78cb8bb fix(core): correct listener routes, test expectations, and comment markers post-merge
Add ptyConnectApiRoutes to createListenerRoutes so PTY WebSocket
connections work through the Kilo listener layer. Bump
gitlab-ai-provider to 6.8.0 and drop it from the supply-chain
quarantine exclusion list.

Realign kilocode_change comment markers to their correct lines across
tui-schema, session.sql, and several test/story files. Update ACP
auth tests to expect Kilo-branded agent name and method IDs, fix
httpapi-ui test to assert 404 for the disabled fallback UI proxy,
and point the OAuth branding test at the relocated codex plugin path.

Add new test coverage for the ACP Agent interface contract and
primaryWorktree resolution across normal repos, linked worktrees,
submodules, and paths with spaces. Refresh TUI inline-tool-wrap
snapshots and session recording fixtures to reflect current branding.
2026-06-19 13:17:38 +02:00
Imanol Maiztegui 351c2e4fc7 chore(monorepo): remove stats package and align upstream skip rules
Drop the entire packages/stats workspace (app, core, server) and add
packages/stats/** to the upstream merge skip list so future syncs no
longer pull it in. Update skip-files tests to cover the new glob.

Dependency changes for opencode v1.15.13:
- add ws 8.21.0 and @types/ws for WebSocket transport
- bump @lydell/node-pty to 1.2.0-beta.12
- add proxy-env and googleapis source links
2026-06-19 11:01:30 +02:00
marius-kilocode 2dcd90e176 test(agent-manager): cover rendered tool identity 2026-06-18 18:47:04 +02:00
kilo-maintainer[bot] b134c1c18f release: v7.3.49 2026-06-18 12:00:41 +00:00
kilo-maintainer[bot] 6187a557ba release: v7.3.48 2026-06-18 11:39:42 +00:00
Imanol Maiztegui b46a40d537 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.15.9 2026-06-18 13:09:27 +02:00
Josh Lambert 89b1829199 fix(cli): declare console diff dependency 2026-06-17 16:33:08 -04:00
Imanol Maiztegui abdef9a7ee feat(opencode): add tool metadata buffering and migrate virtua to v0.42.3
Introduce a `metadata` method on SessionProcessor.Handle that buffers
metadata emitted before tool-call registration, then applies it on the
running transition. This decouples metadata emission timing from
tool-call lifecycle.

Downgrade virtua from 0.49.1 to 0.42.3 and migrate the virtualizer API:
- Replace `findItemIndex(scrollOffset)` with `findStartIndex()`
- Replace `bufferSize` prop with `overscan` (count-based)

Additional changes:
- Change Permission.reply return type from Promise<boolean> to Promise<void>
- Make Ruleset type readonly and remove unnecessary array spreads
- Update nvidia provider headers to reference Kilo branding
- Reorder SDK event type definitions for installation events
- Reduce promise facade allowlist in check script
2026-06-17 16:41:43 +02:00
Imanol Maiztegui 27d19a8deb Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.15.9 2026-06-17 14:03:20 +02:00
markijbema e38c53e6e7 chore(cli): remove unused @hono/zod-validator dependency
Nothing imports @hono/zod-validator anywhere in the repo, and its peer dependency hono was removed in #10993, leaving an unmet peer. opencode was the only consumer, so the root catalog entry is dropped too.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-06-17 08:46:49 +00:00
Imanol Maiztegui b37a546450 resolve merge conflicts 2026-06-17 10:42:43 +02:00
markijbema dbc3d2e884 chore: regenerate dependency lockfile
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-06-17 09:29:06 +02:00
Mark IJbema d82649a073 Merge branch 'main' into chore/remove-unused-deps 2026-06-16 13:36:04 +02:00
Marius 884c54f4f8 Merge pull request #11098 from Kilo-Org/feat/vscode-attention-notifications
feat(vscode): add attention sounds
2026-06-15 16:12:12 +02:00
Z User f52ffab517 fix: restore htmlparser2 — accidentally dropped during rebase conflict
htmlparser2 was added by upstream but lost during rebase conflict
resolution in packages/opencode/package.json. It is actively
imported at packages/opencode/src/tool/webfetch.ts:3
2026-06-15 14:09:35 +00:00
Z User b63d43cf81 chore: update bun.lock after rebase 2026-06-15 13:51:06 +00:00
Z User 7753659911 chore: remove 39 unused dependencies across monorepo
Removed unused packages identified via depcheck static analysis
and verified with full codebase grep to confirm zero usage.

Root (5):
- @aws-sdk/client-s3, heap-snapshot-toolkit, @morphllm/morphsdk
- @actions/artifact, sst

packages/core (1):
- @types/semver

packages/ui (6):
- @shikijs/transformers, @solid-primitives/bounds, luxon
- marked-katex-extension, marked-shiki, @types/luxon

packages/kilo-gateway (1):
- @kilocode/sdk

packages/kilo-ui (3):
- @storybook/addon-a11y, @storybook/addon-docs, @storybook/addon-themes

packages/kilo-vscode (3):
- dotenv, @storybook/addon-a11y, @storybook/addon-docs

packages/kilo-console (1):
- @opencode-ai/ui

packages/opencode (20):
- @hono/node-server, @hono/node-ws, @hono/standard-validator
- @openauthjs/openauth, partial-json, zod-to-json-schema
- @standard-schema/spec, @babel/core, @types/babel__core
- @npmcli/config, @opentelemetry/context-async-hooks
- @opentelemetry/exporter-trace-otlp-http, @pierre/diffs
- chokidar, glob, hono, hono-openapi, minimatch
- rotating-file-stream, xdg-basedir, @types/npmcli__arborist

Result: 264 packages pruned from node_modules (3962 -> 3698)
2026-06-15 13:50:34 +00:00
Imanol Maiztegui 5b9e33cfef refactor: kilo compat for v1.15.9 2026-06-15 14:48:05 +02:00
marius-kilocode a4b967662b refactor(vscode): align sounds with opencode attention 2026-06-15 14:13:57 +02:00
kilo-maintainer[bot] 5fab7b38d7 release: v7.3.46 2026-06-15 10:14:38 +00:00
marius-kilocode 6880928994 fix: preserve latest main state after merge 2026-06-12 20:02:44 +02:00
marius-kilocode 941accc2fc Merge origin/main into OpenCode v1.15.4 2026-06-12 16:10:38 +02:00
marius-kilocode b75af0de88 fix(cli): recover Vercel AI SDK provider upgrades 2026-06-11 14:44:04 +02:00
marius-kilocode 6ae28b5504 Merge branch 'main' into review/upstream-11090 2026-06-11 14:18:08 +02:00
Josh Lambert 3f9c025bbc fix(gateway): prevent duplicate streamed tool calls 2026-06-10 17:05:06 -04:00
Colin McDonnell 34f94e3b16 fix: bump @openrouter/ai-sdk-provider to 2.9.0 (#30800) 2026-06-10 17:02:32 -04:00
marius-kilocode 72a11b02af resolve merge conflicts 2026-06-10 20:03:42 +02:00
marius-kilocode 00554bd24c refactor: kilo compat for v1.15.4 2026-06-10 17:38:09 +02:00
Marius a17c167c03 Merge pull request #11031 from Kilo-Org/marius-kilocode/kilo-opencode-v1.14.51
OpenCode v1.14.51
2026-06-10 14:27:20 +02:00
kilo-maintainer[bot] a7a18b2e25 release: v7.3.42 2026-06-10 12:26:35 +00:00
marius-kilocode d6cde9fc4a Merge remote-tracking branch 'origin/main' into marius-kilocode/kilo-opencode-v1.14.51 2026-06-10 10:49:54 +02:00
kilo-maintainer[bot] adb8d3e31e release: v7.3.41 2026-06-09 14:27:34 +00:00