Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions migration-tracking/progress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ Measures Kilo's v1 delta: Kilo `main` pinned at `fb7e96eda540` (the v1 target) c

## Summary

**143 / 9828 cells done (1.5%)**, 26 dropped. `░░░░░░░░░░░░░░░░`
**149 / 9828 cells done (1.5%)**, 26 dropped. `░░░░░░░░░░░░░░░░`

| Kind | Done | Total | % |
|---|---:|---:|---:|
| module | 47 | 3547 | 1.3% |
| module | 52 | 3547 | 1.5% |
| api | 2 | 39 | 5.1% |
| patch | 65 | 3444 | 1.9% |
| test | 29 | 2798 | 1% |
| test | 30 | 2798 | 1.1% |

Not counted: 1428 branding-only hunks (rename script territory), 561 marker-only hunks (block boundaries), generated files. Patch attribution: 0 by tag, 261 by import, 97 by identifier, 4163 unattributed (see below).

Landed by rung, for patch cells closed by a done-proof: 42 plugin, 3 host, 0 seam, 5 patch.

Ratchets: 25 core-internal upstream modules imported by Kilo packages and adapters (`@opencode/core/app`, `@opencode/core/bus`, `@opencode/core/config`, `@opencode/core/config/discovery`, `@opencode/core/config/normalize`, `@opencode/core/effect/app-node-platform`, `@opencode/core/model`, `@opencode/core/model-resolver`, `@opencode/core/permission`, `@opencode/core/plugin/sdk`, `@opencode/core/plugin/system-prompt/anthropic.txt`, `@opencode/core/plugin/system-prompt/gpt-astra.txt`, `@opencode/core/plugin/system-prompt/gpt.txt`, `@opencode/core/plugin/system-prompt/kimi.txt`, `@opencode/core/plugin/system-prompt/trinity.txt`, `@opencode/core/provider`, `@opencode/core/rpc`, `@opencode/core/schema`, `@opencode/core/session/runner/model`, `@opencode/core/session/runner/prompt/system.txt`, `@opencode/core/session/system-prompt`, `@opencode/core/shell`, `@opencode/core/tool-output`, `@opencode/core/util/wildcard`, `@opencode/core/variant`); 46 shared patches by rung: 26 seam, 20 patch (`script/upstream/shared-patches.json`).
Ratchets: 25 core-internal upstream modules imported by Kilo packages and adapters (`@opencode/core/app`, `@opencode/core/bus`, `@opencode/core/config`, `@opencode/core/config/discovery`, `@opencode/core/config/normalize`, `@opencode/core/effect/app-node-platform`, `@opencode/core/model`, `@opencode/core/model-resolver`, `@opencode/core/permission`, `@opencode/core/plugin/sdk`, `@opencode/core/plugin/system-prompt/anthropic.txt`, `@opencode/core/plugin/system-prompt/gpt-astra.txt`, `@opencode/core/plugin/system-prompt/gpt.txt`, `@opencode/core/plugin/system-prompt/kimi.txt`, `@opencode/core/plugin/system-prompt/trinity.txt`, `@opencode/core/provider`, `@opencode/core/rpc`, `@opencode/core/schema`, `@opencode/core/session/runner/model`, `@opencode/core/session/runner/prompt/system.txt`, `@opencode/core/session/system-prompt`, `@opencode/core/shell`, `@opencode/core/tool-output`, `@opencode/core/util/wildcard`, `@opencode/core/variant`); 48 shared patches by rung: 28 seam, 20 patch (`script/upstream/shared-patches.json`).

## History

Expand All @@ -36,8 +36,8 @@ One point per day from the committed `progress.json` on v2's first-parent histor
| 2026-10-20 | 87 | 9829 | 0.9% |
| 2026-10-21 | 90 | 9829 | 0.9% |
| 2026-10-22 | 93 | 9829 | 0.9% |
| 2026-10-23 | 137 | 9828 | 1.4% |
| now | 143 | 9828 | 1.5% |
| 2026-10-23 | 143 | 9828 | 1.5% |
| now | 149 | 9828 | 1.5% |

## Features

Expand Down Expand Up @@ -99,7 +99,7 @@ Cells per kind as done/total. A cell is done when it exists on v2 by the rules b
| permission | 0/12 | | 0/6 | 0/16 | 0/34 | 0% | `░░░░░░░░░░░░░░░░` | |
| pii | 0/1 | | | | 0/1 | 0% | `░░░░░░░░░░░░░░░░` | |
| plan | 0/2 | | | 0/4 | 0/6 | 0% | `░░░░░░░░░░░░░░░░` | |
| plugin | 1/26 | | 0/2 | 0/6 | 1/34 | 2.9% | `░░░░░░░░░░░░░░░░` | |
| plugin | 6/26 | | 0/2 | 1/6 | 7/34 | 20.6% | `███░░░░░░░░░░░░░` | |
| presence | 0/3 | | 0/1 | 0/3 | 0/7 | 0% | `░░░░░░░░░░░░░░░░` | |
| process | 0/4 | 0/1 | 0/9 | 0/1 | 0/15 | 0% | `░░░░░░░░░░░░░░░░` | |
| project | 0/4 | | 0/2 | 0/5 | 0/11 | 0% | `░░░░░░░░░░░░░░░░` | |
Expand Down
6 changes: 3 additions & 3 deletions migration-tracking/progress/history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 13 additions & 7 deletions migration-tracking/progress/progress.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"v1Base": "8100c68b507b53aac6b891edbc3040a6011d8969"
},
"summary": {
"done": 143,
"done": 149,
"total": 9828,
"percent": 1.5,
"dropped": 26,
"kinds": [
{
"kind": "module",
"done": 47,
"done": 52,
"total": 3547
},
{
Expand All @@ -26,7 +26,7 @@
},
{
"kind": "test",
"done": 29,
"done": 30,
"total": 2798
}
],
Expand All @@ -38,7 +38,7 @@
},
"coreImports": 25,
"sharedPatches": {
"seam": 26,
"seam": 28,
"patch": 20
}
},
Expand Down Expand Up @@ -1427,12 +1427,12 @@
},
{
"feature": "plugin",
"done": 1,
"done": 7,
"total": 34,
"dropped": 0,
"kinds": {
"module": {
"done": 1,
"done": 6,
"total": 26
},
"api": {
Expand All @@ -1444,7 +1444,7 @@
"total": 2
},
"test": {
"done": 0,
"done": 1,
"total": 6
}
}
Expand Down Expand Up @@ -6242,6 +6242,11 @@
"module:packages/opencode/src/kilocode/components/notification-banner.tsx",
"module:packages/opencode/src/kilocode/kilo-errors.ts",
"module:packages/opencode/src/kilocode/plugins/home-news.tsx",
"module:packages/opencode/src/kilocode/plugins/model-usage.ts",
"module:packages/opencode/src/kilocode/plugins/sidebar-footer.tsx",
"module:packages/opencode/src/kilocode/plugins/sidebar-pr.tsx",
"module:packages/opencode/src/kilocode/plugins/sidebar-usage-row.tsx",
"module:packages/opencode/src/kilocode/plugins/sidebar-usage.tsx",
"module:packages/opencode/test/kilocode/agent-global-config-dirs.test.ts",
"module:packages/opencode/test/kilocode/agent-permission-overrides.test.ts",
"module:packages/opencode/test/kilocode/agent-skill-permissions.test.ts",
Expand All @@ -6253,6 +6258,7 @@
"module:packages/opencode/test/kilocode/model-info-panel-utils.test.ts",
"module:packages/opencode/test/kilocode/model-info-panel.types.test.ts",
"module:packages/opencode/test/kilocode/news.test.ts",
"module:packages/opencode/test/kilocode/sidebar-footer.test.ts",
"module:packages/opencode/test/kilocode/tui/usage.test.ts",
"module:packages/schema/src/kilocode/provider-usage.ts",
"module:packages/tui/src/kilocode/model-picker.ts",
Expand Down
16 changes: 8 additions & 8 deletions migration-tracking/progress/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/plugin/src/tui/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export type SlotPath = keyof SlotMap
* keys is a type error, not a silent priority pick.
*/
export type SlotClaim<Path extends SlotPath = SlotPath> = Path extends SlotPath
? { readonly render: (input: SlotMap[Path]) => JSX.Element } & (
? { readonly render: (input: SlotMap[Path]) => JSX.Element; readonly order?: number } & ( // kilocode_change(plugin) seam - optional order at the anchor, see resolveSlots
| {
readonly prepend: Path
readonly append?: never
Expand Down
69 changes: 69 additions & 0 deletions packages/tui/src/kilocode/plugins/model-usage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Data of the Kilo sidebar usage panel. Same rules as v1 (packages/opencode/src/kilocode/session/model-usage.ts and
// packages/opencode/src/kilocode/plugins/model-usage.ts on main): one row per provider and model over the completed
// steps of the session family, keyed by the routed model of each step, sorted by cost.
import type { SessionMessageInfo } from "@opencode/client"
import { routedModel } from "../routed-model"

type Tokens = { input: number; output: number; reasoning: number; cache: { read: number; write: number } }

export type ModelUsage = { providerID: string; modelID: string; steps: number; cost: number; tokens: Tokens }

/** One v2 assistant message is one step. A step counts when it has token usage, as a v1 step-finish part. */
export function modelUsage(messages: readonly SessionMessageInfo[]) {
const rows = new Map<string, ModelUsage>()
messages.forEach((message) => {
if (message.type !== "assistant" || !message.tokens) return
const model = routedModel(message) ?? message.model
const key = `${model.providerID}/${model.id}`
const row = rows.get(key) ?? { providerID: model.providerID, modelID: model.id, steps: 0, cost: 0, tokens: empty() }
rows.set(key, {
...row,
steps: row.steps + 1,
cost: row.cost + Math.max(0, message.cost ?? 0),
tokens: sum(row.tokens, message.tokens),
})
})
const models = [...rows.values()].toSorted(
(a, b) => b.cost - a.cost || a.providerID.localeCompare(b.providerID) || a.modelID.localeCompare(b.modelID),
)
const totals = models.reduce(
(total, row) => ({
steps: total.steps + row.steps,
cost: total.cost + row.cost,
tokens: sum(total.tokens, row.tokens),
}),
{ steps: 0, cost: 0, tokens: empty() },
)
return { totals, models }
}

/** Groups the rows by provider in row order, with the provider name when the provider list has it. */
export function groupModelsByProvider(
models: readonly ModelUsage[],
providers: ReadonlyArray<{ id: string; name: string }>,
) {
const names = new Map(providers.map((provider) => [provider.id, provider.name]))
return [...Map.groupBy(models, (model) => model.providerID)].map(([providerID, rows]) => ({
providerID,
providerName: names.get(providerID) ?? providerID,
models: rows,
}))
}

/** Cache read share of the prompt tokens, as v1 `formatRate`. */
export function cacheRate(tokens: Tokens) {
return { input: tokens.input, read: tokens.cache.read, write: tokens.cache.write }
}

function sum(a: Tokens, b: Tokens): Tokens {
return {
input: a.input + b.input,
output: a.output + b.output,
reasoning: a.reasoning + b.reasoning,
cache: { read: a.cache.read + b.cache.read, write: a.cache.write + b.cache.write },
}
}

function empty(): Tokens {
return { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }
}
Loading
Loading