Fork tasks from snapshots; snapshot only when text follows tool calls
This commit is contained in:
@@ -529,6 +529,26 @@ func (s *Server) ListSnapshots(w http.ResponseWriter, r *http.Request, taskID st
|
||||
writeJSON(w, http.StatusOK, snaps)
|
||||
}
|
||||
|
||||
func (s *Server) ForkSnapshot(w http.ResponseWriter, r *http.Request, taskID string, n int) {
|
||||
t, p, ok := s.activeTask(w, r, taskID)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
u, err := s.store.GetUser(r.Context(), actor(r))
|
||||
if err != nil {
|
||||
writeStoreError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
fork, err := s.agents.Fork(r.Context(), t, p, n, u)
|
||||
if err != nil {
|
||||
writeAgentError(w, err)
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusCreated, fork)
|
||||
}
|
||||
|
||||
func (s *Server) ListSessions(w http.ResponseWriter, r *http.Request, taskID string) {
|
||||
_, err := s.store.GetTask(r.Context(), taskID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user