Add a pause that holds an agent after its current step

This commit is contained in:
Ian Gulliver
2026-10-22 21:55:42 -07:00
parent 73519bf4dd
commit 293c21ca8c
25 changed files with 1014 additions and 472 deletions
+18
View File
@@ -1034,6 +1034,24 @@ func (s *Server) InterruptSession(w http.ResponseWriter, r *http.Request, sessio
writeJSON(w, http.StatusAccepted, sess)
}
func (s *Server) PauseSession(w http.ResponseWriter, r *http.Request, sessionID string) {
sess, err := s.agents.Pause(r.Context(), sessionID, actor(r))
if err != nil {
writeAgentError(w, err)
return
}
writeJSON(w, http.StatusOK, sess)
}
func (s *Server) ResumeSession(w http.ResponseWriter, r *http.Request, sessionID string) {
sess, err := s.agents.Resume(r.Context(), sessionID, actor(r))
if err != nil {
writeAgentError(w, err)
return
}
writeJSON(w, http.StatusOK, sess)
}
func writeAgentError(w http.ResponseWriter, err error) {
switch {
case errors.Is(err, store.ErrNotFound):