Skip to content

feat(api): the last English reasons on the wire are coded - #178

Merged
fylorn merged 1 commit into
mainfrom
feat/api-last-english
Sep 24, 2026
Merged

fylorn merged 1 commit into
mainfrom
feat/api-last-english

Conversation

@fylorn

@fylorn fylorn commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #174/#176: the remaining UI-facing reasons that were plain English strings.

Field / code Now
KeySyncFailed.error Msg — the adoption plan/apply error's own code (adopt.*)
PricingStatus.error Msg — the refresh error's code (control.pricing.*), the same one /pricing/refresh returned
TurnView.error Msg — read from error_code / error_args like HistoryRow.error
control.chatgpt_backend_unreachable removed: the data plane's coded reason (gw.upstream.*) plus Msg::in_context (backend = chatgpt)

control.chatgpt_backend_status already carries the backend's body as a passthrough argument and control.chatgpt_backend_not_json has no English argument, so both stay.

Swept every String field in tw-api whose name suggests text (error/reason/message/detail/why/…). What stays a string is not our sentence: DryRunResult.reason (the deny reason the user wrote), excerpts and samples, ToolCallFlagged.why / SecurityRuleView.why (English rule explanations the UI looks up by rule id), ResetCreditView.title (upstream text).

CONTROL_API_VERSION 15 → 16. msg-codes.txt updated.

Local: fmt, clippy (--all-targets and --lib), workspace tests, ts steps (clippy, tests, export, tsc --strict).

🤖 Generated with Claude Code

- KeySyncFailed.error: the adoption plan/apply error's own coded message
- PricingStatus.error: the refresh error's coded message (the same one the
  refresh call returned)
- TurnView.error: read with its code and arguments, like HistoryRow
- the ChatGPT account endpoints' "could not be reached" keeps the data
  plane's coded reason and adds the context with Msg::in_context, so
  control.chatgpt_backend_unreachable (a {detail} wrapper) is gone;
  control.chatgpt_backend_status already carries the backend's body as a
  passthrough argument

The rest of the text-like strings in tw-api are user text, upstream text
or rule explanations looked up by rule id.

CONTROL_API_VERSION is 16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 2e99a36 into main Sep 24, 2026
4 checks passed
@fylorn
fylorn deleted the feat/api-last-english branch September 24, 2026 11:45
@fylorn fylorn mentioned this pull request Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant