feat(kiro): wire up new file-based session format (~May 2026)#268
Open
Sean10 wants to merge 1 commit into
Open
feat(kiro): wire up new file-based session format (~May 2026)#268Sean10 wants to merge 1 commit into
Sean10 wants to merge 1 commit into
Conversation
Kiro CLI moved to per-session files under ~/.kiro/sessions/cli/:
<uuid>.json — metadata (session_id, cwd, title, created_at, updated_at)
<uuid>.jsonl — events: Prompt / AssistantMessage / ToolResults
- Add KIRO_SESSIONS_DIR + scanKiroCliSessions() and loadKiroCliDetail()
- Index the .jsonl files in _buildSessionFileIndex so they resolve to
{ format: 'kiro-cli' }, wiring detail/preview/search/replay/export
end-to-end (previously listed but "Session file not found" on open)
- Validate the sessionId as a strict UUID in loadKiroCliDetail before
path.join to close a path-traversal vector on untrusted input
- Add fixture-based tests covering scan, detail, path-traversal
rejection, index resolution, and end-to-end wiring
Old SQLite-based Kiro sessions remain fully supported alongside.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #230. Part 1 (maxBuffer +
ToolUse) already landed inf2b77f9; this PR is Part 2 reworked around @vakovalskii's review feedback.What & why
Kiro CLI moved to per-session files under
~/.kiro/sessions/cli/:<uuid>.json— metadata (session_id,cwd,title,created_at,updated_at)<uuid>.jsonl— events, one per line:Prompt→ user,AssistantMessage→ assistant,ToolResults→ skippedThe previous version of Part 2 listed these sessions but wasn't wired end-to-end — detail/preview/search/replay/export all resolve through
findSessionFile()/_buildSessionFileIndex(), which didn't know aboutkiro-cli, so opening a session returned "Session file not found" and the newfound.format === 'kiro-cli'branches were never reached.Changes (addressing review points)
_buildSessionFileIndex()now scans~/.kiro/sessions/cli/*.jsonland registers them as{ format: 'kiro-cli', sessionId }, sofindSessionFile()resolves them and every downstream consumer (detail, preview, search, replay, export) works end-to-end.loadKiroCliDetail()validatessessionIdas a strict UUID beforepath.join, since it takes untrusted request input once wired. The scanner uses the same strict UUID pattern.test/kiro-cli-session.test.jscovers scan, detail parsing, path-traversal rejection, index resolution, and full end-to-end wiring (detail/preview/replay/export).scanKiroCliSessions()+loadKiroCliDetail()carry the parsing; old SQLite-based Kiro sessions remain fully supported alongside the new format.Testing
node --test test/*.test.js→ 207 pass, 2 skipped (win32-only), 0 fail