Skip to content

Bug: claude-opus-4.7 via GitHub Copilot fails with 'output_config: Extra inputs are not permitted' #24527

Description

@jimicze

Bug Report

Description

When using claude-opus-4.7 model via the github-copilot provider, every LLM request fails immediately with:

AI_APICallError: output_config: Extra inputs are not permitted

The model is completely unusable — no response is ever generated.

Steps to Reproduce

  1. Configure OpenCode to use github-copilot provider with claude-opus-4.7 model
  2. Start a session and send any message
  3. Request fails with the error above

Expected Behavior

The request should succeed and the model should respond normally.

Actual Behavior

The API call to https://api.githubcopilot.com/v1/messages is rejected with a Pydantic validation error. OpenCode includes an output_config field in the request body that claude-opus-4.7 does not accept.

Log Evidence

From ~/.local/share/opencode/log/:

ERROR service=llm providerID=github-copilot modelID=claude-opus-4.7
  error=AI_APICallError url=https://api.githubcopilot.com/v1/messages

ERROR service=session.processor
  error=output_config: Extra inputs are not permitted
  stack=AI_APICallError: output_config: Extra inputs are not permitted

The error occurs on every request attempt, twice per attempt (first try + retry).

Root Cause (Hypothesis)

OpenCode unconditionally includes an output_config field in the Anthropic Messages API request body. The claude-opus-4.7 model as exposed via GitHub Copilot proxy (api.githubcopilot.com/v1/messages) does not support this parameter and rejects it with Pydantic strict-mode validation error.

output_config appears to be a newer/experimental Anthropic API feature (possibly for extended thinking or output format configuration) not yet supported by all models or provider proxies.

Suggested Fix

Conditionally omit output_config from the request body when the model/provider does not support it, or implement a fallback retry without the parameter when this specific error is received.

Test Results

Version Config Result
v1.14.29 claude-opus-4.7 without reasoningEffort ✅ works
v1.14.18 claude-opus-4.7 + reasoningEffort: medium ❌ fails (original bug)
dev (0.0.0-dev-202604281959) claude-opus-4.7 + reasoningEffort: medium ✅ fixed

Environment

  • OpenCode version: v1.14.18 (latest at time of report; current latest is v1.14.29)
  • Provider: github-copilot
  • Model: claude-opus-4.7
  • Platform: macOS (darwin)
  • API endpoint: https://api.githubcopilot.com/v1/messages

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 26, 2026
  2. github-actions commented on Apr 26, 2026

    @github-actions
    Contributor

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

    If these don't fully cover your case, please add a note on what's different so maintainers can track it separately.

  3. jimicze commented on Apr 26, 2026

    @jimicze
    Author

    @github-actions no, its different bug

  4. jimicze commented on Apr 26, 2026

    @jimicze
    Author

    Response to Duplicate Check

    After thoroughly investigating all three referenced issues, I can confirm this is not a duplicate of any of them. Here is a detailed breakdown:


    #23500 — claude-opus-4.7 + thinking.type.enabled not supported

    Superficially similar: Same model (claude-opus-4.7) and same provider (github-copilot).

    Why it is NOT the same:

    In short: #23500 is a reasoning-mode misconfiguration. Our issue is output_config being sent to a model that does not accept it at all, even without reasoning.


    #23342 — Haiku 4.5 + eager_input_streaming: Extra inputs are not permitted

    Superficially similar: Same error pattern (Extra inputs are not permitted).

    Why it is NOT the same:

    In short: The only commonality is the generic Pydantic error text Extra inputs are not permitted. The field, model, and root cause are all different.


    #22788 — claude-opus-4.6 + output_config.effort "max" not supported

    Superficially similar: Both involve output_config and GitHub Copilot.

    Why it is NOT the same — this is the most important distinction:

    In short: Same field name, completely different error semantics. #22788 = wrong value in an accepted field. Ours = field not accepted at all.


    Summary Table

    #23500 #23342 #22788 Our issue #24527
    Model claude-opus-4.7 claude-haiku-4.5 claude-opus-4.6 claude-opus-4.7
    Provider github-copilot github-copilot github-copilot github-copilot
    Rejected field thinking.type eager_input_streaming output_config.effort (value) output_config (field itself)
    Error type Wrong format Unknown field in tools Invalid value Unknown top-level field
    Requires reasoning mode Yes (high/max) No Yes (max) No — fails always
    Root cause Missing model in isAnthropicAdaptive list eager_input_streaming added to tool schemas max effort not supported by copilot output_config sent unconditionally without reasoning
    Fix Add opus-4.7 to adaptive list Remove eager_input_streaming from tools Cap effort at high Omit output_config when model rejects it / not in reasoning mode

    Additional Technical Detail for Our Issue

    From the OpenCode log (~/.local/share/opencode/log/2026-04-26T174704.log):

    • The error occurs twice per message attempt (first try + immediate retry), both failing identically
    • The request body includes max_tokens: 32000 — this is the orchestrator agent, not a simple query
    • No thinking/reasoning was configured in the session
    • The error is thrown synchronously before any tokens are streamed: +1699ms / +1869ms — immediate API rejection, not a mid-stream failure
    • Stack trace points to chunk-3f8tjbdd.js:6:14583 (bundled OpenCode core)
    • After two failures the session enters idle state and the user must retry manually

    The fix should conditionally omit output_config from the request when:

    1. No reasoning/thinking mode is active, OR
    2. The model is claude-opus-4.7 (or similar) which does not accept this field without reasoning context, OR
    3. Implement graceful retry without output_config upon receiving this specific error response
  5. elsammykins commented on Apr 27, 2026

    @elsammykins

    can confirm I'm seeing the exact same issue with 1.14.26

  6. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    How are you hitting it? Does github copilot not support setting reasoning for opus 4.7 at all?

  7. thesammykins commented on Apr 27, 2026

    @thesammykins

    How are you hitting it? Does github copilot not support setting reasoning for opus 4.7 at all?

    I'm under the impression they've removed being able to set reasoning for opus 4.7, even via copilot-cli they've removed being able to change it.

  8. jimicze commented on Apr 27, 2026

    @jimicze
    Author

    There was an option to set it only to medium.

    But users are pissed off... By this limitation, they were unable to see this option, because it's the only one, and set 'medium' as the default, hiding the options to see it / change it.

  9. jimicze commented on Apr 27, 2026

    @jimicze
    Author

    Clarification for @rekram1-node — How We Hit It + Config Details

    To directly answer your question: No, GitHub Copilot no longer supports setting reasoning for claude-opus-4.7 at all.

    How We Were Hitting It

    At the time of the bug, our OpenCode config had:

    "agent": {
      "plan": {
        "model": "github-copilot/claude-opus-4.7",
        "reasoningEffort": "medium"
      }
    }

    reasoningEffort: "medium" — not because we chose medium, but because it was the only option GitHub Copilot exposed for claude-opus-4.7. There was no high or max available for this model via Copilot.

    This causes OpenCode to include output_config in the API request body. GitHub Copilot then silently removed all reasoning support for claude-opus-4.7, including medium — and now rejects output_config entirely with Extra inputs are not permitted.

    The Timeline

    1. GitHub Copilot exposed only medium reasoning effort for claude-opus-4.7
    2. Users set reasoningEffort: "medium" as it was the only available option
    3. GitHub Copilot removed reasoning support entirely for claude-opus-4.7 — including medium
    4. Now any request with output_config in the body is rejected, breaking all sessions using this model with any reasoningEffort setting

    Why This Is an OpenCode Issue (Not Just a User Config Error)

    The failure mode is silent and confusing:

    • OpenCode accepts reasoningEffort: "medium" in config without warning
    • When GitHub Copilot removes support, the session fails with a cryptic API error
    • There is no fallback, no warning, no graceful degradation
    • The user has no indication from the error that removing reasoningEffort from config would fix it

    Suggested Fix

    1. Retry without output_config: On receiving Extra inputs are not permitted for output_config, retry without it and emit a user-visible warning
    2. Capability detection: Track which models/providers support output_config and skip it when not supported
    3. Config validation warning: When reasoningEffort is set for a model/provider known not to support it, warn at startup rather than failing silently at runtime

    Workaround for Affected Users

    Remove reasoningEffort from the claude-opus-4.7 agent config in opencode.json:

    "agent": {
      "plan": {
        "model": "github-copilot/claude-opus-4.7"
      }
    }

    This stops OpenCode from sending output_config in the request and the model works normally.

  10. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    @jimicze undo whatever config change u made to get around bug and show me opencode debug config I think a plugin or soemthing is causing errors for you, output_config should work

  11. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    @rekram1-node Here is opencode debug config:

    {
      "$schema": "https://opencode.ai/config.json",
      "agent": {
        "plan": {
          "model": "github-copilot/claude-opus-4.7",
          "reasoningEffort": "medium",
          "options": {
            "reasoningEffort": "medium"
          },
          "permission": {}
        },
        "build": {
          "model": "github-copilot/claude-sonnet-4.6",
          "reasoningEffort": "high",
          "options": {
            "reasoningEffort": "high"
          },
          "permission": {}
        },
        "general": {
          "model": "github-copilot/claude-sonnet-4.6",
          "reasoningEffort": "high",
          "options": {
            "reasoningEffort": "high"
          },
          "permission": {}
        },
        "explore": {
          "model": "github-copilot/claude-sonnet-4.6",
          "reasoningEffort": "medium",
          "options": {
            "reasoningEffort": "medium"
          },
          "permission": {}
        }
      },
      "provider": {
        "lmstudio": {
          "name": "LM Studio (local)",
          "npm": "@ai-sdk/openai-compatible",
          "options": {
            "baseURL": "http://127.0.0.1:1234/v1"
          },
          "models": { ... }
        }
      },
      "mcp": {
        "playwright": { "type": "local", "command": ["npx", "@playwright/mcp@latest"] },
        "context7": { "type": "local", "command": ["npx", "-y", "@upstash/context7-mcp@latest"] }
      },
      "compaction": { "auto": true, "prune": true, "reserved": 20000 },
      "plugin": [],
      "username": "xxxx"
    }

    No plugins installed ("plugin": []). Only MCP servers (Playwright and Context7).

    The only non-default things are:

    • Custom agents with reasoningEffort settings
    • LM Studio as a local provider (not used for claude-opus-4.7)
    • Two MCP servers
  12. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    This may fix your issue:
    0acac21

    I'm just not really sure how this is even possible?

    Maybe you can send me a session you hit it in or soemthing?

  13. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    Session has some extra log?

  14. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    Here's the relevant session log excerpt (two attempts — first try + immediate retry, both fail identically):

    Attempt 1 (+1699ms — immediate API rejection):

    ERROR service=llm providerID=github-copilot modelID=claude-opus-4.7 agent=orchestrator mode=primary stream
    ERROR service=llm providerID=github-copilot modelID=claude-opus-4.7 agent=orchestrator mode=primary
      url: https://api.githubcopilot.com/v1/messages
      requestBodyValues: { model: "claude-opus-4.7", max_tokens: 32000, output_config: { effort: "medium" }, ... }
      AI_APICallError: output_config: Extra inputs are not permitted
    ERROR service=session.processor error=output_config: Extra inputs are not permitted
      stack: AI_APICallError at chunk-3f8tjbdd.js:6:14583
    

    Retry (+1869ms — identical failure):

    ERROR service=llm providerID=github-copilot modelID=claude-opus-4.7 agent=orchestrator mode=primary
      url: https://api.githubcopilot.com/v1/messages
      requestBodyValues: { model: "claude-opus-4.7", max_tokens: 32000, output_config: { effort: "medium" }, ... }
      AI_APICallError: output_config: Extra inputs are not permitted
    ERROR service=session.processor error=output_config: Extra inputs are not permitted
      stack: AI_APICallError at chunk-3f8tjbdd.js:6:14583
    

    Both attempts reject instantly before any tokens stream. Session goes idle after the retry.

    Also — does the fix in 0acac21 address this? From reading the patch it looks like it now reads reasoning_effort from the Copilot API response dynamically, so if Copilot reports no reasoning support for opus-4.7, no variants are built and output_config won't be sent. That matches exactly what we're seeing.

  15. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    Additional context on the agent config — at the time of the error, the orchestrator agent was set to:

    "agent": {
      "orchestrator": {
        "model": "github-copilot/claude-opus-4.7",
        "reasoningEffort": "medium",
        "mode": "primary"
      }
    }

    (custom prompt omitted — the rest of the spec is standard)

    This is why the log shows agent=orchestrator modelID=claude-opus-4.7 — it was a custom primary agent backed by opus-4.7 with medium reasoning effort. The output_config: { effort: "medium" } was being sent on every request because of the reasoningEffort: "medium" setting.

  16. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    I unfortunately cant test this at all but I thought medium reasoning effort and adaptive reasoning are supported for that copilot model

  17. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    If you use the model without a variant selected, does it work as expected?

    You can try the patch using bunx opencode-ai@dev

  18. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    OK i will try both cases

  19. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    Tested both cases:

    Test A — current release, claude-opus-4.7 without reasoningEffort:
    Works fine. No output_config error.

    Test B — dev build (bunx opencode-ai@dev), claude-opus-4.7 + reasoningEffort: medium:
    Fix confirmed. No Extra inputs are not permitted error.

    Side note: noticed slightly laggy output rendering in the dev build — output appeared character by character with noticeable delay. Not sure if that's expected or a separate regression.

  20. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    Looking at the original session log, the prompt that triggered the bug was simply:

    What did we do so far?
    

    No special content needed — any prompt sent to the orchestrator agent configured with claude-opus-4.7 + reasoningEffort: medium would reproduce it. The error fired consistently on every request (first attempt + retry, both failed with output_config: Extra inputs are not permitted).

    In case it's useful for a regression test.

  21. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    Tested on both v1.14.29 (current latest) and bunx opencode-ai@dev — both seem to be working fine.

  22. jimicze commented on Apr 28, 2026

    @jimicze
    Author

    @rekram1-node just noticed that it also seems to work fine on v1.14.29 (not just the dev build). Wondering if the fix from PR #24574 ("split up reasoning transforms", merged 2026-04-27) already addressed this — it landed between v1.14.26 (where @elsammykins confirmed the bug) and v1.14.29. Was that intentional, or was there another related change?

  23. rekram1-node commented on Apr 29, 2026

    @rekram1-node
    Collaborator

    Nah that wouldnt have done anything

  24. rekram1-node commented on Apr 29, 2026

    @rekram1-node
    Collaborator

    Alr ig we fixed it feel free to ping me on discord if it continues but ill try to monitor issue

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions