fix(kiro): Fix Kiro IDE session parsing — context.messages, .kiro-server path, workspace-sessions#618
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. |
…etagentseal#619) Maintainer follow-up on top of the parsing fix: - Replace the placeholder cache tests with a regression test that runs the full parseAllSessions() pipeline against a seeded session-cache.json: a zero-turn entry at the current fingerprint is honored (control), and a pre-fix fingerprint forces the re-parse that recovers the missed calls. - Treat history items carrying an executionId as execution-backed regardless of their text, so a stub-text change can never reintroduce double-counting; the 'On it.' check remains for stubs whose ref rides a separate item. - Resolve the workspace-session timestamp before consuming the dedup key, and drop the call when stat fails instead of fabricating a current time. - Read selectedModel through stringField instead of an unchecked cast. - Import stat statically.
|
All three review items are addressed in your update, thanks. I pushed one maintainer commit (926dcdb) on top to close the remaining gaps so this can merge now:
One note on the PR description: with the parser version registered, the manual cache deletion step is no longer needed. The fingerprint change invalidates the old section automatically on first run, and the regression test covers exactly that scenario. Worth editing the note so users do not clear caches for nothing. Two follow-ups worth checking against your real data, neither blocking: whether mixed sessions exist where history holds both real inline replies and executionId refs (the user prompts of exec-backed turns would still be counted from both paths), and whether the base64 decode of workspace-session dir names should share one helper with resolveWorkspaceProject, which strips a trailing underscore instead of mapping underscores to padding. If you see either in the wild, a follow-up PR is very welcome. Full suite is green locally (1504 tests) and tsc is clean. Merging once CI completes. |
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.