Skip to content

fix(mobile): show localized error details on session start and comment edit - #8090

Merged
iscekic merged 6 commits into
mainfrom
drain/localized-create-and-edit-errors
Oct 21, 2026
Merged

iscekic merged 6 commits into
mainfrom
drain/localized-create-and-edit-errors

Conversation

@iscekic

@iscekic iscekic commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

bot: fix(mobile): show localized error details on session start and comment edit

Change

A failed cloud session create printed the server's raw English detail (for
example a credential-proxy or organization-access string) under the localized
failure heading, and the PR comment-edit sheet showed raw provider text for
retryable failures. Both surfaces now select localized, actionable copy and
the raw text never reaches the UI:

  • New pure mapper cloudPrepareFailureMessage
    (apps/mobile/src/components/agents/cloud-prepare-error-display.ts), following
    the mapping pattern of apps/mobile/src/lib/pr-review/mutation-error-display.ts.
    It keys on the server's message, not the tRPC code: only the exact
    organization-access denial maps to the new "check your access" copy (the same
    codes also carry trial expiry, model-catalog denials and re-authentication
    failures); the unavailable-model rejection maps to the existing
    agentChat.session.modelUnavailable copy; payment-required maps to the
    existing credits copy; every other rejection — including unclassified raw
    server details — maps to the existing generic service line. Retry semantics
    stay with isCloudPrepareRetryableError; the operation-key behavior is
    unchanged.
  • prepare-agent-session.ts returns the mapped message instead of the raw
    error.message; the new-session inline block renders it.
  • The Continue clone path on the same screen uses the same mapper for its
    terminal toast instead of the raw message.
  • mutation-error-display.ts no longer passes rawError.message through:
    a typed TOO_MANY_REQUESTS maps to the new localized
    prReview.mutationError.rateLimited copy and a typed CONFLICT to the new
    localized prReview.mutationError.conflict copy, on all three surfaces
    (composer, submit, edit-comment — both branches run before the submit
    return). Every other retryable failure (codeless transport drop, gateway)
    shows the surface's localized line. The designed verbatim paths (ambiguous
    and persistence markers, server-sanitized forbidden copy, reconnect notice)
    are unchanged.
  • Copy: three new keys in en.json (agentChat.newSession.checkOrganizationAccess,
    prReview.mutationError.rateLimited, prReview.mutationError.conflict) plus
    translations in the other 86 catalogs (no English duplicated into other
    locales). The session-detail surfaces keep their existing error-copy controls,
    which are unchanged by this pull request.

Verification

  • New pure suite cloud-prepare-error-display.test.ts (message-keyed copy
    classes, shaped and direct tRPC error forms, code-alone cases that must NOT
    map, generic fallback for unknown and non-error values).
  • Updated suites that pinned the old raw pass-through: new-session
    cloud-create-error, mutation-error-display (rate limit and conflict now
    expected on all three surfaces), use-new-session-creator, pr-comment-edit-sheet.
    Full mobile pure suite passed after the mapper change; the targeted suites
    re-ran green after each review fix.
  • pnpm typecheck, pnpm lint, oxfmt, check:i18n (87 catalogs match),
    check:plurals all pass at the final head.

End-to-end proof (Android emulator, local backend)

Reproduced on a local stack with a fake account and a seeded repository
snapshot: pressing Start without organization membership makes the backend
reject the create with the organization-access denial. The inline block under
the Start control shows the localized heading and the localized detail in both
languages, with no raw server text (screenshots in the first and latest
comments; captured after the message-qualified mapper change, which is the
commit the organization-access path last changed in):

  • German: "Die Sitzung konnte nicht erstellt werden." /
    "Prüfe deinen Zugriff auf diese Organisation und versuche es erneut."
  • Japanese: 「セッションを作成できませんでした。」 /
    「この組織へのアクセス権を確認して、もう一度お試しください。」

Limitation: the edit-sheet BAD_GATEWAY provider string could not be reproduced
against the local backend (it needs a GitHub credential-service hiccup); its
mapper behavior is covered by the updated unit tests.

Proxy answers

  1. Question: How should known failure classes map to copy?
    Answer: Class-based actionable copy (organization-access → new "check
    your access" key, payment-required → existing credits key, everything else →
    existing generic service key).
  2. Question: Include the clone (Continue) path's raw terminal toast?
    Answer: Yes, the same mapper now covers the clone path on that screen.
  3. Question: What should the comment-edit retryable fall-through show?
    Answer: Localized retryable copy (composer "could not post" key,
    edit-comment "couldn't save" key); no raw provider text.
  4. Question: Android verification depth?
    Answer: Full emulator run against the local backend in de and ja, with
    screenshots.

…failures

A failed session create printed the server's raw English detail under the
localized heading, and the comment-edit sheet showed the raw provider text
for a retryable failure. Known failure classes now map to localized,
actionable copy and everything else shows the localized generic line; the
raw text no longer reaches the UI.
@iscekic iscekic added drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer labels Oct 19, 2026
@iscekic

iscekic commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Verified on the Android emulator against the local backend.

Reproduced the create failure by pressing Start while the fake account had no
organization membership, so the backend rejects the create with the
organization-access denial. The inline block under the Start control shows the
localized heading and the localized detail in both languages, with no raw
server text.

German: "Die Sitzung konnte nicht erstellt werden." / "Prüfe deinen Zugriff
auf diese Organisation und versuche es erneut."

Japanese: 「セッションを作成できませんでした。」 / 「この組織へのアクセス権を確認して、もう一度お試しください。」

German new-session failure with localized heading and detail

Japanese new-session failure with localized heading and detail

Comment thread apps/mobile/src/i18n/locales/az.json Resolved
Comment thread apps/mobile/src/i18n/locales/yo.json Resolved
Comment thread apps/mobile/src/i18n/locales/fil.json Resolved
@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental commit resolves both prior findings: CONFLICT and TOO_MANY_REQUESTS now select localized copy before the submit-surface early return, and the stray Oromo token is removed; the updated expectations match the implementation.

Files Reviewed (3 files)
  • apps/mobile/src/lib/pr-review/mutation-error-display.ts - no issues (rate-limit/conflict branches now precede the submit return)
  • apps/mobile/src/lib/pr-review/mutation-error-display.test.ts - no issues (submit expectations aligned)
  • apps/mobile/src/i18n/locales/om.json - no issues (stray u removed)
Previous Review Summaries (4 snapshots, latest commit bb2609b)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit bb2609b)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

The incremental commit correctly localizes typed CONFLICT copy for the composer and edit-comment surfaces, but the new branch sits after the submit-surface early return, so a stale review submit still shows connection copy; one Oromo translation also carries a stray token.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/mobile/src/lib/pr-review/mutation-error-display.ts 121 The new CONFLICT branch is unreachable on the submit surface (early return at lines 109-111), so a stale review submit still shows the connection copy.
apps/mobile/src/i18n/locales/om.json 774 Stray u after fe'adhu makes the Oromo conflict sentence ungrammatical.
Files Reviewed (89 files)
  • apps/mobile/src/i18n/locales/*.json (87 catalogs) - 1 issue (om.json)
  • apps/mobile/src/lib/pr-review/mutation-error-display.ts - 1 suggestion
  • apps/mobile/src/lib/pr-review/mutation-error-display.test.ts - no issues

Fix these issues in Kilo Cloud

Previous review (commit 3873c11)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The incremental Maltese copy fix is correct; one prior low-priority finding remains on the comment-edit fall-through, where a typed CONFLICT still shows connection copy.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/mobile/src/lib/pr-review/mutation-error-display.ts 120 CONFLICT classifies as retryable and falls through to the surface's "Check your connection and try again" copy, misdiagnosing a stale-write conflict as a transport problem.
Files Reviewed (91 files)
  • apps/mobile/src/i18n/locales/mt.json - fixed (rateLimited now uses talbiet)
  • apps/mobile/src/lib/pr-review/mutation-error-display.ts - 1 suggestion (carried forward, unchanged since previous review)

Fix these issues in Kilo Cloud

Previous review (commit c6afebb)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

The incremental mapping fixes land correctly, but the new Maltese rate-limit copy says "questions" instead of "requests", and a typed CONFLICT still falls through to connection copy.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/i18n/locales/mt.json 821 mistoqsijiet means "questions", but this catalog uses talbiet for requests, so the new rate-limit message reads "Too many questions."

SUGGESTION

File Line Issue
apps/mobile/src/lib/pr-review/mutation-error-display.ts 120 Existing thread: TOO_MANY_REQUESTS is now handled, but a typed CONFLICT still falls through to "Check your connection and try again," misdiagnosing a server-side conflict as a transport problem.
Files Reviewed (91 files)
  • apps/mobile/src/components/agents/cloud-prepare-error-display.ts
  • apps/mobile/src/components/agents/cloud-prepare-error-display.test.ts
  • apps/mobile/src/lib/pr-review/mutation-error-display.ts - 1 issue
  • apps/mobile/src/lib/pr-review/mutation-error-display.test.ts
  • apps/mobile/src/i18n/locales/*.json (87 catalogs) - 1 issue (mt)

Fix these issues in Kilo Cloud

Previous review (commit 20f8a1b)

Status: 6 Issues Found | Recommendation: Address before merge

Executive Summary

The localized error-copy change works mechanically, but the new code mappings now misdiagnose several actionable failures (expired trial, model-catalog denial, GitHub rate limits), and two catalog translations say the wrong thing.

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/components/agents/cloud-prepare-error-display.ts 19 UNAUTHORIZED/FORBIDDEN always map to organization-access copy, but the same codes cover an expired organization trial, a model-catalog denial, and token failure; these are terminal, so the user gets no retry and misleading guidance.
apps/mobile/src/lib/pr-review/mutation-error-display.ts 114 The retryable fall-through discards sanitized server copy for TOO_MANY_REQUESTS and CONFLICT, so a rate limit is reported as a connection problem and the wait window is lost.
apps/mobile/src/i18n/locales/az.json 2212 çıxış means exit/sign out, not access (giriş); the line reads as checking your exit to the organization.
apps/mobile/src/i18n/locales/yo.json 2212 ìgbàsílẹ̀ is the catalog's word for download, so the line reads as checking your download to the organization.

SUGGESTION

File Line Issue
apps/mobile/src/components/agents/cloud-prepare-error-display.ts 25 The catch-all turns actionable terminal BAD_REQUESTs (notably model-unavailable, which has existing localized copy) into a server-error message with no retry.
apps/mobile/src/i18n/locales/fil.json 2212 organization is left untranslated while the catalog uses Organisasyon elsewhere.
Files Reviewed (96 files)
  • apps/mobile/src/components/agents/cloud-prepare-error-display.ts - 2 issues
  • apps/mobile/src/components/agents/cloud-prepare-error-display.test.ts
  • apps/mobile/src/components/agents/new-session-cloud-create-error.test.ts
  • apps/mobile/src/components/agents/new-session-screen-body.tsx
  • apps/mobile/src/components/agents/use-new-session-creator.test.ts
  • apps/mobile/src/components/pr-review/discussion/pr-comment-edit-sheet.test.tsx
  • apps/mobile/src/lib/app-actions/prepare-agent-session.ts
  • apps/mobile/src/lib/pr-review/mutation-error-display.ts - 1 issue
  • apps/mobile/src/lib/pr-review/mutation-error-display.test.ts
  • apps/mobile/src/i18n/locales/*.json (87 catalogs) - 3 issues (az, yo, fil)

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash-1017 · Input: 38K · Output: 2.1K · Cached: 223K

Review guidance: REVIEW.md from base branch main

…-limit copy

The organization-access copy keyed on UNAUTHORIZED/FORBIDDEN alone, but those
codes also carry trial expiry, model-catalog denials and re-authentication
failures; it now keys on the precise denial message, and the unavailable-model
rejection maps to the model picker copy. The review retryable fall-through
gains a localized rate-limit line so the server's English-only wait window text
never reaches the inline box, and three catalogs use their established access
terminology for the new key.
@iscekic iscekic added merge:human Substantive functional risk requires human review. and removed merge:human Substantive functional risk requires human review. labels Oct 19, 2026
Comment thread apps/mobile/src/i18n/locales/mt.json Resolved
…nflict

A typed CONFLICT classified as retryable fell through to the connection copy,
which misdiagnosed a concurrent update as a transport problem. It now shows
localized conflict copy naming the reload-and-retry recovery.
Comment thread apps/mobile/src/i18n/locales/om.json Resolved
… too

The rate-limit and conflict branches sat after the submit return, so a stale
review submit still showed connection copy. Both moved ahead of it, and the
Oromo conflict line drops a stray letter.
@iscekic

iscekic commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Re-verified end to end on the emulator after the message-qualified mapper change. Same local backend, same fake account, same seeded repository snapshot; the create was rejected with the organization-access denial and the inline block shows the localized heading and detail with no raw server text. The later rate-limit and conflict commits (bb2609b, ca0d5dd, 25daed7) do not touch the organization-access path this capture exercises.

German: "Die Sitzung konnte nicht erstellt werden." / "Prüfe deinen Zugriff auf diese Organisation und versuche es erneut."

Japanese: 「セッションを作成できませんでした。」 / 「この組織へのアクセス権を確認して、もう一度お試しください。」

German new-session failure with localized heading and detail, re-verified capture

Japanese new-session failure with localized heading and detail, re-verified capture

@iscekic iscekic added merge:human Substantive functional risk requires human review. merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. and removed merge:human Substantive functional risk requires human review. labels Oct 20, 2026
@iscekic
iscekic added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit a6f0b73 Oct 21, 2026
88 checks passed
@iscekic
iscekic deleted the drain/localized-create-and-edit-errors branch October 21, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer merge:bot Bot-owned review; merge when ready once readiness passes and a review approves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants