Commit Graph
234 Commits
Author SHA1 Message Date
kirillk b7672ae502 fix: report why a provider failed to load instead of hiding it
When an organization-scoped Kilo token is rejected with a 401, the model
catalog comes back empty, which removes the provider from `all` in the
/provider response. `pickBy` can only filter existing keys, so the
`failedSet.has(id)` retention clause was unreachable: clients received
`failed: ["kilo"]` with no row to attach a reason to, and the picker just
showed "No results found" with the cause visible only in the logs.

Add a typed `failures` array to the provider list contract and emit a
models-less placeholder for any failed provider missing from `all`, so
the CLI, TUI, and VS Code can name the cause and offer re-authentication.
The placeholder is synthetic and never sourced from the raw catalog, so
the public models.dev model list still cannot leak into an org context,
and it respects enabled_providers/disabled_providers.
2026-10-08 16:05:38 -04:00
kirillk 6d3d87fef6 test(cli): expect InvalidRequestError for a rejected attachment
These two run tests asserted the BadRequest tag that the prompt route used to
return for an unusable image attachment. This branch replaced that empty 400
with InvalidRequestError carrying a readable reason, so the assertions failed
in CI (unit linux 1/2 and windows 3/6; the unit/test aggregate jobs failed only
because of that shard).

Update the expectations to the new tag and assert the readable reason, which is
the actual improvement. Also correct the stale fixture comments: the attachment
precheck now rejects these bytes as undecodable before the base64 size cap is
reached, so the reported reason is the decode failure rather than the size
limit.

The tests' intent is unchanged -- a prompt request that fails before the model
runs reports the real error once, without the empty-output diagnostic.
2026-10-05 16:59:47 -04:00
marius-kilocode 154a8427c5 fix(cli): disable session PR linking on non-CLI backends 2026-09-30 11:45:52 +02:00
Igor Šćekić fbf32ed8db test(cli): refresh help snapshot for session-scoped pr commands 2026-09-29 06:15:33 +00:00
Igor Šćekić 9cc0a9158f fix(sessions): link a pull request to a session only on its own evidence 2026-09-29 05:32:54 +00:00
Igor Šćekić 03eacb476e Merge pull request #14547 from Kilo-Org/kwf/cli-scheduled-session-state-1f5e
fix(cli): report a scheduled session status with its wake time
2026-09-28 17:14:26 +02:00
Igor Šćekić 7b4cb66166 fix(cli): count a cron wait as scheduled and print the wake time locally
Wakeup.scheduled derived the per-session wake time from the one-shot store
only, so a session asleep on a recurring cron task reported idle with no
scheduledAt. Fold cronEntries into the same derivation, which keeps the
memory-only read on the status path. The session list reads persisted data
in its own process, so it now combines Wakeup.list and Wakeup.cronList.

The status cell printed the raw ISO-8601 wake time beside a local Updated
cell. Format both through Locale.todayTimeOrDateTime. JSON keeps ISO-8601,
which the mobile client parses.

Evidence on the touched paths: status for a cron-only session
{"type":"scheduled","scheduledAt":"2026-09-28T14:00:48.755Z"}; one-shot
only -> 2026-09-28T14:27:21.256Z; both stores -> the earlier cron time,
2026-09-28T14:02:21.256Z; no wake source -> idle with no scheduledAt;
session list row "scheduled 4:56 PM" with the ISO in --format json.
2026-09-28 15:58:01 +02:00
matt wilkie ff087914ff test(cli): annotate duration check change with kilocode_change marker 2026-09-27 04:19:27 -07:00
matt wilkie 5e2e522c83 test(cli): widen unknown-model duration check for loaded CI runners 2026-09-27 04:09:45 -07:00
Igor Šćekić 1b09c194b7 fix(cli): report a scheduled session status with its wake time
Surface: the kilo CLI, session status.

A session that is scheduled to wake later, and does nothing now, must report a distinct `scheduled` state. Today it reports `idle`, so a client cannot tell a sleeping session from a free one.

Requirements:
- Report the status with the exact type value `scheduled`.
- Report `scheduled` only when a wake is due in the future AND no turn runs now.
- Clear it the moment the session starts work, and when the wake is cancelled.
- Carry the wake time in the same status payload as an ISO-8601 string field named `scheduledAt`.
- Carry `scheduledAt` only with the `scheduled` type.
- The existing statuses (`idle`, `busy`, and the rest) must not change.
- The session list shows the state and the wake time.

The mobile app in the `cloud` repository reads this status on the same wire. A companion item renders `scheduled` and `scheduledAt`. Keep those two names exact.

Proof: quote the status payload the CLI emits for a scheduled session, the payload after the session wakes, and the session list line. Copy the same three lines into the pull request body.
2026-09-24 20:11:04 +00:00
Igor Šćekić 3fbb454a4c feat(cli): link sessions to pull requests via tool and remote check (#14315)
https://github.com/Kilo-Org/kilocode/pull/14315
2026-09-22 14:14:46 +02:00
marius-kilocode 2129ab2257 Merge remote-tracking branch 'origin/main' into johnnyeric/kilo-opencode-v1.18.20
# Conflicts:
#	bun.lock
#	packages/opencode/package.json
#	packages/opencode/src/cli/cmd/run.ts
#	packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts
#	packages/sdk/js/script/build.ts
2026-09-21 15:32:05 +02:00
marius-kilocode 9f45df567e fix: explain sandbox escalation prompts accurately 2026-09-17 10:49:48 +02:00
marius-kilocode 981dde6e88 Merge origin/main into remove-unwanted-feature 2026-09-08 10:37:53 +02:00
marius-kilocode d5a919f11b Merge origin/main into remove-unwanted-feature 2026-09-08 10:35:37 +02:00
Emergency Self-Construct 627501673a fix(cli): list sessions across all projects instead of crashing 2026-09-07 18:52:24 +00:00
Igor ŠćekićandMarius c5b6ccf7d9 fix(opencode): exit nonzero when run produces no assistant message (#13832)
Surface: the CLI (packages/opencode).

`kilo run` exits 0 when the model returns no assistant message, so a caller cannot tell an empty run from a successful one. Reproduce first on a live CLI build: force a run that produces no assistant message and read its exit code. If it already exits non-zero, stop with the evidence and no code change. If it does not, exit non-zero with a clear stderr line, leave the exit code of a normal run unchanged, add a test beside the existing run tests, and show both exit codes in the PR body.

Co-authored-by: Marius <marius@kilocode.ai>
2026-09-07 14:49:18 +02:00
marius-kilocode b5cf426158 fix(cli): remove nonfunctional interactive terminal tool 2026-09-04 15:10:46 +02:00
Igor Šćekić 86c1928c4a fix(cli): bound the piped-stdin wait in kilo run (#13763)
* Repro script: headless boot-hang loop with hung-run debug log (kwf fix-a-bug-in-the-kilocode-cl-3db9/s1)

* Bound the piped-stdin read when the prompt comes from argv; regression tests; live proof (kwf fix-a-bug-in-the-kilocode-cl-3db9/s2)

* Repair delivery gaps: annotation markers, changeset, live-proof evidence (kwf fix-a-bug-in-the-kilocode-cl-3db9/c1)

* fix: address-the-automated-review-f271 patch delivery

* fix: address-the-automated-review-7807 patch delivery

* fix: address-the-automated-review-82a7 patch delivery
2026-09-04 13:21:52 +02:00
Johnny Eric Amancio 6a7d6bc002 resolve merge conflicts 2026-08-27 15:13:58 +02:00
Johnny Eric Amancio 9563af96a0 refactor: kilo compat for v1.18.20 2026-08-27 13:50:27 +02:00
Evgeny Shurakov 017410bf6f fix(cli): accept JWT share tokens when importing sessions (#13183) 2026-08-18 11:43:31 +02:00
marius-kilocode a066d0f983 fix(permission): cover tui sandbox escalation prompt 2026-08-17 15:42:47 +02:00
Igor Šćekić 90a93a7aa2 feat(opencode): link sessions to their pull request (#13137)
* feat(opencode): add PR link detect and parse helpers

detectPrLink runs gh pr view, parsePrUrl accepts GitHub and GitLab PR
URLs, and a Storage helper holds the manual override.

* feat(opencode): add kilo pr link, unlink, and status commands

kilo pr becomes a parent command with checkout preserved. link and
unlink write the Storage override; the next heartbeat persists it.

* feat(opencode): advertise prLink on the heartbeat and ingest it

getSessions resolves the Storage override, cleared, or detected link,
puts prLink on the heartbeat, and syncs the session_pr_link item.

* fix(opencode): encode worktree in pr link override storage key

The manual override key used the raw absolute worktree path. Storage
builds the file with path.join, so a Windows drive colon made an invalid
filename and kilo pr link failed. Encode the worktree so the key is one
valid path segment on both platforms.

* test(opencode): cover kilo pr status outputs

Extract the status handler body so it is testable, then assert the four
outputs: stored link, cleared, detected, and no link. Split captured
output on os.EOL so the test passes on Windows.

* refactor(opencode): remove dead pr-link code found in simplify pass

detectPrLink now reuses parsePrUrl instead of hand-parsing the URL and
number, drop the dead github.com special case, and inline the
prLinkTripleKey helper.

* fix(opencode): clear pr-link dedupe map on session delete

* docs(kilo-docs): regenerate CLI reference for kilo pr subcommands

* chore: add session-pr-link changeset and bump facade allowlist
2026-08-16 09:33:14 +01:00
Johnny Eric Amancio ec71adcfb9 Merge remote-tracking branch 'origin/johnnyeric/kilo-opencode-v1.18.0' into johnnyeric/kilo-opencode-v1.18.13
# Conflicts:
#	packages/opencode/src/provider/transform.ts
2026-08-10 12:45:59 +02:00
Johnny Eric Amancio 548d7887d3 Merge remote-tracking branch 'origin/main' into johnnyeric/kilo-opencode-v1.18.0 2026-08-10 12:02:37 +02:00
Christiaan Arnoldus 82be537f18 test(cli): verify suggestion auto-dismissal in attached run session 2026-08-07 17:07:31 +02:00
Christiaan Arnoldus 910f0f24d2 fix(cli): disable suggest tool in non-interactive runs 2026-08-07 16:45:50 +02:00
Johnny Eric Amancio b6505b164b Merge remote-tracking branch 'origin/johnnyeric/kilo-opencode-v1.18.0' into johnnyeric/kilo-opencode-v1.18.13 2026-08-07 13:09:21 +02:00
Johnny Eric Amancio 8d4caec308 Merge remote-tracking branch 'origin/main' into johnnyeric/kilo-opencode-v1.18.0
# Conflicts:
#	packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
#	packages/kilo-vscode/webview-ui/src/context/session.tsx
2026-08-07 12:44:16 +02:00
Christiaan Arnoldus 1406d719e3 fix(cli): remove unsupported kilo web command 2026-08-07 10:24:46 +02:00
Johnny Eric Amancio d99467fa02 resolve merge conflicts 2026-08-06 14:10:41 +02:00
Johnny Eric Amancio cce22e608f merge: upstream v1.18.13 2026-08-06 00:31:20 +02:00
Johnny Eric Amancio 0fff61fa62 refactor: kilo compat for v1.18.13 2026-08-06 00:00:45 +02:00
Johnny Eric Amancio 25f4b58d93 fix: address post-merge validation findings 2026-08-05 21:08:55 +02:00
Johnny Eric Amancio 88083fb5c5 resolve merge conflicts 2026-08-05 16:01:49 +02:00
Johnny Eric Amancio 76783409bf refactor: kilo compat for v1.18.0 2026-08-05 11:59:08 +02:00
kilo-maintainer[bot] 5ca97417a0 chore: update kilo-vscode visual regression baselines 2026-07-31 02:55:59 +02:00
Johnny Amancio a606a91e69 fix: restore Kilo deltas the merge dropped
- tool-input delta/end no longer recreate a settled call as a pending part
- outputTokenMax is back in overflow accounting, with RuntimeFlags rewired
- MCP server instructions reach the system prompt again (sys.mcp call site)
- session revert decodes stored messages through the Kilo normalize boundary
- shell tool titles runs with the model description and keeps it in metadata
- subdirectory snapshots drop newly ignored files: the ignore check and the
  index removal ran from the instance dir, but candidates are worktree
  relative
- customize-opencode builtin stays unregistered after the boot.ts rename
- --auto is interpreted in one place; the flag beside it now covers only
  --yolo and --dangerously-skip-permissions
- --cloud-fork works again, validateSession had landed before the import
- TUI block tool skips the empty title row, opencode catalog gate reads
  credentials per reload, TUI worker logs crashes, Snowflake OAuth uses the
  Kilo page, annotations guard covers the shared packages
- tests: startRun spawned without the solid preload so every run under it
  died on the JSX runtime; two upstream tests get a permission fixture since
  headless auto-rejects bash; one expected a single error record where Kilo
  emits two, as it did before this merge
- changeset for the range, help snapshot, llmgateway indentation
2026-07-30 19:52:20 +02:00
Johnny Amancio db000fef1c Merge remote-tracking branch 'origin/main' into johnnyeric/kilo-opencode-v1.17.13
# Conflicts:
#	bun.lock
#	packages/core/src/v1/permission.ts
#	packages/opencode/src/acp/permission.ts
#	packages/opencode/src/cli/cmd/tui.ts
#	packages/opencode/src/skill/discovery.ts
#	packages/opencode/src/skill/index.ts
#	packages/opencode/test/cli/run/run-process.test.ts
#	packages/opencode/test/skill/discovery.test.ts
#	packages/opencode/test/tool/registry.test.ts
#	packages/sdk/openapi.json
#	packages/server/src/handlers/pty.ts
2026-07-30 16:32:39 +02:00
Johnny Amancio 518501a994 resolve merge conflicts 2026-07-30 14:24:24 +02:00
Bruno Agatao b69f8e6a25 Merge remote-tracking branch 'origin/main' into feat/execute-cmds-in-skill-context 2026-07-30 12:31:30 +02:00
Igor Šćekićandkiloconnect[bot] d579774960 fix(ci): docs-sync bot passes --auto, drains its backlog, and reports readable causes; fix(cli): honest exit codes for headless runs (#12605)
* fix(ci): pass --auto to the docs-sync kilo runs and keep full stderr logs

Headless kilo run auto-rejects every permission ask it receives, and the
GitHub runner has no user config granting bash — so without --auto the
docs-sync bot's triage, edit and verify-fix calls were silently crippled
whenever the agent reached for a non-allowlisted shell command (CI run
30306629290: 9 rejections, all 11 edit batches failed, exit 0).

- Pass --auto immediately after "run" at all three call sites
  (triage.mjs, edit.mjs, docs-sync.yml Fix verify failures step)
- runKilo now always writes the child's full stderr to
  docs-sync-out/kilo-stderr-<label>.log, on success as well as failure —
  the blindness that hid the defect
- selftest asserts --auto non-vacuously (region-scoped source match +
  a stub invocation that records argv) and proves the stderr log is
  written on both the failure and the summary-writing success path

* fix(cli): exit nonzero when a headless run auto-rejects or its session errors

Non-interactive kilo run reported success for runs that accomplished
nothing — a caller cannot distinguish success from a dead run, which is
why the docs-sync bot had to stop trusting exit codes entirely.

- Plain headless run (neither --auto nor --dangerously-skip-permissions)
  in which the CLI auto-rejected at least one permission ask now exits
  non-zero, even when the session still reaches idle afterwards, with
  the diagnostic: run ended with an auto-rejected permission; pass
  --auto for autonomous use. Deliberate contract change: any
  auto-rejected ask means the run was crippled, not successful.
- A mid-stream session error now writes its diagnostic to stderr before
  emitting the json error event, so the cause is visible under
  --format json as well (the emit-first shape skipped the stderr write).
- The old exit-0 contract lock-in test is replaced: its llm.fail fixture
  never published a consumable session.error, so it locked in a false
  premise. New tests cover both scenarios in both output formats;
  happy-path and --format json runs still exit 0 unchanged.

* fix(ci): redact secret env values from persisted kilo stderr logs

The full-stderr capture added for observability lands in uploaded CI
artifacts, which are raw files (GitHub masks secrets in log streams
only) on a public repo, and the runner env holds a long-lived
KILO_API_KEY. Redact exact values of KEY|TOKEN|SECRET-named env vars
(len >= 8) once at capture, so both the console tail and the artifact
file are safe. Adds the changeset for the headless exit-code contract
change.

* fix(ci): redact secrets from persisted kilo stdout and harden redaction

The docs-sync workflow uploads docs-sync-out/ as a public 14-day artifact,
and kilo stdout was persisted raw there in two more places: triage-raw-*.txt
and the edit-log.txt tee. Redact at capture in runKilo for stdout as already
done for stderr, and pipe the verify-fix step's kilo stdout through a new
line-wise redact-stream.mjs filter before tee.

Also harden redactEnvSecrets: widen the name pattern to
KEY|TOKEN|SECRET|CREDENTIAL|PASSWORD|ORG_ID|_PAT (KILO_ORG_ID is a repo
secret), replace longer values first so a short secret that prefixes a
longer one cannot leak the remainder, and document the exact-substring
limitation. Selftest gains cases 2e (prefix ordering), 2f (stdout capture),
2g (stream filter) and a non-vacuous exact-line assertion in 2d.

* fix(cli): correct the headless-exit changeset's json-format claim

The auto-reject path adds a new error event to the --format json stream;
only the existing event shapes are unchanged. Also state that the exit-1
rule covers a plain non-interactive --attach run that auto-rejects an ask.

* fix(ci): document --auto security trade-off and deferred hardening

Update comments in triage.mjs and edit.mjs to accurately describe the
security implications of --auto (unrestricted bash for an agent steered
by external PR content) and note that a scoped permission.bash map via
KILO_CONFIG_CONTENT is the intended hardening, deferred until required
shell patterns are stable.

* fix(ci): raise docs-sync budgets so the backlog can actually drain

--auto fixes the batches the bot attempted; it does not fix the ones it
never started. In run 30306629290 (254 PRs collected, 51 docs-worthy),
the wall-clock budgets deferred 54 PRs untriaged and 31 unedited without
an attempt — 45 of the 60 pending rows on the rolling PR. Triage got 8 of
11 chunks in 35 min; edit got 4 of 11 batches in 50 min.

Both are ceilings, not costs. A caught-up run needs ~2 chunks and ~1
batch and finishes in ~25 min, so raising them spends nothing on a normal
day and drains the backlog on a bad one. 90/120 covers 20 chunks and 14
batches — 500 triaged and 70 edited PRs against a ~5 docs-worthy/day
inflow — inside a 240-minute job timeout.

Also strip ANSI CSI sequences in tailText, the shared path both triage
and edit route their pending causes through. kilo renders its TUI to
stderr, so every "Why" cell on the rolling PR currently reads
"^[[0m→ ^[[0mRead packages/..." instead of the diagnostic. The persisted
docs-sync-out/kilo-stderr-*.log stays raw as the debugging record.

selftest case 2h asserts the pending reason is escape-free and still
carries the diagnostic text; case 2i asserts each budget fits at least
two units and the job timeout outlasts both, so a future edit cannot
silently restore a budget too small to run anything. Both shown failing
on the unmodified code first.

* fix(ci): keep the docs-sync rebuild authoritative in the fix step

The "Fix verify failures" step runs under `set -o pipefail` and the
default `bash -e`. Once the CLI half of this PR ships, `kilo run` exits 1
on a mid-stream session error, which aborts the block before the rebuild
runs: verify2.log is never written and `Re-verify status` reports
VERIFIED=false even when the docs build fine. A transient provider error
would flip every rolling docs PR to "Verification: failing".

The agent's exit code was never the signal for this step — the rebuild
is. Guard the pipeline with `|| echo ::warning::` so a nonzero kilo run
is surfaced but the rebuild still decides the outcome.

Extends selftest case 2b (which already parses this step) rather than
adding a case: the guard must appear between the pipeline's tee and the
rebuild, so a comment elsewhere in the block cannot satisfy it. Shown
failing with the guard removed.

---------

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-07-29 15:34:41 +00:00
Bruno Agatao 572d8fdfd9 fix(cli): let human surfaces approve skill shell batches 2026-07-29 15:48:22 +02:00
Johnny Amancio 898f0dc40b refactor: kilo compat for v1.17.13 2026-07-29 02:06:01 +02:00
Josh Lambert bcf8b8b9a8 fix(cli): emit run events once 2026-07-23 23:09:42 -04:00
marius-kilocode a776bd4d29 refactor: kilo compat for v1.17.9 2026-07-22 13:31:23 +02:00
marius-kilocode 3591852931 resolve merge conflicts 2026-07-20 13:01:11 +02:00
marius-kilocode 4327386ff8 refactor: kilo compat for v1.17.5 2026-07-20 10:55:41 +02:00
Johnny Amancio e6d04275d3 fix: address third-pass upstream merge review 2026-07-16 12:43:56 +02:00