Commit Graph

820 Commits

Author SHA1 Message Date
Catriel Müller 17f5619c59 refactor: flag intel mac 2026-06-05 17:57:39 -03:00
Catriel Müller f7970c99ed fix(cli): prevent Bun ESM splitter crash and Alpine musl validation
Two independent release validation failures introduced by kilo-opencode-v1.14.33 (morphsdk) and the new all-arch validation jobs.

**@morphllm/morphsdk pre-split ESM (intermittent SyntaxError on Windows)**

@morphllm/morphsdk/tools/warp-grep/client ships as a 805-byte ESM barrel that
re-exports from 13 internal chunk-*.js files (52 chunks total). When Bun 1.3.14
bundles the CLI with splitting+minify enabled, merging these external pre-split
chunks into its own chunk graph intermittently produces invalid minified ESM:

  SyntaxError: Exported binding 'G9' needs to refer to a top-level declared variable.

Non-deterministic because Bun's parallel bundler uses different orderings per run;
same build sometimes succeeds, sometimes fails on Windows x64.

Fix: load morphsdk via createRequire (forces CJS bundle, client.cjs 2292 lines,
self-contained) instead of the ESM barrel. Wrapper lives in kilocode/compat/ with
a comment explaining how to detect and fix this pattern for future third-party deps.

Scanned all 40+ third-party packages imported by packages/opencode/src — morphsdk
is the only one with pre-split ESM; all others ship single-file ESM or CJS only.

**Alpine musl validation (libstdc++/libgcc missing)**

Bun's musl target (bun-linux-{arch}-musl) is not fully static — it links against
libstdc++.so.6 and libgcc_s.so.1 (GCC C++ runtime). Alpine base does not ship
these by default. The fix adds apk add --no-cache libstdc++ libgcc at the start of
the Alpine Docker smoke test, matching the runtime requirement that any Alpine user
of the CLI would also need.
2026-06-05 15:10:16 -03:00
Catriel Müller 78117d1a25 fix: validate CLI models snapshot before release builds 2026-06-05 09:28:40 -03:00
Josh Lambert 254b070bb0 ci: limit CLI artifact validation to version 2026-06-04 22:55:22 -04:00
Josh Lambert 8295ab3096 ci: validate Linux CLI release artifacts 2026-06-04 22:52:27 -04:00
Josh Lambert 6cab5f18e7 fix(cli): isolate release target builds 2026-06-04 22:40:06 -04:00
Imanol Maiztegui 57627c2e80 ci(codeql): split Kotlin analysis into dedicated workflow (#10869)
Extract java-kotlin language analysis from the shared CodeQL Advanced
workflow into a dedicated codeql-kotlin.yml workflow. This allows the
Kotlin analysis (which requires Java, Gradle, and a manual build) to
run independently with path filtering on packages/kilo-jetbrains,
reducing unnecessary CI runs for unrelated changes.

- Add new codeql-kotlin.yml with path-scoped triggers
- Remove java-kotlin from the matrix in codeql.yml
- Simplify codeql.yml by removing conditional Java/Gradle setup steps
- Register codeql-kotlin.yml in check-workflows.ts active set
2026-06-03 10:53:05 -04:00
marius-kilocode a0c91eb07a fix(ci): restore workflow change annotation 2026-06-03 13:25:36 +02:00
marius-kilocode 02f226d418 chore(ci): remove workflow change marker 2026-06-03 13:23:24 +02:00
marius-kilocode 99407ef83b fix(ci): cap stalled unit jobs at 45 minutes 2026-06-03 13:18:18 +02:00
Emilie Lima Schario 2f7f23deac Add scanning (#10799)
* Add scanning

* ci: adjust CodeQL scanning for the repo

* ci: add bun in kotlin setup

---------

Co-authored-by: Johnny Amancio <johnnyeric@gmail.com>
2026-06-03 12:05:39 +02:00
Igor Šćekić 8aaa62c794 Session export capture (#10611)
* feat(session-export): scaffold module with config constants

* feat(session-export): add zstd compression wrapper

* feat(session-export): event and envelope type definitions

* feat(session-export): eligibility check with kill-switch

* feat(session-export): org signal collector with auth resolver

* feat(session-export): worker SQLite schema and storage helpers

* feat(session-export): content-addressed chunker with zstd dedup

* feat(session-export): client-side light scrubber

* feat(session-export): IPC contract and inbox with back-pressure

* feat(session-export): persist scrubbed events with chunked payloads

* feat(session-export): worker entry point with inbox drain loop

* feat(session-export): main-thread capture module

* feat(session-export): workspace baseline and delta fibers

* feat(session-export): sync subscriber and tool io chunking

* feat(session-export): bootstrap wiring and compaction hook

* feat(session-export): wire capture hooks into sessions

* feat(session-export): uploader and buffer cap

* chore(session-export): annotate shared session hooks

* changeset(session-export): add release note

* fix(session-export): keep bootstrap non-blocking without instance context

* feat(session-export): respawn worker after failures

* test(session-export): add performance budget assertions

* test(session-export): add worker end-to-end smoke test

* fix(session-export): strip identity and high-risk baseline paths

* test(session-export): gate perf assertions for stable sweeps

* fix(session-export): bundle worker in single-file builds

* fix(session-export): make capture envelopes cloneable

* fix(session-export): drain worker on CLI shutdown

* feat(session-export): capture workspace baseline and deltas

* fix(session-export): preserve request metadata

* test(session-export): cover request metadata capture

* feat(cli): send indexed session export batches

* feat(cli): authorize session export uploads

* fix(cli): flush session export shutdown uploads

* feat(cli): optimize session export replay payloads

* fix(cli): include session export surface metadata

* fix(session-export): decrement chunk refs after upload

decRefChunks was never called, so chunk ref_count stayed at 1 (or
higher with dedup) and DELETE FROM chunk WHERE ref_count <= 0 never
matched. Chunks accumulated in the local SQLite buffer until the 50 GB
cap. Call decRefChunks alongside markUploaded so deleteUploaded can
reclaim the rows.

* fix(session-export): add periodic uploader flush timer

flushIntervalMs and retryBackoffMaxMs were both defined in config and
neither was referenced anywhere; scheduleFlush only ran on inbound
events or reconnect. After a 5xx or network failure the row was backed
off for 1 s, but if no further event arrived the retry never fired and
the events stranded until the CLI restarted. Drive a periodic flush
from a setInterval, unref the handle so it doesn't pin the process, and
clear it from a new dispose() hook the worker calls on shutdown.

* fix(session-export): stop emitting absolute workspace root in baseline

CaptureMetadata.root was the literal absolute filesystem path
(/Users/<name>/Projects/<repo>), shipped in every
workspace_baseline_completed event and not stripped by handlers'
identity filter. The field was set but never read anywhere downstream
— file paths in the baseline are already relative, so the root added
no replay signal. Remove the field outright.

* fix(session-export): cap pendingEvents result set

The SELECT had no LIMIT clause, so under a backlog (network outage,
crashed receiver) it would materialize the full pending table into a
JavaScript array before the byte-limit truncation applied. With a
50 GB buffer cap that is hundreds of MB of heap inside the worker per
drain. Add LIMIT 500 — the drain loop already re-queries until empty,
so no events are missed.

* fix(session-export): exponential retry backoff up to retryBackoffMaxMs

Both the 5xx and network-error branches always retried after the floor
delay regardless of how many attempts had already failed, and
retryBackoffMaxMs was unreferenced. During a sustained outage every
session re-tried at roughly 1 Hz against the dead receiver. Surface
upload_attempts on EventRow and compute the next delay as
min * 2^attempts capped at max.

* fix(session-export): evict superseded workspace snapshots on remember

createWorkspaceProvider retained every captured snapshot — in-memory
and inside the persisted state file — even after the session moved on
to a newer one. For a 1k-file repo over a 100-turn session that is
~2 GB of unreachable heap plus a state file that grows monotonically.
Drop the previous snapshot for the session on remember() when no other
session still references it.

* fix(session-export): anchor aws_secret_key scrubber to key name

The bare 40-char base64 pattern matched every 40-character hex string,
including all git commit SHAs. Tool outputs, diffs, and conversation
messages were silently rewritten as <<REDACTED:aws_secret_key>>,
destroying lineage information in training data. Require the key name
context — naked secrets in unstructured text are rare and the .env /
.aws/credentials high-risk path strip already covers the common case.

* fix(session-export): preserve root linkage in SyncSubscriber events

SyncSubscriber hardcoded rootSessionId = sessionId on every tool,
permission, and feedback event, so sub-agent sessions lost their root
linkage and a future training pipeline could not reconstruct the
agent topology from these side-channel events. Expose the rootSessionId
mapping from Capture and plumb it through the same pattern as
getTurnId.

* fix(session-export): atomic chunk GC after upload

markUploaded + decRefChunks + deleteUploaded were three separate SQL
statements; a crash between markUploaded and decRefChunks would leave
events flagged uploaded (never retried) and chunks with stale
ref_count (never reclaimed by deleteUploaded). Bundle the three calls
into a single transactional commitUploaded helper so either all three
land or none of them do.

* fix(session-export): wait on transient sqlite locks

* fix(session-export): snapshot current workspace directory

* fix(cli): preserve Kilo model export metadata

* fix(cli): send anon id for session export

* fix(cli): fallback to telemetry anon id

* chore(cli): annotate session export config test

* chore: remove session export docs

* fix(cli): harden session export uploads

* fix(cli): preserve stream lifecycle for session export

* fix(kilo-docs): exclude session export ingest link

* fix(cli): restrict session export workspace sync to git repos

* chore: remove session export changeset

* fix(cli): tighten session export payload types

* fix(cli): type session export model payloads

* fix(cli): simplify session export cleanup

* fix(cli): avoid session export shutdown race

* refactor(cli): use drizzle for session export storage

* fix(cli): finalize session export sqlite statements

* fix(cli): link compaction exports to root sessions

* fix(cli): stop exporting raw stream parts

* fix(cli): prune stale workspace snapshots

* refactor(cli): clarify chunk ref counting

* test(cli): clarify dropped upload assertions

* ci: avoid visual path filter action failure

* fix(cli): preserve in-flight workspace snapshots

* fix(cli): stop uploading baseline start events

* fix(cli): trim redundant export metadata

* fix(cli): trim workspace export bookkeeping

* fix(cli): fold terminal outcome into tool exports

* fix(cli): dedupe request context in export batches

* fix(cli): normalize compaction export payloads

* fix(cli): avoid duplicate tool result exports

* test(cli): align session export expectations

* fix(cli): run secretlint during session export scrubbing

* fix(cli): keep retried export batches contiguous

* fix(cli): include agent info in session exports

* fix(cli): flush pending session exports on serve startup

* fix(cli): drop exports when scrubbing fails

* fix(cli): narrow secretlint value extraction

* fix(cli): limit exported agent info

* test(cli): remove brittle agent export source assertion

* fix(cli): ignore corrupt session export workspace state

* fix(cli): keep session export close best effort

* fix(cli): avoid following session export symlinks

* fix(cli): preserve session export chunk ref counts

* fix(cli): retry transient session export uploads

* fix(cli): validate session export ingest endpoint

* fix(cli): tolerate missing export token details

* fix(cli): fail closed on session export org lookup

* fix(cli): decode session export permission replies

* fix(cli): finalize session export on stream close

* fix(cli): bound session export baseline timeout

* fix(cli): avoid persisting workspace file contents

* fix(cli): bound workspace snapshot capture

* fix(cli): validate session export worker messages

* fix(cli): revoke stale session export eligibility

* fix(cli): scope session export workspaces

* fix(cli): extend session export shutdown flush

* fix(cli): infer free Kilo models for export

* fix(cli): avoid duplicate chunk refs

* fix(cli): throttle session export uploads

* fix(cli): harden session export capture

* feat: disclose free model data collection (#10767)

* feat: disclose free model data collection

* chore(cli): document free model footer sorting

* fix(vscode): add free model data translations

* fix: simplify free model data label

* fix: simplify data collection badges

* fix: remove duplicate model info disclosure

* fix: restore composer data tooltip

* fix: align jetbrains data collection indicator

* fix: align free model data indicators

* fix(vscode): show data collection in model preview

* fix: limit data indicators to kilo gateway

* test(cli): relax prompt cancel timeout

* test(cli): annotate prompt cancel timeout

* test(cli): classify prompt queue runtime test

* fix(cli): defer session export startup
2026-06-02 13:58:42 +00:00
marius-kilocode 0f271a39d7 resolve merge conflicts 2026-06-01 15:20:54 +02:00
marius-kilocode 7cc6080646 refactor: kilo compat for v1.14.42 2026-06-01 12:51:31 +02:00
kirillk fb6e241b97 fix(jetbrains): use gradle release metadata 2026-05-29 12:14:43 -04:00
kirillk dfe3961087 fix(jetbrains): preserve plugin package version 2026-05-29 11:45:33 -04:00
Marius bc2e7942f1 Merge pull request #10680 from Kilo-Org/test-vscode-a11y-coverage-10673
test(vscode): enforce scoped webview accessibility coverage
2026-05-29 14:44:24 +02:00
kirillk 9a6d4d8595 fix(jetbrains): harden release publishing 2026-05-28 16:21:43 -04:00
kirillk 4c65bf5751 Merge remote-tracking branch 'origin/main' into oxidized-glasses 2026-05-28 16:00:48 -04:00
marius-kilocode ffad65db8e fix(vscode): address accessibility coverage feedback 2026-05-28 17:01:56 +02:00
Josh Lambert 3823862d53 fix: restore smoke-test dataset filtering 2026-05-28 10:48:05 -04:00
marius-kilocode 63f39f6ae4 test(vscode): enforce scoped webview accessibility coverage 2026-05-28 16:47:54 +02:00
marius-kilocode 2cb36f9275 ci(cli): prevent new shared Effect promise facades 2026-05-28 14:45:24 +02:00
kirillk 3b58e05e70 ci(jetbrains): lock release tag before publish 2026-05-27 13:01:11 -04:00
kirillk beb8a406f0 fix(jetbrains): address release workflow review 2026-05-27 12:17:49 -04:00
kirillk a411ba9321 ci(jetbrains): add release PR publishing flow 2026-05-27 12:07:12 -04:00
kirillk 2d1ff2fd50 ci: parallelize JetBrains checks 2026-05-26 11:14:51 -04:00
Johnny Eric Amancio b123241ec3 docs: add details about contributor ownership and mass creation of PRs/Issues (#10574) 2026-05-26 10:16:18 +00:00
Johnny Eric Amancio 2fd94da76c docs: clarify PR review readiness expectations (#10562) 2026-05-26 11:07:51 +02:00
Kirill Kalishev e444705a61 Merge pull request #10539 from Kilo-Org/indigo-peak
ci(jetbrains): integrate JetBrains typecheck and tests into repo-wide checks
2026-05-25 13:30:00 -04:00
Johnny Eric Amancio 53a614554c docs: Improve documentation and pr template to request testing evidence (#10514)
* docs: Improve documentation and pr template to request testing evidence

* Apply suggestion from @markijbema

Co-authored-by: Mark IJbema <mark@kilocode.ai>

* docs: Remove command evidence section

---------

Co-authored-by: Mark IJbema <mark@kilocode.ai>
2026-05-25 15:39:06 +00:00
kirillk e627d581c1 ci(jetbrains): warm up Gradle wrapper before turbo test:ci on Linux
On a fresh CI runner, multiple Turbo tasks starting in parallel can race
to extract the Gradle wrapper zip, producing ClosedFileSystemException.
Run ./gradlew --version before turbo test:ci to ensure the wrapper is
fully extracted before any parallel task touches it.
2026-05-25 09:31:13 -04:00
Kirill Kalishev 65733baa01 Merge pull request #10463 from Kilo-Org/panoramic-existence
fix(jetbrains): fix build/tests after OpenCode merge, document Java 21 setup
2026-05-21 10:16:31 -04:00
Imanol Maiztegui f7816a9eeb refactor: kilo compat for v1.14.41 2026-05-21 14:48:36 +02:00
Catriel Müller d42e99d784 refactor: implement OIDC NPM publish 2026-05-21 08:53:28 -03:00
kirillk c334e5cc11 fix(jetbrains): include JetBrains in repo typecheck/tests and fix serialization failures
Re-enable @kilocode/kilo-jetbrains in bun turbo typecheck (package.json) and
bun turbo test:ci (test.yml). Add Java 21 setup to the typecheck workflow so
Gradle can run. Fix three serialization test failures:

- KiloProfile200Response with null balance / with organizations: Effect's HttpApi
  OpenAPI generator emits balance and currentOrgId as non-nullable even though
  the server schema uses Schema.NullOr. Add fixProfileNullable step to
  OpenApiSpecNormalizer that wraps these fields in anyOf: [{schema}, {type:null}]
  before Kotlin client generation, plus regression tests.

- model limit context and output deserialize with large values (NoSuchMethodError):
  compileTestKotlin was not invalidated when the generated API type changed, leaving
  stale bytecode referencing the old ProviderConfigModelsValueAnyOfLimit class.
  Wire compileTestKotlin -> fixGeneratedApi in backend/build.gradle.kts so API
  regeneration always invalidates test compilation.
2026-05-20 16:03:15 -04:00
Imanol Maiztegui 055a932c66 Merge remote-tracking branch 'origin/main' into imanolmaiztegui/kilo-opencode-v1.14.34 2026-05-20 10:28:01 +02:00
Imanol Maiztegui 39affcc140 ci: skip jetbrains tests (#10433) 2026-05-20 08:26:43 +00:00
Imanol Maiztegui 22486c90eb refactor(repo): rebrand to kilo and improve issue triage configuration
Replace legacy "opencode" references with "kilo" in CLI output,
API metadata, SDK error messages, and documentation. Add automatic
labels to GitHub issue templates, expand triage agent with jetbrains
and extension teams, and update the github-triage tool to target the
Kilo-Org/kilocode repository.
2026-05-20 10:05:31 +02:00
Imanol Maiztegui f9679c4771 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.14.34 2026-05-19 15:56:46 +02:00
Mark IJbema 523e3d8f03 chore: remove upstream vscode sdk 2026-05-19 10:50:27 +02:00
Mark IJbema 4de0e30e91 Merge pull request #10355 from Kilo-Org/mark/forbid-opncd-share-url
chore(vscode): forbid legacy opncd.ai/s/ share URL
2026-05-18 17:17:00 +02:00
Mark IJbema eaabc99625 fix: add kilocode_change markers and update nvidia-headers test for rebrand
- Adds 'new file' marker to check-forbidden-strings workflow
- Marks the SKIP_FILES addition in extract-source-links.ts
- Updates nvidia-headers test to assert the new kilo.ai/Kilo Code values
2026-05-18 17:00:05 +02:00
Mark IJbema 3aba363c4a ci: move forbidden-strings check to its own workflow
Runs on every PR instead of only when VS Code paths change, so a
hardcoded forbidden URL in any package can't bypass the guard.
2026-05-18 14:38:57 +02:00
kiloconnect[bot] 7992aadf34 chore(scripts): extract forbidden string check into dedicated script
Replace the inline opncd.ai/s/ grep added to check-kilocode-change with a standalone script/check-forbidden-strings.ts. Wired into test-vscode.yml as a separate step alongside the existing marker check.
2026-05-18 10:47:28 +00:00
Kirill Kalishev 8a212afbdd Merge branch 'main' into unleashed-romano 2026-05-15 10:49:23 -04:00
kirillk 2150c68244 fix: annotate Java setup, fix gradlew.bat path, fix flaky test assertions
- Add kilocode_change markers around Java 21 setup in test.yml (required
  by annotation checker for .github/** changes)
- Fix test-ci.ts: use ./gradlew.bat (not bare gradlew.bat) on Windows so
  bun's shell can locate and execute the wrapper script
- Fix HistorySessionActionsTest: delete two items races — use waitFor
  instead of fixed-duration flush so both coroutine deletes complete before
  asserting; sort IDs for ordering-independent comparison
2026-05-15 09:47:23 -04:00
kirillk 78c31d4a74 fix: add Java 21 setup for Windows CI and fix SessionRecoveryTest assertions
- Add setup-java@v4 (temurin 21) step to test.yml so Windows runner has
  the JDK required for Gradle Kotlin compilation
- Fix SessionRecoveryTest: existing-session flow (controller("ses_test"))
  calls showSession() after history load, setting showSession=true;
  update show=false -> show=true in 7 assertSession calls that tested
  this flow
2026-05-15 09:29:28 -04:00
Imanol Maiztegui e68fd6781d resolve merge conflicts 2026-05-15 13:13:17 +02:00
marius-kilocode 6f24f78e51 ci: retry Windows Node setup in tests 2026-05-15 10:06:32 +02:00