xonecas.io
62159
Sy

symb / commit ef8159d

fix: missing reasoning messages

xonecas2026-02-17 ef8159ddf83a738c8f51f1ca21ad276ff349d9f7 parent 1044169

3 files changed

TODO.md+0−10
@@ -1,15 +1,5 @@
11 - [ ] Slow? or is it just some models? need numbers to compare. Turn times are ridiculous longest one was 27minutes with zen codex.
22
3-- [ ] Investigate reasoning messages missing from opencode provider but working with ollama. (Check if any opencode model shows reasoning).
4-
53 - [ ] Investigate empty messages with some models
64
75 - [ ] Conversation pane, no scroll to the bottom when the user is not at bottom.
8-
9-- [ ] Cleanup codebase:
10-
11-Aggregate common helpers in packages
12-Breakdown visual tui components into their own tui files.
13-Audit for ELM compliance and fix outliers
14-
15-Finish with: Find files larger than 750 lines write report for analysis
internal/provider/openai_common.go+9−0
@@ -257,10 +257,15 @@ type responsesRequest struct {
257257 Model string `json:"model"`
258258 Input []responsesInputItem `json:"input"`
259259 Tools []responsesToolParam `json:"tools,omitempty"`
260+ Reasoning *responsesReasoning `json:"reasoning,omitempty"`
260261 Temperature *float32 `json:"temperature,omitempty"`
261262 Stream bool `json:"stream"`
262263 }
263264
265+type responsesReasoning struct {
266+ Summary string `json:"summary,omitempty"`
267+}
268+
264269 // responsesInputItem is a polymorphic input item (message or function_call_output).
265270 type responsesInputItem struct {
266271 Type string `json:"type"` // "message", "function_call", or "function_call_output"
@@ -458,8 +463,12 @@ func (rt *responsesTracker) handleResponsesEvent(ctx context.Context, ch chan<-
458463 switch eventType {
459464 case "response.output_text.delta":
460465 return false, !rt.handleTextDelta(ctx, ch, data)
466+ case "response.reasoning_text.delta":
467+ return false, !rt.handleReasoningDelta(ctx, ch, data)
461468 case "response.reasoning_summary_text.delta":
462469 return false, !rt.handleReasoningDelta(ctx, ch, data)
470+ case "response.reasoning_summary.delta":
471+ return false, !rt.handleReasoningDelta(ctx, ch, data)
463472 case "response.output_item.added":
464473 return false, !rt.handleOutputItemAdded(ctx, ch, data)
465474 case "response.function_call_arguments.delta":
internal/provider/opencode.go+3−0
@@ -175,6 +175,9 @@ func (p *OpenCodeProvider) chatStreamResponses(ctx context.Context, messages []M
175175 Tools: toResponsesTools(tools),
176176 Stream: true,
177177 }
178+ if strings.HasPrefix(p.model, "gpt-5") {
179+ req.Reasoning = &responsesReasoning{Summary: "auto"}
180+ }
178181 if !strings.Contains(p.model, "codex") {
179182 t := float32(p.temperature)
180183 req.Temperature = &t