Skip to content

type 'reasoning' was provided without its required following item. #2628

Description

@vishawdeepsingh-dev

I recently purchased opencode zen but on selecting GPT 5 open code this error is coming

Image

Activity

  1. github-actions commented on Sep 16, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Sep 16, 2025

    @rekram1-node
    Contributor

    related: #2610

  3. rekram1-node commented on Sep 16, 2025

    @rekram1-node
    Contributor

    BTW:

    In your opencode.json:

    {
      "providers": {
          "opencode": {
          "models": {
            "gpt-5": {
              "options": {
                "reasoningSummary": null,
                "include": []
              }
            }
          }
        }
       }
    }
    

    that should fix it
    this basically just makes it so openai doesn't ssend the reasoning summaries, it shouldn't impact model performance afaik
    this is temporary fix^^

  4. thdxr commented on Sep 17, 2025

    @thdxr
    Member

    we disabled the thing that was causing this

  5. ferenci84 commented on Sep 24, 2025

    @ferenci84

    I commented this to an other issue, but copy here too:

    I just resolved a similar issue while I was implementing the responses API endpoint support in Continue.dev. The easiest resolution of the issue is to save the id field for all LLM-generated blocks and feed it back to the model. The problem with not including the encrypted_content is that the reasoning is lost between the tool calls, and the model have to think again.

    Below is my findings in details:

    Actual input (with bug):

    {
      "input": [
        {
          "role": "developer",
          "content": "[REDACTED_LONG_TEXT]"
        },
        {
          "role": "developer", 
          "content": "[REDACTED_LONG_TEXT]"
        },
        {
          "role": "user",
          "content": [
            {
              "type": "input_text",
              "text": "Show me the file tree of the ./src directory. Use the bash tool."
            }
          ]
        },
        {
          "type": "reasoning",
          "id": "rs_68d39705879881968df1eb77287e9d280454b285d187bb88",
          "summary": [
            {
              "type": "summary_text",
              "text": "**Exploring command options**\n\n[REDACTED_REASONING_CONTENT]"
            },
            {
              "type": "summary_text", 
              "text": "**Planning Python file listing**\n\n[REDACTED_REASONING_CONTENT]"
            },
            {
              "type": "summary_text",
              "text": "**Implementing file tree logic**\n\n[REDACTED_REASONING_CONTENT]"
            },
            {
              "type": "summary_text",
              "text": "**Implementing Python tree structure**\n\n[REDACTED_REASONING_CONTENT]"
            },
            {
              "type": "summary_text", 
              "text": "**Constructing command for file tree**\n\n[REDACTED_REASONING_CONTENT]"
            }
          ]
        },
        {
          "role": "assistant",
          "content": [
            {
              "type": "output_text",
              "text": "Goal: Display a tree view of the ./src directory using the bash tool.\n\nPlan:\n- Use a Python one-liner via bash to recursively walk the src directory and print a hierarchical tree.\n- Avoid disallowed commands like ls/find/grep and ensure paths are quoted and absolute.\n- Return the printed tree directly.\n\nExecuting now..."
            }
          ]
        },
        {
          "type": "function_call",
          "call_id": "call_LzJHggt1Y0E5vEI2AZuGexvG", 
          "name": "bash",
          "arguments": "{\"command\":\"python3 -c \\\"import os; from pathlib import Path; root=Path('./src'); print(root.name); import sys; \\nfor current, dirs, files in os.walk(root):\\n    current=Path(current); depth = 0 if current==root else len(current.relative_to(root).parts); indent = '    ' * depth; \\n    if current != root: print(indent + current.name); \\n    for f in sorted(files): print(indent + '    ' + f)\\\"\",\"timeout\":120000,\"description\":\"Prints tree view of src directory\"}"
        },
        {
          "type": "function_call_output",
          "call_id": "call_LzJHggt1Y0E5vEI2AZuGexvG",
          "output": "[REDACTED_LONG_OUTPUT]"
        }
      ]
    }

    Working input:

    {
      "input": [
        {
          "role": "developer",
          "content": "You are intelligent, helpful and an expert developer, who always gives the correct answer and follow instructions.",
          "type": "message"
        },
        {
          "role": "user", 
          "content": "Show me the file tree of the ./src directory. Use the run_terminal_command tool.",
          "type": "message"
        },
        {
          "id": "rs_68d399138740819494f52fc24c0cd08a0632cb035d829222",
          "type": "reasoning", 
          "summary": [
            {
              "type": "summary_text",
              "text": "**Executing terminal command**\n\n[REDACTED_REASONING_CONTENT]"
            }
          ],
          "encrypted_content": "gAAAAABo05kTutMoY2GZA4Be61B99_WBl4Kd3RuMHfExK8SUGT0XQzsNx_pBPpNHLPre3b8q8OYqJVBAzn4yFbS8MQIpAAz1MIu2VpvGs6osIlYWXDx85OxEJJPgm-NJob7NV4MZ9t1jJpQ9fWvEhFWTwmbZKC_2pU2D7datNQvMuLuNvsMHlQwNdxO043-y4dXL7hWBOZ9GsmUrTHqyDXOM9zYTZQF1B51W59-THzKmFPoHne4vMC5qstxwrMF7FjoWYO2mE7O5Yrot347uhdf9nimvJ7SkIzXgkmo8g-81o3MBJh-sulJhMZuj3Deot06BHaz31c_4faSNqTUO-NMitRvJZm_GhOl1K7o0I_NYMoRSX50cJw6Q1dV8lMpFcwCloyKBG-hnsyNQOyk9Zff92S1Ox59PKU2QAPo7kD8PcR6oMosZ2lVJtijSQdWJdb6fPf822qqbVhKLWsrbg-CVjoAmur9NL3UYH9jtu-B1Z1K14MmbMzAMxCbvxIGqV_Rl_nx0X5jJsIpIzrVjfYSAxkd1SIudR8ekenWEJ98DHQFIQgBInYm_Ildb6TzXMgXCddoOaZORzJfQ_yLgpERYqDlbCnQ3EY76uNaih7lsvdpx7UHYV2MUJKSjqcDoxZ3R5i8jkCk0X_U8Hs8JUEj9ei40ju9aCpQJsGqmvWbnjzmYQ8YuZh2JvCkfU40S56Ny5bQt1m_GfVaPXZvZte5udkrn9-8vV9x6JXgW3gtVDe5Drw6N0lvmxw1GhIQzjiJvtRace6WW_mtctx_ygD6FK4G2oWhRjMwkgaksK9bwHxszLgzCvH4="
        },
        {
          "id": "fc_68d3991a25c481948ed501f489af4b9c0632cb035d829222",
          "type": "function_call",
          "name": "run_terminal_command", 
          "arguments": "{\"command\": \"ls -laR ./src\", \"waitForCompletion\": true}",
          "call_id": "call_E2EH6FD4vea7tWphlai0HVDo"
        },
        {
          "type": "function_call_output",
          "call_id": "call_E2EH6FD4vea7tWphlai0HVDo",
          "output": "[REDACTED_LONG_OUTPUT]"
        }
      ]
    }

    Differences:

    • In the opencode generated input, the ID is missing from the tool call - this is what causes the
    • encrypted content is not fed back to the model - this doesn't cause API error, but the model may need to rethink everything after each tool call

    Note: The above buggy input was generated with the version 0.11.3. I am using the 0.7.9 version, and it's generated input is similar to the above "Working input", it has the id in the function call, and has the encrypted_content in the reasoning blocks.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions