Repository navigation
fix(i18n): code AI text-generation failures for commit, PR, and Jira title generation - #35669
Conversation
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR adds stable error codes for AI commit messages, PR details, and Jira titles. Main keeps the English message, while renderer clients translate known codes.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
No actionable comments were generated in the recent review.
|
Summary
AI text-generation failures (commit message, pull request details, Jira title summary) were authored in English in main and shown as-is. They now carry a stable
errorCode(pluserrorParams/errorDetail) and the renderer shows them in the UI language.What Changed
src/shared/text-generation-failure-copy.ts: one English table plustextGenerationFailure(code, values). Main builds the Englisherrorfrom this table, so it is byte-identical to before. Value types come from the template slots.emptyResultNamefragment, which is now derived fromoperationerrorDetailand is never translated. When the macOS Tailscale DNS hint is appended (English-only), the message stays uncoded.generateCommitMessage,generatePullRequestFieldsand the Jira summary function; these now carry the coded fields through. The runtime RPC methods and IPC handlers pass results through unchanged.lib/text-generation-error-copy.tsmaps each code to a literaltranslatekey, with the shared English as fallback. The localizer is applied in the runtime generation clients (IPC and RPC paths for commit, PR, and Jira summary), so every caller gets localized text. An unknown code, a missing code (older host) or a missing slot value falls back to the host's Englisherror.sourceControl.textGeneration.errors.*keys in all 11 locales.Wire changes are additive only:
erroris unchanged, and the new optional fields are plain strings and records, with no zod or.strict()schema involved.Why
Part of the main → renderer coded-copy work for #32207.
Linked Issue
Refs #32207
Visual Proof
N/A — copy/i18n only.
Testing
pnpm tc— passpnpm test src/main/text-generation src/main/ipc/filesystem src/main/ipc/jira src/main/network src/main/runtime/runtime-git-generation-admission.test.ts src/renderer/src/runtime src/renderer/src/components/task-page/jira src/renderer/src/lib/text-generation-error-copy.test.ts: 441 files and 3659 tests pass. Existing failure assertions moved fromtoEqualtotoMatchObjectbecause the results now carry extra code fields; their English strings are unchanged.text-generation-error-copy.test.tscovers: a known code shows the Spanish text with the label and detail verbatim; the producer's English is unchanged; an uncoded, unknown, incomplete, or prototype-key failure shows the English.pnpm sync:localization-runtime-catalog,verify:localization-catalogs/-catalog/-extraction/-coverage/-runtime-catalog— passpnpm check:changed --maxWorkers=2: the first run hit one lint finding (fixed) plus failures caused by a concurrent commit racing the test-file scan. A clean rerun could not finish on the loaded host, so CI is the gate.