Fork tasks from snapshots; snapshot only when text follows tool calls

This commit is contained in:
Ian Gulliver
2026-10-15 11:36:51 -07:00
parent 3fe0374ac5
commit 0000db1f86
25 changed files with 893 additions and 421 deletions
+13
View File
@@ -33,6 +33,7 @@ type Options struct {
Model string
SessionID string
Resume string
ResumeAt string
ForkSession bool
GitName string
GitEmail string
@@ -154,6 +155,14 @@ func (e Event) ParentToolUseID() (string, error) {
return msg.ParentToolUseID, err
}
func (e Event) UUID() (string, error) {
msg := struct {
UUID string `json:"uuid"`
}{}
err := json.Unmarshal(e.Raw, &msg)
return msg.UUID, err
}
func (e Event) TextDelta() (string, error) {
msg := struct {
ParentToolUseID *string `json:"parent_tool_use_id"`
@@ -326,6 +335,10 @@ func (s *Session) buildArgs(opts Options) ([]string, error) {
args = append(args, "--resume="+opts.Resume)
}
if opts.ResumeAt != "" {
args = append(args, "--resume-session-at="+opts.ResumeAt)
}
if opts.ForkSession {
args = append(args, "--fork-session")
}