Skip to content

Production status API omits translation for English posts requested with lang=ja #2786

Backlog

Description

@iuti

The production status API returned an English post without a status.translation field for each of three English-language posts when I requested Japanese. A Discord bot consuming this endpoint consequently displays the original text. The same response is reproducible with curl, without Discord or a bot token.

Reproduce

curl -fsS -A 'XTranslateDiscordBot/1.0' -H 'Accept: application/json' \
  'https://api.fxtwitter.com/2/status/20?lang=ja' |
  jq '{code, id: .status.id, lang: .status.lang, text: .status.text, has_translation: (.status | has("translation"))}'

Observed (HTTP 200):

{"code":200,"id":"20","lang":"en","text":"just setting up my twttr","has_translation":false}

Scope

Checked on 2026-11-26 at 00:00 UTC. All seven requests returned HTTP 200 on build fixtweet-main-e4d1139-2026-11-25T20:48:46.

Request Result
/2/status/{id}?lang=ja for 20, 1841206275088290279, 1848831595014459513 All three returned status.lang = "en" and omitted status.translation.
/2/status/20?lang=es Also omitted status.translation.
/2/status/20 (control) Original English text, as expected.
/status/{id}/ja for 20 and 1841206275088290279 (legacy API) Both omitted tweet.translation.

Expected: the post retains its original English text and includes a Japanese translation.text when the translation succeeds.

Where to look

The v2 route passes the requested language to the thread builder. The Twitter status processor tries an inline translation and the configured fallbacks, and can return the original post without a translation. Could you check the Worker logs for one of these IDs to see which translation stages ran and what they returned? The public API response alone doesn't identify the failing stage.

Verified fallback bug and existing fix

PR #2785 addresses a concrete way to reach this result. I compared the production revision e4d1139 with the PR head 688d04c by running each revision's translateStatusAI with the same mocked Workers AI replies and the original English text of post 20.

Workers AI reply Production revision PR head
Japanese text in choices[0].message.content, with usage Returns no translated text and skips M2M100 Returns the Japanese text
Japanese text in legacy response, with usage Returns the Japanese text Returns the Japanese text
Empty chat content, with usage Returns no translated text and skips M2M100 Calls M2M100 and returns its translation

This confirms the parsing bug independently of the public API reproduction. Worker logs would still be needed to establish which providers ran for the three live posts. The requests above can serve as post-deployment checks.

Related embed reports: #2698 and #2735. These requests use the JSON API directly and have no tracking parameters.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions