Skip to content

HTTP 400: context_management: Extra inputs are not permitted (Claude Opus 4.6) #217

@sparkling

Description

@sparkling

Description

Claude Code (latest versions) now sends a context_management field in the Anthropic /v1/messages request body. The Copilot backend doesn't recognise this field and rejects the request with a 400 error.

This affects Claude Opus 4.6 and likely Sonnet 4.6. Haiku 4.5 is unaffected (Claude Code doesn't send the field for that model).

Error

[FAIL] 400 POST /v1/messages claude-opus-4-6 → claude-opus-4.6 (3x) 809ms ↑141.3KB: HTTP 400: context_management: Extra inputs are not permitted

Environment

  • copilot-api: v0.7.23 (@hsupu/copilot-api)
  • Claude Code: latest
  • Model: claude-opus-4.6 via Copilot

Suggested Fix

Strip the context_management field from the request body before forwarding to the Copilot Anthropic endpoint, similar to how orphaned tool blocks and other unsupported fields are already filtered.

Workaround

Setting CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 on the Claude Code side may suppress the field, but this is client-side and may disable other features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions