Skip to content

400 with empty error body when context contains regional-indicator pairs (flag emoji, e.g. ๐Ÿ‡น๐Ÿ‡ผ)ย #51348

Closed as not planned

Description

@VaiyHuang

Summary

Requests whose conversation context contains regional-indicator symbol pairs (U+1F1E6โ€“U+1F1FF โ€” e.g. the flag sequence ๐Ÿ‡น๐Ÿ‡ผ = U+1F1F9 U+1F1FC) are rejected by the opencode.ai/zen/go gateway with HTTP 400 and an empty error body:

{"model":"deepseek-flash"}

(31-byte response family; the error field is absent entirely.) No error.type, no message โ€” clients can only report "400" with zero diagnostic information.

Reproduction (single-variable mutation test)

Same request body; only the user text differs:

Probe Content Result
baseline Reply with the single word OK. 200 ร—7 (interleaved in same window)
๐Ÿ‡น๐Ÿ‡ผ pair Reply OK if you can see this flag: ๐Ÿ‡น๐Ÿ‡ผ 400 ร—10
๐Ÿ‡ฉ๐Ÿ‡ช pair (control) another flag 200
๐Ÿ‡ญ๐Ÿ‡ฐ / ๐Ÿ‡บ๐Ÿ‡ธ / ๐Ÿ‡ฏ๐Ÿ‡ต (controls) other flags 200
lone regional indicator single U+1F1F9 200
ordinary emoji ๐Ÿ˜€ 200
full CJK text, no emoji ใ€ไบšๆดฒใ€‘ๅฐๆนพๅฎถๅฎฝ02ไธจไธ“็บฟ 200

Interleaved timeline against the same gateway in one window: 200 โ†’ 400 400 โ€ฆ โ†’ 200 โ€” the trigger is the content, not timing or rate.

  • Endpoint: POST /v1/messages (Anthropic Messages), model deepseek-flash
  • Context size: 55kโ€“154k tokens (well under any context limit)
  • First observed: 2026-09-24 15:59 UTC
  • Deterministic whenever the code-point sequence is present at this size

Why this is probably not #51201 / #50761

Impact

Behind Claude Code auto mode, the permission classifier sends the full conversation context on every tool call. It receives this 400 โ†’ fail-closed โ†’ every file/bash write is blocked for the rest of the session. One content match bricks the session until the context is scrubbed or the model is switched.

Side observation: a different provider (DeepSeek official API) rejects the same content with an explicit 400 Content Exists Risk message โ€” so upstream content moderation on this sequence is plausible. If zen/go moderates this content too, that is fine โ€” but please return a descriptive error (standard Anthropic error envelope with type/message) instead of an empty body, so clients can distinguish "content rejected" from "gateway broken".

Ask

  1. Either stop rejecting regional-indicator pairs, or
  2. Return a proper error payload identifying the rejected content class.

Activity

  1. github-actions commented on Sep 25, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Please use the Bug Report issue template and include its required Description field. The current report has a Summary section instead.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    • #46378: Unicode message content triggers HTTP 400 errors through OpenCode Go (different model and character).
    • #48180: DeepSeek Go requests return HTTP 400 with an unhelpful error body (different request trigger).

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Sep 25, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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