fix(desktop): carry typed OAuth failure reasons from main-process producers - #4887
Draft
orangeCatDeveloper wants to merge 11 commits into
Draft
fix(desktop): carry typed OAuth failure reasons from main-process producers#4887orangeCatDeveloper wants to merge 11 commits into
orangeCatDeveloper wants to merge 11 commits into
Conversation
orangeCatDeveloper
force-pushed
the
fix/oauth-failure-reasons
branch
from
September 6, 2026 06:58
9393371 to
3c11f78
Compare
Settings-area producers (memory, data, permission center, connection test, computer-use health, dev dialogs, Copilot import) emitted zh prose that reached en users verbatim, and presenters sniffed CJK to decide whether to show it. Producers now return stable codes and redact probe detail at the source; each settings catalog maps its codes per locale with complete message templates and an explicit unknown fallback. One capability reason catalog serves the Health center and the Permission Center, bot reasons resolve through the bot catalog, and the memory and Copilot results carry a single code field. Generated-by: Claude Code Generated-by: OpenCode
Remove the rebase-duplicated 429 branch that shadowed shared.rateLimit behind shared.rateLimited and drop the now-dead rateLimited copy rows. Finish the permission-center guidance-block removal: delete the unused locale keys, empty the storybook fixture guidance, and fix the comment that still described the block. Log capability probe failures before collapsing them to permission_probe_failed. Drop redundant cu_backend_status re-checks after the early return and shorthand the locale pass-through in command actions. Generated-by: Claude Code
…rthand The `locale: locale` → `locale` shorthand in app-shell-command-actions.ts drops two non-trivia tokens; regenerate the architecture ledger. Generated-by: Claude Code
…R_CONNECTION_RESET)
…ION_RESET, 3rd occurrence)
The storybook smoke failed on product-settings-pages--about-update-failed across every CI run of this branch: the story pins net::ERR_CONNECTION_RESET, classifyGeneralizedError did not recognize the Chromium prefix (it only matches Node errno spellings), so the PR's new [settings] operation failed console.error fired on a story that renders normally, and the smoke treats console.error as fatal. Empty-commit retriggers could not fix it. Classify the net::ERR_ prefix as network_error so the update row renders Network error / 网络错误 instead of the unknown-error fallback, which also removes the diagnostic for this expected story path. Cover the prefix and its per-locale rendering in the classifier tests. Generated-by: Claude Code
The permission-center guidance list was removed in 02604e2 (no producer fills guidance; apache#4526's layered rows carry the actionable lines), but the snapshot-side plumbing survived: the CapabilitySnapshot.guidance field, staticCapability's guidance input, botCapability's empty array, and the fixtures' guidance: [] entries. Every future producer had to keep feeding a write-only field. Delete the field, the producer parameter, the botCapability entry, and the fixture entries; fix the permission-center comment that still named the removed guidance list. Generated-by: Claude Code
…esult-copy subscription-result-message.ts no longer exists — the module moved into settings-provider-copy.ts beside the catalog it renders, so the old test file name referenced nothing. Fold its two assertions (Traditional Chinese rejects raw Simplified backend prose; the generalized classifier still answers network failures) into oauth-result-copy.test.ts, which already drives subscriptionResultMessage. Also drop the unused lookupCopy import from settings-health-copy.ts. Generated-by: Claude Code
orangeCatDeveloper
force-pushed
the
fix/oauth-failure-reasons
branch
from
September 6, 2026 11:03
3c11f78 to
92a3ea4
Compare
The inline { type X } form counts as a value import in the renderer
architecture analysis, so the ledger recorded an @maka/core/ui-locale
dependency edge and CI's --base check failed against main, which uses
the type-only form. Restore import type and regenerate the ledger.
Generated-by: Claude Code
…ducers get-auth-url maps the Host's operation_conflict to a typed login_in_progress reason and Desktop-owned presentation failures (OAuthPresentationError: presentation_timeout / presentation_absent) to presentation_failed, instead of relying on English prose matching in the renderer. The did-not-present / no-matching-request regex in subscriptionResultMessage goes away; the enrollment-disabled and already-in-progress fallbacks stay as Host version-skew fallbacks for producers that predate the typed codes. Refs apache#2672 Generated-by: Claude Code
… boundary
The renderer catalog tests proved the copy lookup for the new typed
reasons; nothing proved the main process emits them. Throw the three
producer-side failures through the real handler — OAuthPresentationError
→ presentation_failed, RuntimeHostOperationError('operation_conflict')
→ login_in_progress, RuntimeHostOperationError('operation_unavailable')
→ experimental_disabled — and assert the exact failure envelope for
each, so a rename or an instanceof-order regression fails here.
Generated-by: Claude Code
orangeCatDeveloper
force-pushed
the
fix/oauth-failure-reasons
branch
from
September 6, 2026 21:05
92a3ea4 to
963a8a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #4551; review the last commit only.
subscriptionResultMessagematches two English Host messages with regexes to localize OAuth login failures. One of the three regex families —did not present OAuth|no matching OAuth presentation— describes failures produced by Desktop itself, not the Host: the presentation timeout and the absent-request throw inruntime-host-oauth-presentation.ts. This PR gives those producers a typed error (OAuthPresentationErrorwithpresentation_timeout/presentation_absent) and maps it, along with the Host'soperation_conflict, to typed reasons on theget-auth-urlfailure envelope:operation_conflict→login_in_progressOAuthPresentationError→presentation_failedoperation_unavailable→experimental_disabled(unchanged)The renderer catalog maps the two new reasons per locale and the prose regex is deleted. The
enrollment is disabledandalready in progressfallbacks stay: their producers live in the Runtime Host, which may be remote and older than this client — that is a version-skew fallback, not dead code.loginConflict/browserPresentFailedad-hoc keys are folded intoresultCodes(same wording).Refs #2672
Verification
Not run: Electron e2e with a live Host login flow.
AI use
Tool(s) and scope: Claude Code traced the producer→presenter path, implemented the typed error and reason mapping, removed the regex, added the tests, and wrote this description. Commit carries
Generated-by: Claude Code.Checklist
Does this PR entail a change in behavior?