Skip to content

bug(platform): Qwen Code on an Anthropic model fails every run with a 400 on tools.2.custom.input_schema #5353

Closed

Description

@yannickmonney

Summary

A project agent that runs on Qwen Code with an Anthropic model through the sandbox LLM gateway fails every run at its first model call with API Error: 400 tools.2.custom.input_schema: Field required. The same agent on an OpenAI model settles. The runtime picker documents that it hides models a runtime cannot serve (Responses-only models appear for Codex only), and it does not hide Anthropic models for Qwen Code, so the combination is offered and then fails at run time.

Anchors are at main 7d7b1ee98 (2026-11-04). Observed on the v0.5.98 tag with the published 0.5.98 sandbox images.

What the repo says today

  • docs/en/platform/agents/harnesses.md:28 lists Qwen Code as "Managed or direct".
  • docs/en/platform/agents/harnesses.md:12 says a model whose tool calls need OpenAI's Responses API "runs only on Codex, so the model picker offers it for no other runtime". No sentence says anything about which models Qwen Code can use.
  • Qwen Code is wired through services/sandbox-runtime/tale-qwen-run (a gemini-cli fork; the wrapper stages settings, mcpServers and tools.exclude per exec, see its docstring at :1-31) and the exec fixtures services/platform/lib/harnesses/fixtures/exec/qwen-code.yml. The gateway directory services/sandbox-llm-gateway holds no translation code of its own: it is the Bifrost image plus provisioning.
  • services/platform/lib/harnesses/fixtures/qwen-code/authentication-error-turn.yml is the only captured Qwen Code failure turn; there is no fixture for an upstream 400.

What was observed

Setup: an isolated stack from the v0.5.98 tag, one custom OpenAI-compatible provider pointing at a Bifrost gateway (apiFormat: openai, catalog.source: models-endpoint), the Standard agent's runtime set through governance/standard-agent.yml, one small task per runtime ("write a script that prints 6*7 and put the result in a deliverable").

Runtime Model Result
claude-code, claude-code-compact, gemini, hermes, openclaw, opencode, pi anthropic/claude-haiku-5-5 (Claude Haiku 5.5) settled, expected output, deliverable
qwen-code openai/gpt-6-luna settled, expected output
qwen-code anthropic/claude-haiku-5-5 failed, failure_code harness_error, error text [API Error: 400 tools.2.custom.input_schema: Field required]
  • The error text is Anthropic's request validation: the third entry of the tools array (index 2) reached the Anthropic API without an input_schema. Which tool that is was not examined.
  • The failure repeated on all five runs tried; it is not a one-off. Codex also settled, on its own model choice (not Haiku), so it is not in this comparison.
  • git diff v0.5.97..v0.5.98 over services/sandbox-llm-gateway, services/platform/lib/harnesses and services/sandbox-runtime is empty, so this is not a v0.5.98 regression.
  • Not examined: other Anthropic models, other Qwen Code versions than the one in the 0.5.98 runtime image, a direct (non-managed) Qwen Code run, whether the missing input_schema comes from a tool Qwen Code defines, from an MCP tool the wrapper stages, or from the gateway's OpenAI-to-Anthropic translation.

Constraints any change must respect

  • Managed runs call only through the gateway with a session-scoped key (docs/en/platform/agents/harnesses.md:38).
  • Qwen Code's tool set depends on what tale-qwen-run stages, so a fix on the Tale side and a fix in the gateway image are different amounts of work.

Options

  • Find which tool at index 2 lacks a schema and where it comes from, then decide whether the owner is Tale (wrapper or staged MCP config), the Qwen Code release, or the gateway.
  • Keep Anthropic models out of the picker for Qwen Code, the way Responses-only models are kept out for other runtimes.
  • Leave the combination as is and document it in harnesses.md.
  • Fail the run earlier with a Tale message that names the runtime and model, instead of the raw upstream 400.

Questions

  • Is Qwen Code on an Anthropic model a supported combination?
  • If not, where should the restriction live (picker, validation on save, docs only)?

Related

  • Found during a full agents check on v0.5.98 (Standard agent, custom agent, mention follow-up, cancel, automation task.start_agent, agent secret, connected agents all passed).

Activity

  1. added
    agent-ready
    on Nov 4, 2026
  2. tale-review-bot commented on Nov 4, 2026

    @tale-review-bot
    Collaborator

    Decision: no dependency change for now. Qwen Code keeps anthropicModels: false (option (c)).

    The question. Should Tale take a dependency change, either the Bifrost gateway image or the Qwen Code release in the runtime image, so that Qwen Code can run models served through Anthropic's API?

    The options I weighed

    • (a) A Bifrost release that defaults input_schema. None exists.
      • Bifrost's newest gateway release is transports/v2.4.0 (2026-10-29).
      • Its main is still b84656d64490db01084cbe3d5dcd05ab5b2d098e, the commit the Coder read. It has the same check in core/providers/anthropic/chat.go:62.
      • Moving Tale's pin off v2.2.4 (services/sandbox-llm-gateway/Dockerfile:28) would change the gateway and fix nothing here.
    • (b) A Qwen Code release that keeps parameters. None exists either. I checked the releases the handover left open.
      • The newest release is v0.26.7 (f45c34d8ccbd651f2f0f4d97c9b013c11af52f5b, 2026-11-04). It still sets parameters to undefined for a tool that declares no arguments (packages/core/src/core/openaiContentGenerator/converter.ts:446-455).
      • That is the same branch as in v0.24.7 (b12edec1401a28fc53cd9e714d5928b285071fc8, lines 444-453), the version Tale pins (services/sandbox-runtime/Dockerfile:515).
    • A patched or forked Bifrost or Qwen Code. Tale would carry a fork of an outside dependency for one model family on one runtime.
    • (c) Keep the restriction. Qwen Code users lose the Claude models, and in return get a Tale message that names the model and the runtime instead of a 400 on every turn. Undoing it is one line in qwen-code/harness.yml.

    What I decided, and why: (c). It is the only option that exists today, and it can be undone.

    • The fix belongs upstream. OpenAI's chat wire lets Qwen Code leave out parameters.
    • A translator onto Anthropic's Messages API has to supply the input_schema that Anthropic requires. So the natural owner is Bifrost, not Tale.

    Reporting upstream. Tale's agents post nothing on another project's tracker: their GitHub writes are limited to tale-project/tale. Nothing here waits for a report. The evidence above names the version, the file and the line in both projects.

    What would change this decision. A release of either project that sends a schema for a tool without arguments:

    • a Bifrost release whose convertFunctionToolToAnthropic sets an input_schema (for example {"type":"object"}) when parameters is absent or empty, or
    • a Qwen Code release that keeps parameters for such a tool.

    When one exists, a single change bumps that pin and removes anthropicModels: false from qwen-code/harness.yml. Its proof is a live Qwen Code turn on a Claude model. Whoever next bumps either pin checks these two places first. The issue for that change is filed when such a release exists, not before.

    For TALE-439 nothing changes. The question was non-blocking.

    • The change lands as handed over: head 5d334c6b901928790b9d1f212e6eec8cc2754572 on train, Closes #5353.
    • The task stays In review, with Line: stable, kind bug and priority p1 as triage set them.
    • @Reviewer: this decision adds no condition to your review.
  3. added a commit that references this issue on Nov 4, 2026
    4f30243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions