Introduce a local `watch` helper that erases strict schema types when
subscribing to MessageV2.Event.Updated, MessageV2.Event.PartUpdated,
and Session.Event.Diff events. This mirrors the pattern used upstream
in share/share-next.ts and resolves type errors caused by the zod-to-
effect Schema migration where event definition types no longer align
with the Bus.subscribe generic constraint.
Replace zod schema definitions with effect Schema equivalents in
BusEvent definitions, tool parameters, session network, suggestions,
and related modules. This aligns Kilo-specific code with the upstream
v1.14.23 migration from zod to effect Schema.
- Convert BusEvent property schemas from zod objects to Schema.Struct
- Migrate tool parameter definitions (recall, warpgrep, suggest) to
Schema.Struct with annotated descriptions
- Replace zod-based SessionNetwork.Wait with effect Schema and add
zod interop via withStatics helper
- Extract shared EditorContext schema in message-v2 and reuse in
prompt input
- Replace `fn()` wrappers in session.ts with explicit
Schema.decodeUnknownSync calls for type safety
- Use branded SessionID/QuestionID types in place of raw z.string()
- Update pending map in SessionNetwork from Record to Map<QuestionID>
- Update tests to use SessionID.make() for branded identifiers
Include `variant: undefined` in metadata objects to match the expected
shape returned by the provider, ensuring the assertion compares all
fields accurately.
Verify that when a subtask completes, the child session's assistant
cost is correctly propagated to the parent wrapper message. This
covers the cost aggregation path in handleSubtask for subagent
interactions.
The task tool propagates each child session's total cost into the parent's tool-wrapper assistant message. Counting both root and child sessions in `kilo stats` would double-count that contribution. Filter `getAllSessions()` to root sessions (parent_id IS NULL), matching how the TUI session list and web sidebar already treat child sessions.
finish-step and cleanup previously re-wrote the parent assistant message with a stale in-memory cost, clobbering the subagent cost written by task.ts during tool execution. Refresh from DB before each write so the propagated cost is preserved across steps. Verified live via side-by-side `kilo serve` vs dev `bun serve` with 2 parallel subagents; parent now shows own LLM + children, matching real spend.
When a session spawned subagents via the task tool, the displayed cost reflected only the parent's own LLM steps. Propagate each subagent's total up to the invoking assistant message so every UI sums the full tree.
* fix: allow ChatGPT login over OpenAI provider config
Let users with inherited or globally configured OpenAI API keys sign in with ChatGPT for Codex without first removing their existing provider setup.
* fix: satisfy provider login ci checks
Annotate Kilo-specific shared CLI changes and apply webview formatting so the existing ChatGPT login flow passes CI.
Strengthen the Kilo queue integration test to capture each LLM
request body and assert the second request ends with the queued
user message, not a prior-turn assistant tail. Update the skipped
upstream prompt-effect active-run test comment to reference #9492
and point at the Kilo-specific authoritative coverage.
The gateway wraps @openrouter/ai-sdk-provider internally, so the same
openrouter SDK-side reasoning handling applies. Without this, users
routing through api.kilo.ai still see DeepSeek 400 'reasoning_content
must be passed back' errors.
Remove explanatory block comments and intermediate variable assignment
(`__oc_cwd`) that were left over from the previous iteration. Use
`cd -- "$1"` directly instead of the two-step capture-then-cd pattern,
and rename the argv[0] placeholder from `_opencode` to `opencode`.
Replace the `pwd -P` approach with an explicit positional argument (`$1`)
for zsh and bash login shell invocations. Login shells source profile
scripts (`/etc/profile`, `~/.profile`, `~/.bashrc`) before the `-c`
script executes, and those scripts may change the working directory
(e.g. nvm, direnv), making both `$PWD` and `pwd -P` unreliable at
script evaluation time. By passing `ctx.directory` as `$1` and falling
back to `$PWD` when unset, the shell script always receives the correct
session directory regardless of profile side effects.
Simplify the corresponding integration test by removing verbose CI
debug probes and replacing them with a straightforward `pwd` assertion.
Replace `$PWD` with `$(pwd -P)` when capturing the working directory
in zsh and bash login shell invocations. When the child shell inherits
a stale PWD environment variable — common in CI where the spawner's
cwd differs from the session directory — `$PWD` can point to the wrong
location, causing `cd "$__oc_cwd"` to silently escape the intended
directory. `pwd -P` queries the kernel via getcwd(), ensuring the
correct physical path is always used.
The corresponding test is updated with richer cwd diagnostics to
validate the fix and surface root-cause information on failure.
Skip "glob tool keeps instance context during prompt runs" and
"prompt submitted during an active run" tests tracked in #9958.
Replace "build" agent assertion with "code" to align with Kilo
agent naming conventions.
Remove mistral from the provider reasoning variant detection list
and update bare repo test assertions to use "kilo" cache directory
naming instead of "opencode".
Re-run code generation to emit the SnapshotSummaryFileDiff named type
and replace inline anonymous diff objects across Session,
SyncEventSessionUpdated, and GlobalSession. Alphabetically sort
dependency entries in the opencode package.json and add previously
appended Kilo-specific packages into their correct positions.
Add a lightweight SummaryFileDiff derived from FileDiff via
Struct.omit(["patch"]) to keep session summary DB payloads small.
Replace inline anonymous object types in session.sql.ts, revert.ts,
and session.ts with the new schema. Cast SessionPrompt input in
remote-sender to satisfy narrowed PromptInput type, guard against
null in permission normalizeInput, and switch remaining bare .parse
calls to .zod.parse for Effect Schema compatibility.
Include unit tests verifying SummaryFileDiff field exclusion and
round-trip parsing behavior.
Replace direct Zod schema calls (Config.Info.parse, Config.Info.safeParse,
Snapshot.FileDiff, WorktreeDiff.Item) with their .zod counterparts to
align with the Effect Schema migration that wraps schemas via withStatics.
Migrate WorktreeDiff.Item from Zod's z.object/extend to Effect's
Schema.Struct with annotate and zod bridge. Add missing return statement
in TsClient notify.open stub and widen waitForDiagnostics input type to
match updated upstream interface.