Skip to content

fix(i18n): code AI text-generation failures for commit, PR, and Jira title generation - #35669

Merged
OrcaWin merged 3 commits into
mainfrom
OrcaWin/i18n-main-codes-12
Oct 29, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
OrcaWin/i18n-main-codes-12

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​83 $\color{#cf222e}{\Huge{\mathbf{−}}}$​41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42
Prod 33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​938 $\color{#cf222e}{\Huge{\mathbf{−}}}$​117 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​821

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 (plus errorParams / errorDetail) and the renderer shows them in the UI language.

What Changed

  • New src/shared/text-generation-failure-copy.ts: one English table plus textGenerationFailure(code, values). Main builds the English error from this table, so it is byte-identical to before. Value types come from the template slots.
  • Producers converted:
    • local agent process failures: prompt too large, could not start / failed to start, binary not found, timed out, too much output
    • the Windows batch-script argument failure
    • CLI failed / terminated, with and without CLI output
    • "{{label}} reported an error."
    • empty result: one sentence per result kind, replacing the English emptyResultName fragment, which is now derived from operation
    • unparseable commit message / PR details, Jira summary empty after sanitization
    • Jira request guards: description required, reconnect account, busy in another draft
    • staged/branch-context failures in the Electron IPC handlers and the runtime git commands
  • Agent labels and binary names are interpolated untranslated. Sanitized CLI output travels verbatim as errorDetail and is never translated. When the macOS Tailscale DNS hint is appended (English-only), the message stays uncoded.
  • Results are rebuilt in generateCommitMessage, generatePullRequestFields and the Jira summary function; these now carry the coded fields through. The runtime RPC methods and IPC handlers pass results through unchanged.
  • Renderer lib/text-generation-error-copy.ts maps each code to a literal translate key, 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 English error.
  • Added 30 sourceControl.textGeneration.errors.* keys in all 11 locales.

Wire changes are additive only: error is 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 — pass
  • pnpm 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 from toEqual to toMatchObject because the results now carry extra code fields; their English strings are unchanged.
  • New text-generation-error-copy.test.ts covers: 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 — pass
  • pnpm 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.

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 04:32
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

The 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.

  • Generation failures carry codes and values alongside their English text.
  • Commit, pull-request, and Jira generation errors follow the UI language.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Generation fails] --> B[Build English error and code]
  B --> C[Pass result through IPC or RPC]
  C --> D{Known code and complete values?}
  D -->|Yes| E[Show translated message]
  D -->|No| F[Show host message]
Loading

Reviews (2) · Last reviewed commit: "Merge origin/main into OrcaWin/i18n-main..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 626fb6b2-d0a5-4b94-ad86-1da1081b2317
Commits

Reviewing files that changed from the base of the PR and between 9ef1079 and 57d0ae4.

Files selected for processing: 49
  • src/main/ipc/filesystem/filesystem-commit-message-generation.test.ts
  • src/main/ipc/filesystem/filesystem-git-commit-generation-handlers.ts
  • src/main/ipc/filesystem/filesystem-git-pull-request-generation-handlers.ts
  • src/main/ipc/filesystem/filesystem-pull-request-linked-issue-lifetime.test.ts
  • src/main/runtime/runtime-git-generation-admission.test.ts
  • src/main/runtime/runtime-git-generation-commands.ts
  • src/main/text-generation/agent-generation-request.ts
  • src/main/text-generation/commit-message-text-generation-branch-name.test.ts
  • src/main/text-generation/commit-message-text-generation-failure-sanitization.test.ts
  • src/main/text-generation/commit-message-text-generation-generated-output.test.ts
  • src/main/text-generation/commit-message-text-generation-local-subprocess.test.ts
  • src/main/text-generation/commit-message-text-generation-regression.test.ts
  • src/main/text-generation/conversation-name-generation-request.ts
  • src/main/text-generation/jira-issue-summary-requests.ts
  • src/main/text-generation/jira-issue-summary-text-generation.test.ts
  • src/main/text-generation/jira-issue-summary-text-generation.ts
  • src/main/text-generation/kimi-generation-failure.test.ts
  • src/main/text-generation/source-control-agent-failure.ts
  • src/main/text-generation/source-control-agent-launch.test.ts
  • src/main/text-generation/source-control-command-line-budget.ts
  • src/main/text-generation/source-control-local-generation.ts
  • src/main/text-generation/source-control-local-process.ts
  • src/main/text-generation/source-control-omp-prompt-file.test.ts
  • src/main/text-generation/source-control-remote-generation.ts
  • src/main/text-generation/source-control-text-generation-requests.ts
  • src/main/text-generation/source-control-text-generation-types.ts
  • src/main/text-generation/source-control-wsl-launch.test.ts
  • src/main/text-generation/source-control-wsl-prompt.test.ts
  • src/preload/api/git-operation-api.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/text-generation-error-copy.test.ts
  • src/renderer/src/lib/text-generation-error-copy.ts
  • src/renderer/src/runtime/runtime-git-client-context.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-generation-client.ts
  • src/renderer/src/runtime/runtime-jira-summary-generation-client.ts
  • src/shared/jira/jira-issue-summary-generation.ts
  • src/shared/text-generation-failure-copy.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f99e41c8-64ce-4834-9f57-27be1fb640d4
Commits

Reviewing files that changed from the base of the PR and between 0699da6 and 9ef1079.

Files selected for processing: 45
  • src/main/ipc/filesystem/filesystem-commit-message-generation.test.ts
  • src/main/ipc/filesystem/filesystem-git-commit-generation-handlers.ts
  • src/main/ipc/filesystem/filesystem-git-pull-request-generation-handlers.ts
  • src/main/ipc/filesystem/filesystem-pull-request-linked-issue-lifetime.test.ts
  • src/main/runtime/runtime-git-generation-admission.test.ts
  • src/main/runtime/runtime-git-generation-commands.ts
  • src/main/text-generation/agent-generation-request.ts
  • src/main/text-generation/commit-message-text-generation-branch-name.test.ts
  • src/main/text-generation/commit-message-text-generation-failure-sanitization.test.ts
  • src/main/text-generation/commit-message-text-generation-generated-output.test.ts
  • src/main/text-generation/commit-message-text-generation-local-subprocess.test.ts
  • src/main/text-generation/commit-message-text-generation-regression.test.ts
  • src/main/text-generation/conversation-name-generation-request.ts
  • src/main/text-generation/jira-issue-summary-requests.ts
  • src/main/text-generation/jira-issue-summary-text-generation.test.ts
  • src/main/text-generation/jira-issue-summary-text-generation.ts
  • src/main/text-generation/kimi-generation-failure.test.ts
  • src/main/text-generation/source-control-agent-failure.ts
  • src/main/text-generation/source-control-agent-launch.test.ts
  • src/main/text-generation/source-control-local-generation.ts
  • src/main/text-generation/source-control-local-process.ts
  • src/main/text-generation/source-control-remote-generation.ts
  • src/main/text-generation/source-control-text-generation-requests.ts
  • src/main/text-generation/source-control-text-generation-types.ts
  • src/preload/api/git-operation-api.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/text-generation-error-copy.test.ts
  • src/renderer/src/lib/text-generation-error-copy.ts
  • src/renderer/src/runtime/runtime-git-client-context.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-generation-client.ts
  • src/renderer/src/runtime/runtime-jira-summary-generation-client.ts
  • src/shared/jira/jira-issue-summary-generation.ts
  • src/shared/text-generation-failure-copy.ts
Files with no reviewable changes: 1
  • src/main/text-generation/conversation-name-generation-request.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The change adds shared failure codes and structured fields for text-generation errors. Main-process generation paths use the shared failure helpers. Renderer clients localize failed Git and Jira results, with new error messages in multiple locales. Tests use partial object matching for failure results.

Priority: Low

Merge Risk: Minimal · previous review 9ef10

Some Kimi failures will remain in English, but this does not block merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the implementation, scope, rationale, testing, localization behavior, and fallback behavior. However, it does not follow the required template fully: it omits required section… Update the description to include all required template sections. Replace "Refs #32207" with an actual issue link using the required Fixes format, such as "Fixes #32207" when applicable. Complete the testing checkboxes and provide the requi…
Docstring Coverage Warning Docstring coverage is 19.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding coded localization support for AI text-generation failures across commit, pull request, and Jira flows.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the implementation, scope, rationale, testing, localization behavior, and fallback behavior. However, it does not follow the required template fully: it omits required sections such as ELI5, Review, Agent skill upstream boundary, Notes, and Checklist, and it uses "Refs #32207" instead of the required linked issue format.

Resolution

Update the description to include all required template sections. Replace "Refs #32207" with an actual issue link using the required Fixes format, such as "Fixes #32207" when applicable. Complete the testing checkboxes and provide the required checklist and notes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 19.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 21 functions across 32 files. (12 skipped: 12 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
⚔️ Resolve merge conflicts: 💡
  • Resolve merge conflict in branch OrcaWin/i18n-main-codes-12
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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