Skip to content

session: interrupted assistant tool-call turn loses reasoning_content on next request #55104

Closed as duplicate

Description

@JosDeGraeve

Summary

Interrupting a running prompt with double Escape leaves the session in a state where the next request fails with:

Upstream request failed: [missing_required_parameter] Missing required parameter:
'messages[152].reasoning_content'. This model needs the reasoning of every
earlier assistant message: send back the 'reasoning_content' returned with that
message.

The interrupted assistant turn contained reasoning + an aborted tool call. On the
following turn OpenCode serializes that earlier assistant message without
reasoning_content, so a reasoning model rejects the whole request and the
session becomes unusable.

Environment

  • opencode version: 2.0.28
  • OS: Linux 6.12.107+deb13-amd64 (Debian, x86_64)
  • Terminal: xterm-256color, COLORTERM=truecolor
  • Shell: /bin/bash
  • Install/channel: latest release (binary ~/.opencode/bin/opencode)
  • Active plugins: none found in config (opencode.jsonc is empty; no plugins configured)
  • Model: opencode/cat-jam-free (a reasoning model requiring reasoning_content)

Reproduction

  1. Use opencode/cat-jam-free in a session with several assistant turns that include reasoning + tool calls.
  2. Start another prompt that executes tools (or streams reasoning).
  3. Press Escape twice while that turn is running to interrupt it. The aborted
    assistant message is retained (reasoning + a tool call whose status becomes
    error/aborted).
  4. Send a new user message.
  5. The request fails with missing_required_parameter: messages[...].reasoning_content.

Expected Behavior

OpenCode should preserve and resend the reasoning for the interrupted assistant
turn (as the model requires for every earlier assistant message), allowing the
session to continue after an interrupt.

Actual Behavior

The request omits reasoning_content for that earlier assistant message and the
provider returns HTTP 400. The session is then stuck: every subsequent turn hits
the same error unless the user switches models/sessions.

Additional Context

  • The offending message in the recorded session is an assistant message with
    finish: "error", rawFinish: "tool_calls",
    error.type: "aborted" ("Step interrupted"), containing a reasoning part
    (state.reasoningField = "reasoning_content") plus a single shell tool call
    with status: "error" / error.type: "aborted".
  • The error index (messages[152]) maps exactly to that assistant message when
    the assistant+tool history is flattened for the upstream request.
  • Logs: ~/.local/share/opencode/log/opencode.log, session
    ses_ecb567d2effeW3uRFAfOgSxand.
  • Workaround tried: none beyond abandoning the session; new sessions work.

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report! I think this is a duplicate of #55096. That issue has been reproduced on 2.0.28 and on current dev. The trigger is an interrupted assistant turn that has reasoning plus a tool call: on the next request that message is sent without its reasoning_content, so the provider rejects every request after it. That matches what you saw.

    Possible duplicates and related issues, ordered from most to least likely:

    Starting a new session is still the workaround for now. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #55096, since there's been no reply in the last day. That issue covers the same problem: an interrupted assistant turn with reasoning and a tool call is sent without its reasoning_content on the next request. It has been reproduced on 2.0.28 and current dev. Please follow #55096 for updates; #38620 and its open PR #54693 cover the same root cause. Starting a new session is still the workaround. If your case turns out to be different, reply here and we can reopen. Thanks for the detailed report!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions