xonecas.io
62159
Sy

symb / commit 49f7f53

fix: reduce conversation pane output

xonecas2026-02-16 49f7f53861f273cd60cd6ff435386eb0b408d3d4 parent 8503a98

3 files changed

internal/provider/openai_common.go+9−5
@@ -263,9 +263,13 @@ type responsesRequest struct {
263263
264264 // responsesInputItem is a polymorphic input item (message or function_call_output).
265265 type responsesInputItem struct {
266- Type string `json:"type"` // "message" or "function_call_output"
266+ Type string `json:"type"` // "message", "function_call", or "function_call_output"
267267 Role string `json:"role,omitempty"` // for messages: "system", "user", "assistant", "developer"
268268 Content any `json:"content,omitempty"` // string or []responsesContentPart
269+ ID string `json:"id,omitempty"`
270+ Name string `json:"name,omitempty"`
271+ // function_call fields
272+ Arguments string `json:"arguments,omitempty"`
269273 // function_call_output fields
270274 CallID string `json:"call_id,omitempty"`
271275 Output string `json:"output,omitempty"`
@@ -346,10 +350,10 @@ func toResponsesInput(messages []Message) []responsesInputItem {
346350 }
347351 for _, tc := range m.ToolCalls {
348352 items = append(items, responsesInputItem{
349- Type: "function_call",
350- CallID: tc.ID,
351- // Encode the name and arguments so the API can match them.
352- Output: string(tc.Arguments),
353+ Type: "function_call",
354+ CallID: tc.ID,
355+ Name: tc.Name,
356+ Arguments: string(tc.Arguments),
353357 })
354358 }
355359 continue
internal/tui/tui.go+0−1
@@ -38,7 +38,6 @@ const (
3838 inputRows = 3 // Agent input height
3939 statusRows = 2 // Status separator + status bar
4040 minPaneWidth = 20
41- maxPreviewLines = 5 // Max lines shown for tool results before truncation
4241 maxDisplayTurns = 5 // Max conversation turns kept in memory; older turns live in DB
4342
4443 roleAssistant = "assistant"
internal/tui/update.go+7−35
@@ -486,46 +486,16 @@ func (m *Model) applyToolResultMsg(msg llmToolResultMsg) {
486486 startLine = toolCallEditLine(tc.Arguments)
487487 }
488488
489- // Determine the tool name for display decisions.
490- var toolName string
491- if tc, ok := m.pendingToolCalls[msg.toolCallID]; ok {
492- toolName = tc.Name
493- }
494-
495- // Grep and Shell show all lines (each clickable); others truncate.
496- showFull := toolName == "Grep" || toolName == "Shell"
497-
498- // Split diagnostic lines from the main content so they're always shown.
499489 body, diagLines := extractDiagLines(msg.content)
500-
501- lines := strings.Split(body, "\n")
502- preview := lines
503- truncated := false
504- if !showFull && len(lines) > maxPreviewLines {
505- preview = lines[:maxPreviewLines]
506- truncated = true
490+ if idx := strings.Index(body, "\n"); idx >= 0 {
491+ body = body[:idx]
507492 }
508493
509494 arrow := m.styles.ToolArrow.Render("←") + " "
510- entry := func(display string) convEntry {
511- return convEntry{display: display, kind: entryToolResult, filePath: filePath, full: msg.content, line: startLine}
512- }
513- var wasBottom bool
514- for i, line := range preview {
515- display := m.styleToolResultLine(line)
516- if i == 0 {
517- display = arrow + display
518- wasBottom = m.appendConv(entry(display))
519- } else {
520- m.appendConv(entry(display))
521- }
522- }
523- if truncated {
524- hint := fmt.Sprintf(" ... %d more lines (click to view)", len(lines)-maxPreviewLines)
525- m.appendConv(entry(m.styles.Muted.Render(hint)))
526- }
495+ entry := convEntry{display: arrow + m.styleToolResultLine(body), kind: entryToolResult, filePath: filePath, full: msg.content, line: startLine}
496+ wasBottom := m.appendConv(entry)
527497 for _, dl := range diagLines {
528- m.appendConv(entry(m.styleToolResultLine(dl)))
498+ m.appendConv(convEntry{display: m.styleToolResultLine(dl), kind: entryToolResult, filePath: filePath, full: msg.content, line: startLine})
529499 }
530500 if wasBottom {
531501 m.scrollOffset = 0
@@ -547,6 +517,8 @@ func extractDiagLines(content string) (body string, diags []string) {
547517 return content[:idx], diags
548518 }
549519
520+
521+
550522 // styleToolResultLine applies semantic styling to a tool result line.
551523 // Diagnostic lines (ERROR/WARNING) get colored; everything else is dim.
552524 func (m *Model) styleToolResultLine(line string) string {