feat(webui): draw each transcript entry with its Trace pattern (#1718)
Quality / check (pull_request) Successful in 3m38s
Quality / check (pull_request) Successful in 3m38s
Record the model's reasoning parts. The step run view shows reasoning as a Thought row, shell calls as a terminal, the gate as a test run, web_fetch as a source, finish as the verdict, and each fan-out branch as a subagent.
This commit is contained in:
5 files changed
+254
-113
No files matched your search
@@ -61,6 +61,7 @@ func (t *transcript) ModelCallFinished(_ context.Context, req chat.Request, resp
|
||||
}
|
||||
if resp != nil {
|
||||
entry.Text = clip(resp.Content, &entry.TextBytes)
|
||||
entry.Reasoning = clip(reasoning(resp.Parts), &entry.ReasoningBytes)
|
||||
entry.FinishReason = resp.FinishReason
|
||||
for _, call := range resp.ToolCalls {
|
||||
recorded := agentrun.TranscriptToolCall{ID: call.ID, Name: call.Name}
|
||||
@@ -130,6 +131,16 @@ func (t *transcript) AfterToolExecute(_ context.Context, call core.ToolCall, res
|
||||
t.add(entry)
|
||||
}
|
||||
|
||||
func reasoning(parts chat.Parts) string {
|
||||
var texts []string
|
||||
for _, part := range parts {
|
||||
if thought, ok := part.(chat.ReasoningPart); ok && thought.Text != "" {
|
||||
texts = append(texts, thought.Text)
|
||||
}
|
||||
}
|
||||
return strings.Join(texts, "\n\n")
|
||||
}
|
||||
|
||||
func isCompaction(req chat.Request) bool {
|
||||
n := len(req.Messages)
|
||||
return n > 0 && req.Messages[n-1].Role == chat.RoleUser && strings.HasPrefix(req.Messages[n-1].Content, compactionPrefix)
|
||||
|
||||
Reference in new issue
Block a user