Skip to content

fix(FR-2586): clearer error when app launch fails due to access key mismatch#7409

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-14-fix_fr-2586_clearer_error_app_launch_access_key_mismatch
May 14, 2026
Merged

fix(FR-2586): clearer error when app launch fails due to access key mismatch#7409
graphite-app[bot] merged 1 commit into
mainfrom
05-14-fix_fr-2586_clearer_error_app_launch_access_key_mismatch

Conversation

@yomybaby
Copy link
Copy Markdown
Member

@yomybaby yomybaby commented May 14, 2026

Resolves #6732 (FR-2586)

image.png

Summary

When an app launch fails because the manager cannot find the session (HTTP 404 / "session not found"), the most common root cause is an access key mismatch — the session was created under a different access key than the one currently in use. Previously the WebUI surfaced the raw manager error, which read as a generic "session not found" and gave the user no idea what to do.

This change detects the 404 + "session ... not found" response coming back from startService in useBackendAIAppLauncher and replaces it with a user-friendly message that explains the likely cause and the two recovery paths:

  • Switch back to the original access key, or
  • Create a new session under the current access key.

Implementation

  • react/src/hooks/useBackendAIAppLauncher.tsx: added isSessionNotFoundError(err) helper that matches statusCode === 404 plus a substring match on the error's title field only (containing "session" and "not found"), and gated a friendlier AppLaunchError on it in the _resolveV2ProxyUri catch block.
  • resources/i18n/*.json: added session.appLauncher.SessionNotAccessible. All 22 locales populated with native translations.

The message is intentionally phrased as "likely" rather than asserting AK mismatch, because a 404 from startService could in rare cases also surface for a session that was genuinely removed between session-list render and app-launch click. Either way, the suggested recovery steps are valid.

Test Plan

  • Switch to a session created under a different access key, click an app — friendly error appears in the notification.
  • Launch an app on a normal session — no behavior change, app launches as before.
  • Trigger a non-404 launch failure (e.g. proxy down) — original error message still surfaces unchanged.

@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:M 30~100 LoC labels May 14, 2026
Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.45% 1783 / 27637
🔵 Statements 5.3% 1978 / 37274
🔵 Functions 5.18% 296 / 5714
🔵 Branches 3.71% 1293 / 34795
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/hooks/useBackendAIAppLauncher.tsx 0% 0% 0% 0% 13-1067
Generated in workflow #714 for commit 7956c51 by the Vitest Coverage Report Action

@yomybaby yomybaby marked this pull request as ready for review May 14, 2026 03:19
Copilot AI review requested due to automatic review settings May 14, 2026 03:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves the app-launch UX by translating a common manager-side “session not found” (404) failure into a more actionable, user-facing message that explains the likely access-key mismatch and recovery steps.

Changes:

  • Added a isSessionNotFoundError(err) classifier in useBackendAIAppLauncher and throws a friendlier AppLaunchError for that case.
  • Added a new i18n string key session.appLauncher.SessionNotAccessible across locale JSON files.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
react/src/hooks/useBackendAIAppLauncher.tsx Detects 404 “session not found” errors during app launch and replaces them with a clearer, localized message.
resources/i18n/en.json Adds English string for session.appLauncher.SessionNotAccessible.
resources/i18n/de.json Adds German translation for SessionNotAccessible.
resources/i18n/el.json Adds SessionNotAccessible (currently English text in Greek locale).
resources/i18n/es.json Adds Spanish translation for SessionNotAccessible.
resources/i18n/fi.json Adds SessionNotAccessible (currently English text in Finnish locale).
resources/i18n/fr.json Adds French translation for SessionNotAccessible.
resources/i18n/id.json Adds SessionNotAccessible (currently English text in Indonesian locale).
resources/i18n/it.json Adds Italian translation for SessionNotAccessible.
resources/i18n/ja.json Adds Japanese translation for SessionNotAccessible.
resources/i18n/ko.json Adds Korean translation for SessionNotAccessible.
resources/i18n/mn.json Adds SessionNotAccessible (currently English text in Mongolian locale).
resources/i18n/ms.json Adds SessionNotAccessible (currently English text in Malay locale).
resources/i18n/pl.json Adds SessionNotAccessible (currently English text in Polish locale).
resources/i18n/pt-BR.json Adds Portuguese (Brazil) translation for SessionNotAccessible.
resources/i18n/pt.json Adds Portuguese translation for SessionNotAccessible.
resources/i18n/ru.json Adds Russian translation for SessionNotAccessible.
resources/i18n/th.json Adds SessionNotAccessible (currently English text in Thai locale).
resources/i18n/tr.json Adds SessionNotAccessible (currently English text in Turkish locale).
resources/i18n/vi.json Adds SessionNotAccessible (currently English text in Vietnamese locale).
resources/i18n/zh-CN.json Adds Simplified Chinese translation for SessionNotAccessible.
resources/i18n/zh-TW.json Adds Traditional Chinese translation for SessionNotAccessible.

Comment thread react/src/hooks/useBackendAIAppLauncher.tsx Outdated
Comment thread react/src/hooks/useBackendAIAppLauncher.tsx
Comment thread resources/i18n/vi.json Outdated
Comment thread resources/i18n/tr.json Outdated
Comment thread resources/i18n/th.json Outdated
Comment thread resources/i18n/ms.json Outdated
Comment thread resources/i18n/mn.json Outdated
Comment thread resources/i18n/id.json Outdated
Comment thread resources/i18n/fi.json Outdated
Comment thread resources/i18n/el.json Outdated
@yomybaby yomybaby force-pushed the 05-14-fix_fr-2586_clearer_error_app_launch_access_key_mismatch branch 2 times, most recently from a65b8fc to c7f53b0 Compare May 14, 2026 08:10
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 14, 2026

Merge activity

…ismatch (#7409)

Resolves #6732 (FR-2586)

![image.png](https://app.graphite.com/user-attachments/assets/22043874-b36a-4373-9628-92ce4226a699.png)

## Summary

When an app launch fails because the manager cannot find the session (HTTP 404 / "session not found"), the most common root cause is an access key mismatch — the session was created under a different access key than the one currently in use. Previously the WebUI surfaced the raw manager error, which read as a generic "session not found" and gave the user no idea what to do.

This change detects the 404 + "session ... not found" response coming back from `startService` in `useBackendAIAppLauncher` and replaces it with a user-friendly message that explains the likely cause and the two recovery paths:

- Switch back to the original access key, or
- Create a new session under the current access key.

## Implementation

- `react/src/hooks/useBackendAIAppLauncher.tsx`: added `isSessionNotFoundError(err)` helper that matches `statusCode === 404` plus a substring match on the error's `title` field only (containing "session" and "not found"), and gated a friendlier `AppLaunchError` on it in the `_resolveV2ProxyUri` catch block.
- `resources/i18n/*.json`: added `session.appLauncher.SessionNotAccessible`. All 22 locales populated with native translations.

The message is intentionally phrased as "likely" rather than asserting AK mismatch, because a 404 from `startService` could in rare cases also surface for a session that was genuinely removed between session-list render and app-launch click. Either way, the suggested recovery steps are valid.

## Test Plan

- [ ] Switch to a session created under a different access key, click an app — friendly error appears in the notification.
- [ ] Launch an app on a normal session — no behavior change, app launches as before.
- [ ] Trigger a non-404 launch failure (e.g. proxy down) — original error message still surfaces unchanged.
@graphite-app graphite-app Bot force-pushed the 05-14-fix_fr-2586_clearer_error_app_launch_access_key_mismatch branch from c7f53b0 to 7956c51 Compare May 14, 2026 08:16
@graphite-app graphite-app Bot merged commit 7956c51 into main May 14, 2026
11 checks passed
@graphite-app graphite-app Bot deleted the 05-14-fix_fr-2586_clearer_error_app_launch_access_key_mismatch branch May 14, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show clearer error when app launch fails due to access key mismatch on session lookup

2 participants