Skip to content

AI Gateway traffic splitting returns 400 when multiple model versions configured #60

@zjacobson1016

Description

@zjacobson1016

Summary

Configuring AI Gateway traffic splitting between multiple model versions of the same family (e.g. databricks-claude-opus-4-7 and databricks-claude-opus-4-6) causes requests from ucode to fail with HTTP 400.

Expected behavior

When AI Gateway traffic splitting is configured across model versions, ucode-launched coding agents should route requests successfully according to the gateway endpoint configuration.

Actual behavior

  • AI Gateway endpoint has traffic splitting enabled between model versions (e.g. opus-4-7 and opus-4-6)
  • Launching an agent via ucode (e.g. ucode claude) results in a 400 error
  • Agent fails to connect or complete requests through the gateway

Example scenario

  • Workspace AI Gateway configured with traffic split between:
    • databricks-claude-opus-4-7
    • databricks-claude-opus-4-6
  • ucode claude fails with 400

Possible causes

  • ucode may be sending a specific model ID in headers/env that conflicts with traffic-split endpoint routing
  • Claude Code default model env vars (ANTHROPIC_DEFAULT_OPUS_MODEL, etc.) may not align with split endpoint expectations
  • Gateway may require a different model identifier when splitting is enabled

Suggested investigation

  • Capture the exact 400 response body from AI Gateway
  • Compare request headers/model IDs sent by ucode vs. a working direct gateway call
  • Document supported traffic-split configurations for coding agent integration

Environment

  • ucode (latest)
  • Databricks AI Gateway v2 with traffic splitting enabled
  • Claude (opus family); may affect other agents as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions