-
Notifications
You must be signed in to change notification settings - Fork 92
fix(auth): keep Claude OAuth named pools and stop provider hops #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
539fa40
a8ef471
0a4591d
501c106
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ export class LoginDialogComponent extends Container implements Focusable { | |
| private abortController = new AbortController(); | ||
| private inputResolver?: (value: string) => void; | ||
| private inputRejecter?: (error: Error) => void; | ||
| private liveHint?: Text; | ||
| private onComplete: (success: boolean, message?: string) => void; | ||
|
|
||
| // Focusable implementation - propagate to input for IME cursor positioning | ||
|
|
@@ -80,6 +81,16 @@ export class LoginDialogComponent extends Container implements Focusable { | |
| ); | ||
| } | ||
|
|
||
| /** The Input widget is a single instance; mounting it twice paints two live `>` rows. */ | ||
| private remountInput(hint: Text): void { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The new liveHint dedup only covers showManualInput and showPrompt. showWaiting, showDetails, and showInfo(showCloseHint) still append their own (to cancel)/(to close) hint rows without removing a previously remounted hint, so an interleaved wait/info step leaves a stale hint beside the live one. Route those hint additions through the same remount/tracking so only one hint row is ever live. Prompt for AI agents |
||
| this.contentContainer.children = this.contentContainer.children.filter( | ||
| (child) => child !== this.input && child !== this.liveHint, | ||
| ); | ||
| this.contentContainer.addChild(this.input); | ||
| this.liveHint = hint; | ||
| this.contentContainer.addChild(hint); | ||
| } | ||
|
|
||
| private cancel(): void { | ||
| this.abortController.abort(); | ||
| if (this.inputRejecter) { | ||
|
|
@@ -137,8 +148,7 @@ export class LoginDialogComponent extends Container implements Focusable { | |
| this.input.setValue(""); | ||
| this.contentContainer.addChild(new Spacer(1)); | ||
| this.contentContainer.addChild(new Text(theme.fg("dim", prompt), 1, 0)); | ||
| this.contentContainer.addChild(this.input); | ||
| this.contentContainer.addChild(new Text(`(${keyHint("tui.select.cancel", "to cancel")})`, 1, 0)); | ||
| this.remountInput(new Text(`(${keyHint("tui.select.cancel", "to cancel")})`, 1, 0)); | ||
| this.tui.requestRender(); | ||
|
|
||
| return new Promise((resolve, reject) => { | ||
|
|
@@ -157,8 +167,7 @@ export class LoginDialogComponent extends Container implements Focusable { | |
| if (placeholder) { | ||
| this.contentContainer.addChild(new Text(theme.fg("dim", `e.g., ${placeholder}`), 1, 0)); | ||
| } | ||
| this.contentContainer.addChild(this.input); | ||
| this.contentContainer.addChild( | ||
| this.remountInput( | ||
| new Text( | ||
| `(${keyHint("tui.select.cancel", "to cancel,")} ${keyHint("tui.select.confirm", "to submit")})`, | ||
| 1, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: This guard couples fallback behavior to the exact English wording of an error message that is generated in two other files (
Provider is not configured: ${model.provider}at packages/ai/src/models.ts:680 and packages/coding-agent/src/core/model-runtime.ts:711), with no shared constant. If either generator is reworded or localized, the startsWith check silently stops matching and the auth-miss hard-error hop this fix is meant to prevent quietly returns. Export a shared prefix constant (e.g. in packages/ai where ModelsError is defined) and reference it in both throw sites and this guard, as is done with TURN_RETRY_SUPPRESSION_PREFIX.Prompt for AI agents