Skip to content

fix(mobile): recognize update refusals by their code, not their translated text - #52834

Merged
AmoabaKelvin merged 1 commit into
mainfrom
mobile-update-refusal-codes
Nov 30, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
mobile-update-refusal-codes

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

When a computer's Orca is too old for something, the phone shows an "Update Orca on " notice. For automations and branch choice it decided that by comparing the error's translated words, so changing the phone's language while the error was showing brought back the old red sentence. Now it decides from the error itself.

Files Added Deleted Net
Test 0 0 0 0
Prod 20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​89 $\color{#cf222e}{\Huge{\mathbf{−}}}$​69 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20

What Changed

Before: after an in-place language change, these refusals were compared against a fresh translation. They no longer matched, so the update notice disappeared and the old sentence came back:

  • the automation catalog's "too old for automations"
  • the automation editor's "can't check this project's agents"
  • New workspace's "can't take a branch choice"

Now:

  • Automations: one classifier, automationUpdateRefusal, reads the raw failure. automationErrorMessage also uses it, so the text and the notice can't disagree.
  • Automation catalog and editor: they keep the action failure and the agent-check failure untranslated, and translate at render. The line now follows the language too. useAutomationCatalog exposes hostOutdated, which AutomationCatalogNotes and Home > Automations read in place of matching text.
  • Branch choice: the create retry returns a stable code, BRANCH_CHOICE_NEEDS_NEWER_HOST, and the form matches on that. The workspace.branchChoice.hostUpdateRequired key is removed; it was only used for matching.

Why

Matching translated strings breaks whenever the language changes, and it can collide when two keys translate the same way. Keys and codes don't.

Linked Issue

Follow-up to the update-notice migration (#52368, #52373). No issue.

Visual Proof

N/A: what shows is unchanged; the notice now also stays after a language change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

How it was checked:

  • On main, a throwaway test with the real i18n module: refusals translated in English, then the language switched to German. All three matchers returned false.
  • On this branch, the same check: the classifiers still return agent-verification and host.
  • pnpm check:changed and mobile tsc pass.
  • No test is committed: the classifier is a few lines that call no translator.

Performance

None, because classification is at most a few string checks on an error the screen already holds; at most two error translations per render, only while an error shows.

Risk

Level: Low

What could go wrong: an automation failure with an unexpected shape classifies as nothing and shows its text, as before. A plain revert undoes this.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Automation errors are classified from raw failures, and the catalog and editor use that classification to determine outdated-host and agent-verification notices. Worktree creation now returns a stable error code for unsupported branch intent, and the form checks that code to display the host-update notice. Locale files remove the former branch-choice host-update message.

Merge Risk: Minimal · up to 58c03

This change keeps host-update notices visible after an in-place language change by classifying raw errors instead of translated text. No concrete defect was found, and it is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: update refusals are now recognized by their stable code instead of their translated text. It matches the description's core fix (classifiers read raw failures, branch …
Description check Passed The description follows the repository template. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and Checkli…
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: Title check

Explanation

The title names the main change: update refusals are now recognized by their stable code instead of their translated text. It matches the description's core fix (classifiers read raw failures, branch choice matches a constant). The title is specific, single-sentence, and within normal length, though it is slightly long at 79 characters.

Full details: Description check

Explanation

The description follows the repository template. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist sections. The before/after, mechanism, risk level, and performance reasoning are filled in. The Linked Issue section cites a follow-up to #52368 and #52373 but does not use the required 'Fixes #' issue link, and the author states 'No issue'. The AI Disclosure section is left as the template comment. The Performance line is completed. The Testing section explains a throwaway test rather than committed automated tests, which is acceptable given the stated reasoning. The Linked Issue gap is the main shortfall, so the check is not a full pass but the description is mostly complete.

  • 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

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: c788571d-6ffa-4dd9-afd7-f47bacb9cd21
Commits

Reviewing files that changed from the base of the PR and between 8ee3e71 and 58c0370.

Files selected for processing: 20

  • mobile/src/automations/AutomationControls.tsx
  • mobile/src/automations/AutomationEditor.tsx
  • mobile/src/automations/AutomationManager.tsx
  • mobile/src/automations/automation-error.ts
  • mobile/src/automations/automation-target-inventory.ts
  • mobile/src/automations/use-automation-catalog.ts
  • mobile/src/home/tabs/MobileHomeAutomationsTab.tsx
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/new-workspace/creation/forms/NewWorktreeFormSheet.tsx
  • mobile/src/new-workspace/creation/worktree-create-retry.ts
Files with no reviewable changes: 10

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json

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

@AmoabaKelvin
AmoabaKelvin merged commit 5d50b4e into main Nov 30, 2026
27 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the mobile-update-refusal-codes branch November 30, 2026 01:52
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