mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-29 10:55:35 +00:00
Kiro's new IDE builds write sessions to ~/.kiro/sessions/<hash>/sess_<id>/ (session.json + messages.jsonl event log) instead of globalStorage. Add a v2 parser and discovery, plus fixes surfaced while validating against a real upgraded machine: - Parse v2 event-sourced turns (user/turn_start/assistant/tool_call/ tool_result/usage_summary/turn_end) with per-execution dedup keys (kiro-v2:<session>:<execId>) and defensive flushes for out-of-order events and in-progress sessions - Price turns from real metered credits at the public overage rate (USD_PER_KIRO_CREDIT = $0.04/credit, individual plan: $20/mo for 1,000 credits), falling back to token estimation only when a turn has no usage_summary (aborted/in-flight); costIsEstimated distinguishes the two - Fix pre-existing CLI parser bug: metering_usage values are credits, not dollars — costs were overstated 25x at the real rate - Count v2 tool_result content as input context (matching the CLI parser's ToolResults treatment); previously only the user prompt was counted, undercounting input ~25x on agentic turns - Keep reasoningTokens disjoint from outputTokens: downstream aggregation (models-report, audit-report, parser) sums the two fields, so folding reasoning into output would double-count. Combine them only for the token-pricing fallback, matching codex/gemini - Take the real modelId from session.json, so v2 sessions are not mislabeled kiro-auto - Extract parseWorkspaceSession from the inline createParser block for parity with the other four format parsers - Add v2SessionsRootOverride and stop deriving the v2 scan root from the cliDir parent when only agentDirOverride is set (tests were scanning the system tmpdir) - Tests: v2 parsing/discovery/dedup/routing, credit vs fallback pricing, tool_result turn scoping, reasoning disjointness, cli-dir skip guard, and a mixed-format coexistence suite (legacy .chat + v1 executions + workspace-sessions + CLI + v2 on one machine) asserting exact aggregate counts and no double counting - Docs: v2 store layout, credit pricing, dedup namespaces, and the disjoint-store verification (v1->v2 is a clean cutover, no migration/dual-write observed) AI-Origin: human |
||
|---|---|---|
| .. | ||
| design | ||
| providers | ||
| sync | ||
| architecture.md | ||