Fork tasks from snapshots; snapshot only when text follows tool calls
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user