You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds extensionless session index and nested execution file discovery
while preserving legacy .chat support. Modern execution JSON is parsed
for identifiers, timestamps, model IDs, conversation text, structured
tools, and token estimates. Also fixes dedup key poisoning on invalid
timestamps in the legacy parser.
@@ -16,29 +16,38 @@ VS Code-style globalStorage at `kiro.kiroagent`:
16
16
| Windows |`%APPDATA%/Kiro/User/globalStorage/kiro.kiroagent`|
17
17
| Linux |`~/.config/Kiro/User/globalStorage/kiro.kiroagent`|
18
18
19
-
Sessions are `.chat` files under hash-named subdirectories. Discovery is in `kiro.ts:215-247`; the path-resolution helpers it uses start at `kiro.ts:164`.
19
+
Sessions are under hash-named workspace subdirectories. Discovery keeps backward compatibility with legacy `.chat` files and also scans the post-February 2026 extensionless format:
- Legacy `.chat` files with `{ chat, metadata, executionId }`
30
+
- Modern extensionless execution files with identifiers/timestamps at the top level plus conversation fields such as `messages`, `conversation`, `chat`, `transcript`, `entries`, `events`, or direct prompt/response fields
31
+
32
+
Session index files with `{ executions: [...] }` are discovered but skipped during parsing because they do not contain conversation content.
24
33
25
34
## Caching
26
35
27
36
None.
28
37
29
38
## Deduplication
30
39
31
-
Per `executionId` (`kiro.ts:104`).
40
+
Modern files deduplicate per session/execution pair. Legacy `.chat` files deduplicate per workflow/execution pair.
32
41
33
42
## Quirks
34
43
35
-
-**Workspace hash resolution** is non-trivial. The parser tries `workspace.json` first; if that fails, it base64-decodes the directory name to recover the workspace path (`kiro.ts:198-213`).
36
-
-**Model ID normalization.** Kiro stores models like `claude-1.2`; the parser rewrites the dot to a hyphen so they match `claude-1-2` in the pricing snapshot (`kiro.ts:65-67`). Add new versions here when Kiro ships them.
37
-
-**Tool name extraction is regex-driven.** Kiro embeds tool calls inside the message text as `<tool_use><name>...</name>`(`kiro.ts:69-78`). Brittle but unavoidable until Kiro emits structured tool data.
38
-
- Token counts are estimated via char count (`CHARS_PER_TOKEN = 4`, `kiro.ts:9`, `:108-109`).
44
+
-**Workspace hash resolution** is non-trivial. The parser tries `workspace.json` first; if that fails, it base64-decodes the directory name to recover the workspace path.
45
+
-**Model ID normalization.** Kiro stores models like `claude-1.2`; the parser rewrites the dot to a hyphen so they match `claude-1-2` in the pricing snapshot. Add new versions here when Kiro ships them.
46
+
-**Tool name extraction accepts text and structured calls.** Kiro can embed tool calls inside message text as `<tool_use><name>...</name>`or expose structured `toolCalls` / `tool_calls` / `tools` entries.
47
+
- Token counts are estimated via char count (`CHARS_PER_TOKEN = 4`).
39
48
40
49
## When fixing a bug here
41
50
42
51
1. If the bug is "wrong workspace", check the base64 fallback path. Some users name their workspaces with characters that are not valid base64.
43
-
2. If the bug is "missing model in pricing", add the model to the normalization map at `kiro.ts:65-67`and verify against `tests/providers/kiro.test.ts`.
44
-
3. If the bug is "tools missing", look at the regex at `kiro.ts:69-78`. Kiro changes its envelope occasionally.
52
+
2. If the bug is "missing model in pricing", add the model to the normalization map and verify against `tests/providers/kiro.test.ts`.
53
+
3. If the bug is "tools missing", check both text-envelope extraction and structured tool-call extraction. Kiro changes its envelope occasionally.
0 commit comments