Repository navigation
feat(threads): write, fork, continue into and sync Kiro sessions - #4614
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; the previous branch-mixing issue is fixed. SummaryAdds writing, restoring, catching up, switching, forking, and continuing into Kiro sessions.
Reviews (6) Β· Last reviewed commit: "fix(threads): fast-forward a Kiro copy o..." Β· Reviewed by Greptile |
BinaryMuse
marked this pull request as ready for review
October 30, 2026 23:25
Collaborator
|
Landed as d784213. GitHub shows this merged once it reaches main. |
BinaryMuse
force-pushed
the
mkt/kiro-write
branch
from
November 3, 2026 00:43
b417a6c to
4ef6a93
Compare
BinaryMuse
force-pushed
the
mkt/kiro-write
branch
from
November 3, 2026 20:01
4ef6a93 to
891a27d
Compare
The write side for Kiro, as #4580 was for Copilot: a thread can now be restored as a Kiro session on another machine, caught up or switched when two copies diverge, forked, and continued into Kiro from another agent, and sync appends to and replaces Kiro's logs. `writes_transcripts` goes away again, as it did there. The writer (`kiro/rehydrate.rs`) puts a session where Kiro looks for it: `sessions/<hash of the directory>/sess_<id>/` with the header, the log in Kiro's row shapes (each turn framed by `turn_start`/`turn_end`, shell calls as `execute_bash` with `Output:β¦Exit Code: N`), and the `session-index` line; a fork names its original in the header (`parentSessionId`, `forkedAtMessageId`) and under `_meta.kiro.atuin`. What Kiro needs of a hand-written session was found by probing 2.36.0 and is in the module docs: a `tool_call` must carry a `status` or the call and its result drop out of the model's context; foreign ids, foreign tool names, failed results and a missing `session_start` are all fine; an `agent_note` reaches the model, so the continuation marker goes there. The reader now links each row to the one before it, so sync sees a Kiro session as a tree, and reads the header's `parentSessionId` as a fork's parent. Liveness for an idle copy asks the process table (a `kiro-cli-chat` or its engine working in the session's directory), since Kiro keeps no per-session lock: a just-restored copy refused its own catch-up otherwise. Shaken down against the real CLI: a Claude Code thread continued into Kiro resumed there quoting the marker and the carried facts; a captured Kiro session restored under a second `KIRO_HOME` resumed with its conversation and tool call. The end-to-end suite runs Kiro through the restore, catch-up, switch, fork and continuation cases. A cross-harness stress test with the real agents (102 hops, 33 of them Kiro, every Kiro pair in both directions) turned up one bug, fixed here: Kiro ends each turn with a redacted reasoning row after the reply, which made every plain catch-up of a native copy look like a divergence, since the restored copy lacked that row and the classifier's fast-forward rule did not know Kiro. The writer now writes the marker back and Kiro is in the rule. The same test showed a written session opening under Kiro's Default profile whatever `--agent` says, so the header now names the user's `chat.defaultAgent`.
atuin-bot
force-pushed
the
mkt/kiro-write
branch
from
November 4, 2026 00:58
891a27d to
d784213
Compare
atuin-bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
### Bug Fixes - *(daemon)* Include pre-session history in session-preload search ([#4536](#4536)) - *(deps)* Bump pulldown-cmark to 0.13.6 for RUSTSEC-2026-0433 ([#4631](#4631)) - *(mcp)* Show the input schema on bad arguments, and accept query and a string as search terms ([#4640](#4640)) - *(scripts)* Run scripts with process's original umask ([#4651](#4651)) - *(threads)* Open written pi and omp sessions on one root, and on a model omp can use ([#4649](#4649)) - *(threads)* Key a Grok tool result by its call, not its output ([#4652](#4652)) ### Features - *(ai)* Remove TERMINAL.md user context ([#4646](#4646)) - *(api)* Delete a thread with its descendants, and refuse threads under a deleted one - *(client)* Load ai-session records by id - *(daemon)* Upload captured threads to octavo - *(devenv)* A dev shell with CI's toolchain and a sandboxed Atuin ([#4616](#4616)) - *(setup)* New onboarding that asks what to capture and how to search it ([#4637](#4637)) - *(setup)* Ask what to import on a screen of its own, with checkboxes and a button to continue ([#4650](#4650)) - *(threads)* Add Grok Build session capture, resume, and sync ([#4583](#4583)) - *(threads)* Capture Amp threads through a generic atuin threads push, and import them ([#4635](#4635)) - *(threads)* Kiro CLI harness ([#4611](#4611)) - *(threads)* Capture Kiro subagents as child sessions ([#4612](#4612)) - *(threads)* Write, fork, continue into and sync Kiro sessions ([#4614](#4614)) - *(threads)* Carry Kiro's write, edit and search tools, and fix its read offset ([#4633](#4633)) - *(web)* Derive thread state and transcripts, and fake thread rpcs ### Miscellaneous Tasks - Remove vestigial mentions of TERMINAL.md ([#4648](#4648)) ### Refactor - *(threads)* Replace manual enum dispatches with `enum_dispatch` ([#4639](#4639)) ### Testing - Keep two tests from reading the real environment ([#4617](#4617))
eleboucher
pushed a commit
to eleboucher/homelab
that referenced
this pull request
Nov 4, 2026
β¦) (#2542) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/atuinsh/atuin](https://github.com/atuinsh/atuin) | patch | `18.24.4` β `18.24.5` | --- ### Release Notes <details> <summary>atuinsh/atuin (ghcr.io/atuinsh/atuin)</summary> ### [`v18.24.5`](https://github.com/atuinsh/atuin/blob/HEAD/CHANGELOG.md#18245) [Compare Source](atuinsh/atuin@v18.24.4...v18.24.5) ##### Bug Fixes - *(daemon)* Include pre-session history in session-preload search ([#​4536](atuinsh/atuin#4536)) - *(deps)* Bump pulldown-cmark to 0.13.6 for RUSTSEC-2026-0433 ([#​4631](atuinsh/atuin#4631)) - *(mcp)* Show the input schema on bad arguments, and accept query and a string as search terms ([#​4640](atuinsh/atuin#4640)) - *(scripts)* Run scripts with process's original umask ([#​4651](atuinsh/atuin#4651)) - *(threads)* Open written pi and omp sessions on one root, and on a model omp can use ([#​4649](atuinsh/atuin#4649)) - *(threads)* Key a Grok tool result by its call, not its output ([#​4652](atuinsh/atuin#4652)) ##### Features - *(ai)* Remove TERMINAL.md user context ([#​4646](atuinsh/atuin#4646)) - *(api)* Delete a thread with its descendants, and refuse threads under a deleted one - *(client)* Load ai-session records by id - *(daemon)* Upload captured threads to octavo - *(devenv)* A dev shell with CI's toolchain and a sandboxed Atuin ([#​4616](atuinsh/atuin#4616)) - *(setup)* New onboarding that asks what to capture and how to search it ([#​4637](atuinsh/atuin#4637)) - *(setup)* Ask what to import on a screen of its own, with checkboxes and a button to continue ([#​4650](atuinsh/atuin#4650)) - *(threads)* Add Grok Build session capture, resume, and sync ([#​4583](atuinsh/atuin#4583)) - *(threads)* Capture Amp threads through a generic atuin threads push, and import them ([#​4635](atuinsh/atuin#4635)) - *(threads)* Kiro CLI harness ([#​4611](atuinsh/atuin#4611)) - *(threads)* Capture Kiro subagents as child sessions ([#​4612](atuinsh/atuin#4612)) - *(threads)* Write, fork, continue into and sync Kiro sessions ([#​4614](atuinsh/atuin#4614)) - *(threads)* Carry Kiro's write, edit and search tools, and fix its read offset ([#​4633](atuinsh/atuin#4633)) - *(web)* Derive thread state and transcripts, and fake thread rpcs ##### Miscellaneous Tasks - Remove vestigial mentions of TERMINAL.md ([#​4648](atuinsh/atuin#4648)) ##### Refactor - *(threads)* Replace manual enum dispatches with `enum_dispatch` ([#​4639](atuinsh/atuin#4639)) ##### Testing - Keep two tests from reading the real environment ([#​4617](atuinsh/atuin#4617)) </details> --- ### Configuration π **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTkuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE5OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/2542
1 task
BinaryMuse
added a commit
that referenced
this pull request
Nov 9, 2026
A harness atuin reads but can't write yet says so with `writes_transcripts`, and restore, catch-up, fork and continuation into it are refused up front: the resumer offers its copy as it is, never as a continuation target, and `continue_in` returns `ContinueError::Unwritable`. Kiro needed this for its first PR and lost it once its writer landed (#4614); Hermes Agent needs it now.
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.
The write side for Kiro, as #4580 was for Copilot: a thread can now be restored as a Kiro session on another machine, caught up or switched when two copies diverge, forked, and continued into Kiro from another agent, and sync appends to and replaces Kiro's logs.
writes_transcriptsgoes away again, as it did there.The writer (
kiro/rehydrate.rs) puts a session where Kiro looks for it:sessions/<hash of the directory>/sess_<id>/with the header, the log in Kiro's row shapes (each turn framed byturn_start/turn_end, shell calls asexecute_bashwithOutput:β¦Exit Code: N), and thesession-indexline; a fork names its original in the header (parentSessionId,forkedAtMessageId) and under_meta.kiro.atuin. What Kiro needs of a hand-written session was found by probing 2.36.0 and is in the module docs: atool_callmust carry astatusor the call and its result drop out of the model's context; foreign ids, foreign tool names, failed results and a missingsession_startare all fine; anagent_notereaches the model, so the continuation marker goes there. The reader now links each row to the one before it, so sync sees a Kiro session as a tree, and reads the header'sparentSessionIdas a fork's parent.Liveness for an idle copy asks the process table (a
kiro-cli-chator its engine working in the session's directory), since Kiro keeps no per-session lock: a just-restored copy refused its own catch-up otherwise.Shaken down against the real CLI: a Claude Code thread continued into Kiro resumed there quoting the marker and the carried facts; a captured Kiro session restored under a second
KIRO_HOMEresumed with its conversation and tool call. The end-to-end suite runs Kiro through the restore, catch-up, switch, fork and continuation cases.A cross-harness stress test with the real agents (102 hops, 33 of them Kiro, every Kiro pair in both directions) turned up one bug, fixed here: Kiro ends each turn with a redacted reasoning row after the reply, which made every plain catch-up of a native copy look like a divergence, since the restored copy lacked that row and the classifier's fast-forward rule did not know Kiro. The writer now writes the marker back and Kiro is in the rule. The same test showed a written session opening under Kiro's Default profile whatever
--agentsays, so the header now names the user'schat.defaultAgent.