Skip to content

fix(i18n): code automation run skip and failure reasons - #35666

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/i18n-main-codes-11
Oct 29, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/i18n-main-codes-11

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​110
Prod 27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​695 $\color{#cf222e}{\Huge{\mathbf{−}}}$​108 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​587

Summary

Automation run skip/failure reasons authored in main (dispatch refusals, run-target resolution, runtime terminal observer) now persist an optional errorCode (+ errorParams) beside the unchanged English error, and the Automations run details page / detail "Last run failed" notice show them translated.

What Changed

  • src/shared/automation-run-failure-copy.ts: one English table + automationRunFailure(code, params?); English wire text is byte-identical to before (skip coalescing still keys on it).
  • AutomationRun / AutomationDispatchResult gain optional errorCode? / errorParams? (plain strings, not an enum). updateAutomationRun stores the result's code, keeps the existing code when the same English error is re-forwarded (usage writes), and drops it when the error changes.
  • Producers converted: dispatch-refusal.ts, run-target-resolution.ts (incl. projectSetupNotReady with setupState param), automation-dispatch-request.ts (automation/destination changed), runtime-terminal-run-observer.ts (hooks review, never started, no completion, 6h watch timeout). Codes flow through AutomationDispatchRefusedError, headless completion and the completion watcher.
  • Renderer automation-run-error-copy.ts: narrows with Object.hasOwn; setupState maps to one whole sentence per state; unknown codes/states and old records show the stored English.
  • 27 keys under automations.runFailures.* in all 11 catalogs.

Why

Refs #32207: these sentences were shown in English regardless of UI language. Records sync to remote clients and may be produced by older/newer hosts, so the English stays authoritative and the code is additive.

Linked Issue

Refs #32207

Visual Proof

N/A — copy/i18n only.

Testing

  • pnpm sync:localization-runtime-catalog, pnpm verify:localization-catalogs|catalog|extraction|coverage|runtime-catalog — pass
  • pnpm tc — pass
  • pnpm test src/main/automations src/main/persistence/scheduling-automations src/renderer/src/components/automations — 136 files / 1128 tests pass
  • pnpm check:changed --maxWorkers=2 — all lint/ratchet/localization/quality steps pass; its unit-test step did not finish within the time budget on the loaded machine (affected tests run directly above)
  • Codex review of the diff: one finding (usage writes dropped the code) — fixed and covered by test

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 04:28
@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, with no new actionable issues found.

Summary

Adds translated automation run failure messages while keeping the stored English text for older records and unknown codes.

  • Skipped automation runs keep a code for their reason.
  • Terminal failures keep a code as run completion is recorded.
  • Automation run details show known reasons in the selected language.

Reviews (2) · Last reviewed commit: "test: expect legacyTwinHosts code on twi..." · 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 16 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: a24bdb5c-62f9-4dc8-a80c-2e4360103e93
Commits

Reviewing files that changed from the base of the PR and between fe3ada9 and 0a5adc7.

Files selected for processing: 1
  • src/main/persistence/applying-settings/persistence-legacy-automation-twin-host.test.ts
Walkthrough

Automation run failures now use shared error codes and optional parameters. Dispatch, target resolution, and runtime observation pass structured failures into run updates. Persistence retains or clears failure details according to the update result. The renderer formats recognized codes with localized text and falls back to the stored error when needed. Tests and localization entries cover these changes.

Priority: Normal

Merge Risk: Low · previous review fe3ad

If a target changes during precheck, the failure reason remains in English rather than the selected language. This is a bounded issue with an English fallback.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the change, motivation, implementation, testing, visual impact, and affected issue. However, the Linked Issue section uses “Refs #32207” instead of an actual issue link or “Fi… Add an actual linked issue reference, such as “Fixes #32207” or the repository’s full issue link. Complete or explicitly mark the remaining required template sections, including ELI5, AI Disclosure, Review, Agent skill upstream boundary, No…
Docstring Coverage Warning Docstring coverage is 31.58% 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 codes for automation run skip and failure reasons to support localization.
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 change, motivation, implementation, testing, visual impact, and affected issue. However, the Linked Issue section uses “Refs #32207” instead of an actual issue link or “Fixes #” reference, as required by the template. Several checklist sections are also omitted.

Resolution

Add an actual linked issue reference, such as “Fixes #32207” or the repository’s full issue link. Complete or explicitly mark the remaining required template sections, including ELI5, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist items.

Full details: Docstring Coverage

Explanation

Docstring coverage is 31.58% 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 19 functions across 21 files. (12 skipped: 12 unsupported.)

Resolution

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

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Preserve the coded refusal after a precheck. · automation-dispatch-request.ts:165

src/main/automations/automation-dispatch-request.ts:165
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve the coded refusal after a precheck.

If a scheduled run’s precheck finishes after its target changes, latestTarget contains a structured failure. This branch throws only its English text. runHeadlessAutomationDispatch then records dispatch_failed without errorCode, so the failure cannot be localized. Throw AutomationDispatchRefusedError with the structured failure, as the adjacent late-refusal branch does. (raw.githubusercontent.com)


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: e4b7d22d-c848-4c92-a1fc-f00558284988
Commits

Reviewing files that changed from the base of the PR and between d334119 and fe3ada9.

Files selected for processing: 33
  • src/main/automations/automation-dispatch-host-fence.test.ts
  • src/main/automations/automation-dispatch-request.ts
  • src/main/automations/automation-wsl-move-refusal.test.ts
  • src/main/automations/dispatch-refusal-wsl-move.test.ts
  • src/main/automations/dispatch-refusal.ts
  • src/main/automations/headless-dispatch-runner.ts
  • src/main/automations/headless-dispatch.ts
  • src/main/automations/run-completion-watcher.ts
  • src/main/automations/run-target-resolution.test.ts
  • src/main/automations/run-target-resolution.ts
  • src/main/automations/runtime-terminal-run-observer.ts
  • src/main/automations/service.ts
  • src/main/persistence/scheduling-automations/automation-run-operations.test.ts
  • src/main/persistence/scheduling-automations/automation-run-operations.ts
  • src/renderer/src/components/automations/AutomationDetail.tsx
  • src/renderer/src/components/automations/AutomationRunDetailsPage.tsx
  • src/renderer/src/components/automations/automation-run-content.ts
  • src/renderer/src/components/automations/automation-run-error-copy.test.ts
  • src/renderer/src/components/automations/automation-run-error-copy.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/shared/automation-run-failure-copy.ts
  • src/shared/automations-types.ts

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

@OrcaWin
OrcaWin merged commit ceb9ca0 into main Oct 29, 2026
64 checks passed
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