feat(agentexec): record each agent run's transcript and show it per step (#1718)
The loop runner hooks every model call and tool call and reports ordered,
redacted, clipped entries. Each is persisted as an agent_transcript task
event through InsertEvent, left out of the timeline read, and served per
attempt at /api/tasks/{id}/transcript. The step run view shows it with Trace.
This commit is contained in:
35 files changed
+791
-68
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package webui
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/events"
|
||||
)
|
||||
|
||||
// taskTranscriptView is GET /api/tasks/{id}/transcript: one attempt's agent
|
||||
// transcript entries, oldest first.
|
||||
type taskTranscriptView struct {
|
||||
TaskID int64 `json:"task_id"`
|
||||
Attempt int `json:"attempt"`
|
||||
Entries []events.Event `json:"entries"`
|
||||
}
|
||||
|
||||
func (s *Server) handleTaskTranscript(w http.ResponseWriter, r *http.Request) {
|
||||
t, attempt, ok := s.taskAttemptTarget(w, r)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
entries, err := s.Store.TaskTranscript(r.Context(), t.ID, attempt)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if entries == nil {
|
||||
entries = []events.Event{}
|
||||
}
|
||||
writeJSON(w, taskTranscriptView{TaskID: t.ID, Attempt: attempt, Entries: entries})
|
||||
}
|
||||
Reference in new issue
Block a user