Skip to content

[Bug] OpenCode Go deepseek-v4-pro sends an invalid max_completion_tokens value #37947

Closed as not planned

Description

@woohahahaaa

Description

When OpenClaw uses the OpenCode Go provider with deepseek-v4-pro, requests consistently fail before a response is generated:

400 max_completion_tokens=384000 cannot be greater than
max_model_len=max_total_tokens=135168. Please request fewer output tokens.
(parameter=max_completion_tokens value=384000)

The request appears to send max_completion_tokens=384000, whereas the upstream endpoint reports a total context limit of 135168 tokens.

Could you please confirm whether deepseek-v4-pro is mapped to the intended model? The reported context limit is incompatible with the configured completion limit and may indicate an incorrect model or context-limit mapping.

Expected behavior: OpenCode should cap max_completion_tokens to a value compatible with the actual model context window, or derive it from the provider's model metadata.

Plugins

OpenClaw integration / OpenCode Go provider.

OpenCode version

Not available from the OpenClaw integration.

Steps to reproduce

  1. Configure OpenClaw to use the OpenCode Go provider.
  2. Select deepseek-v4-pro.
  3. Send a request.
  4. The provider returns the HTTP 400 error shown above.

Screenshot and/or share link

No share link available. Error output is included above.

Operating System

macOS 15.7.7

Terminal

OpenClaw web interface

Activity

  1. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

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

  2. github-actions commented on Sep 19, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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