Skip to content

ai: gpt-5.6-sol still dies with "reasoning start before end: rs_...:1" on 2.0.14 after #45789 #50662

Description

@vvo

Summary

gpt-5.6-sol turns still die with reasoning start before end: rs_...:1 on 2.0.14, which includes the fix from #45789 (for #36892 / #43312). The turn fails as an untyped Failed to drain Session defect, idle_outcome is failed, and the TUI shows an empty assistant message with a cursor and no error. 7 crashes across 4 sessions in 5 days, all on openai/gpt-5.6-sol#medium through the Vercel AI Gateway provider with reasoningSummary: "auto". Removing reasoningSummary is the only workaround found.

Environment

  • opencode version: 2.0.14 (also reproduced on 0.0.0-beta-19086, beta channel)
  • OS: Darwin 25.6.0 (darwin arm64)
  • Terminal: iTerm.app, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/zsh
  • Install/channel: Homebrew anomalyco/tap/opencode-v2, latest channel
  • Active plugins: two local TUI plugins (opencode-cost-details, opencode-prs, both from github.com/vvo/opencode-plugins), -opencode.sidebar.context disabled. Crashes happen in the server, plugins are TUI-only.

Reproduction

Not deterministic. Roughly 1 crash per 20-30 sol turns in long sessions (100+ messages, 200k+ context).

  1. Global config:
    "providers": {
      "vercel": {
        "settings": { "gateway": { "caching": "auto" } },
        "models": {
          "openai/gpt-5.6-sol": {
            "settings": { "reasoningEffort": "medium", "reasoningSummary": "auto" }
          }
        }
      }
    }
  2. Run a long session on vercel/openai/gpt-5.6-sol#medium.
  3. Keep prompting. Eventually a turn ends immediately after the reasoning starts.

Expected Behavior

Either the overlapping summary part is normalized (close the open fragment, keep going) or the turn fails with a typed provider error that the TUI renders, as #45789 intended.

Actual Behavior

Server log (2.0.14):

level=ERROR message="Failed to drain Session"
cause="Error: reasoning start before end: rs_00db537c08807b5a016ab28c9ed7e887d1a46353013482c653:1
    at <anonymous> (/$bunfs/root/chunk-bam104a1.js:350:1615)
    at runLoop (/$bunfs/root/chunk-cp4m0mhv.js:24:2279)
    at evaluate (/$bunfs/root/chunk-cp4m0mhv.js:24:1518)
    at <anonymous> (/$bunfs/root/chunk-cp4m0mhv.js:24:6004)
    at processTicksAndRejections (native:7:39)
    at SessionRunner.publishLLMEvent (/$bunfs/root/chunk-bam104a1.js:350:11556)
    at SessionRunner.publishLLMEvent (definition) (/$bunfs/root/chunk-bam104a1.js:350:9184)
    at SessionStep.attempt (...)"
sessionID=ses_f376c02cdffe9hOZjBNXdDlU4D

Stored assistant message: two reasoning parts, the first with empty text and only a generationId, the second with text and time.completed. No time.completed on the message, no error, no finish. Next stored record is {"type":"idle","outcome":"failed"}.

"content": [
  { "type": "reasoning", "text": "", "state": { "generationId": "gen_..." },
    "time": { "created": 1790086302993, "completed": 1790086303014 } },
  { "type": "reasoning", "text": "**Updating service integration plan**\n\n...",
    "time": { "created": 1790086303027, "completed": 1790086303157 } }
]

The TUI shows the user prompt, one "Thought:" line, then an empty assistant block with a cursor. No error, no retry.

Additional Context

All occurrences from ~/.local/share/opencode/log/opencode.log, every one on openai/gpt-5.6-sol variant medium, every fragment id ends in :1:

time (UTC) version session fragment
2026-09-17 21:34 beta-19086 ses_f4eb62340ffe... rs_...:1
2026-09-18 08:05 beta-19086 ses_f4c7d5da5ffe... rs_...:1
2026-09-18 08:15 beta-19086 ses_f4c7d5da5ffe... rs_...:1
2026-09-18 09:31 beta-19086 ses_f4c637183ffe... rs_...:1
2026-09-22 11:35 beta-19086 ses_f376c02cdffe... rs_...:1
2026-09-22 11:52 beta-19086 ses_f376c02cdffe... rs_...:1
2026-09-22 14:11 2.0.14 ses_f376c02cdffe... rs_...:1

Same sessions also ran claude-fable-5.1, gpt-6-astra and glm-5.3-flash turns with zero crashes. So it is sol summary parts, not context size alone.

Relation to #36892 and #43312: same error string and same publish-llm-event die path. #45789 landed in 2.0.14 (merge 074413a), so the missing-boundary normalization it added does not cover this interleaving. The empty first reasoning part with only a generationId looks like output_item.added opened :0, then reasoning_summary_part.added for index 1 arrived while :0 was still active. The provider stream is not retained so I cannot say whether the Vercel AI Gateway reorders the events or OpenAI emits them that way.

Workaround: removing reasoningSummary: "auto" from the sol model settings. No crash since, at the cost of not seeing reasoning summaries.

Happy to run a debug build or add stream capture if that helps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions