fix(kiro): Fix Kiro IDE session parsing — context.messages, .kiro-server path, workspace-sessions#618
fix(kiro): Fix Kiro IDE session parsing — context.messages, .kiro-server path, workspace-sessions#618Enclavet wants to merge 1 commit into
Conversation
|
Thanks for jumping on the Kiro parsing fix. There are a few things I need fixed before I can merge this:
Kiro is not in So if a user already has a Kiro source file cached as Also please add a regression test that goes through
Discovery includes both nested execution files and workspace-session JSON files ( That means a workspace-session entry that references the same
The comment says to check both paths, but The targeted Kiro test file passes locally for me: |
…geSummary tools, workspace-sessions Four fixes for the Kiro IDE provider: 1. Add 'entries' to extractText() key list — Kiro IDE stores message content in context.messages[].entries (not .content), causing the parser to extract 0 chars from every execution file. 2. Check data.context[key] for conversation arrays in parseModernExecution — current Kiro builds store messages at data.context.messages, not at the top-level data.messages path the parser was checking. 3. Scan both ~/.kiro-server/data/... AND ~/.config/Kiro/... on Linux — remote dev boxes use .kiro-server while local installs use .config/Kiro. Both can have data simultaneously; the old code short-circuited on the first path found. 4. Discover and parse workspace-sessions/<base64>/*.json files — newer Kiro builds write session state here with history[].message format. Skips stub entries (executionId refs + 'On it.' only) to avoid double-counting with execution files parsed separately. 5. Add kiro: 'ide-parsing-v1' to PROVIDER_PARSE_VERSIONS for automatic cache invalidation — users upgrading from the broken parser will get a fresh re-parse without manually clearing session-cache.json. Bonus: Extract tool names from usageSummary[].usedTools, add chatSessionId to session ID resolution, add Kiro-specific tool name mappings. AI-Origin: human
09b9e32 to
9c2ac6e
Compare
|
Updated PR with fixes. |
Problem
The Kiro provider returns 0 calls on both Linux remote dev boxes and Windows despite hundreds of session files existing on disk. Three independent issues combine to make the provider non-functional:
extractTextmisses theentrieskey — Kiro IDE stores message content incontext.messages[].entries(not.content), so the recursive text extractor never finds it and returns 0 chars for every file.parseModernExecutiononly checks top-level conversation arrays — Current Kiro builds store messages atdata.context.messages, notdata.messages. The parser never looks insidedata.context.getKiroAgentDirmissing.kiro-serverpath on Linux — Remote dev boxes (common at AWS/Amazon) store Kiro data at~/.kiro-server/data/User/globalStorage/kiro.kiroagentinstead of~/.config/Kiro/.... Without the fallback, discovery returns 0 sources on Linux.Newer Kiro builds write to
workspace-sessions/— Post-June 2026 Kiro stores session state inkiro.kiroagent/workspace-sessions/<base64>/<sessionId>.jsonwith ahistory[].messageformat that the provider doesn't discover or parse.Fix
'entries'toextractText()recursion keysdata.context[key]beforedata[key]for conversation arrays inparseModernExecutionexistsSynccheck for~/.kiro-server/data/...ingetKiroAgentDir()(Linux only)workspace-sessions/<base64>/*.json+ parser forhistory[].messageformatusageSummary[].usedToolswhen present (structured billing data)chatSessionIdto session ID resolution chainexecuteBash→ Bash,fsWrite→ Edit,grepSearch→ Grep, etc.)Impact
Testing
context.messageswith entries,usageSummarytool extraction, execution index skipping, workspace-sessions discovery/parsing, stub-only sessions, andsessions.jsonskipping~/.cache/codeburn/session-cache.jsonrequired after upgrade since stale cache stores empty parse results from the broken code)Note for users upgrading
After installing this version, delete
~/.cache/codeburn/session-cache.json(or equivalent) to force a fresh parse. The old cache stores "0 results" for every Kiro IDE file from when the parser was broken — the fingerprint-based cache won't re-parse unchanged files without clearing it.