Answer a question again by forking at its answer's snapshot

This commit is contained in:
Ian Gulliver
2026-10-19 17:46:44 -07:00
parent 101041fc87
commit ec390958e9
11 changed files with 517 additions and 316 deletions
+24
View File
@@ -45,6 +45,30 @@ func (s *Server) DismissInbox(w http.ResponseWriter, r *http.Request, itemID str
writeJSON(w, http.StatusOK, item)
}
func (s *Server) AnswerAgain(w http.ResponseWriter, r *http.Request) {
req := api.InboxResponseCreate{}
if !readJSON(w, r, &req) {
return
}
_, ok := s.images(w, r, req.Images)
if !ok {
return
}
u, err := s.store.GetUser(r.Context(), actor(r))
if err != nil {
writeStoreError(w, err)
return
}
fork, err := s.agents.AnswerAgain(r.Context(), u, req)
if err != nil {
writeAgentError(w, err)
return
}
writeJSON(w, http.StatusCreated, fork)
}
func (s *Server) RespondInbox(w http.ResponseWriter, r *http.Request) {
req := api.InboxRespond{}
if !readJSON(w, r, &req) {