Skip to content

Commit df2ef6d

Browse files
authored
fix(simulate): mark a cited tool output where it prints (#946)
A summary can cite a tool output, and the digit jump opened the job without marking it: outputs were skipped unless tool detail was on, and printed with no mark when it was. A cited output now prints regardless of the toggle and carries the mark, like a cited function call.
1 parent 63ab90f commit df2ef6d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

cmd/lk/simulate_tui.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,16 +1931,23 @@ func (m *simulateModel) renderChatTranscript(jobID string) string {
19311931
}
19321932
writeToolItem(&b, fmt.Sprintf("ƒ %s(%s)", fc.Name, m.toolArguments(fc.Arguments)), wrapWidth, mark)
19331933
case *agent.ChatContext_ChatItem_FunctionCallOutput:
1934-
if !m.showToolDetail {
1934+
fco := v.FunctionCallOutput
1935+
// a jump has to land on the turn it cited, so a cited output prints
1936+
// whether or not tool detail is on
1937+
mark := ""
1938+
if m.citedItem(fco.Id) {
1939+
cited = true
1940+
mark = citedMark()
1941+
}
1942+
if !m.showToolDetail && mark == "" {
19351943
continue
19361944
}
1937-
fco := v.FunctionCallOutput
19381945
output := strings.TrimSpace(fco.Output)
19391946
if output == "" {
19401947
continue
19411948
}
19421949
ensureAgentBlock()
1943-
writeToolItem(&b, "→ "+output, wrapWidth, "")
1950+
writeToolItem(&b, "→ "+output, wrapWidth, mark)
19441951
case *agent.ChatContext_ChatItem_AgentHandoff:
19451952
h := v.AgentHandoff
19461953
old := ""

0 commit comments

Comments
 (0)