Skip to content

Anthropic-to-OpenAI schema translation #27047

Closed as not planned
Closed as not planned

Description

@DakshUdinia

Description

Description

There is a server-side translation error when using the opencode.ai proxy with tool-enabled clients like Claude Code when targeting DeepSeek models. The proxy fails to correctly nest the tool name within the function object required by the OpenAI/DeepSeek schema.

Error Message

API Error: 400 Error from provider (DeepSeek): Failed to deserialize the JSON body into the target type: tools[0].function: missing field 'name'

Technical Details

When Claude Code sends tool definitions in Anthropic format, the proxy translates them to the OpenAI format. Currently, it appears the proxy is placing the name field at the top level of the tool instead of inside the function wrapper.

Current (Buggy) Translation:
{
"type": "function",
"name": "read_file",
"function": { "description": "...", "parameters": {...} }
}

Expected OpenAI Format:
{
"type": "function",
"function": {
"name": "read_file",
"description": "...",
"parameters": {...}
}
}

Environment

  • Client: Claude Code (CLI)
  • Model: deepseek-v4-flash-free
  • Endpoint: api.opencode.ai/v1

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on May 12, 2026

    @github-actions
    Contributor

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

    If your issue is different or adds new context, please clarify how it differs from #25107.

  2. hoarfrost32 commented on Jun 16, 2026

    @hoarfrost32

    Opened a fix in #32448, could a maintainer approve the CI checks on the PR when you have a moment?

  3. github-actions commented on Aug 16, 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