-
Notifications
You must be signed in to change notification settings - Fork 80
fix(oauth-connect): guard against poll daemon errors and malformed start response #29593
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
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -95,6 +95,9 @@ async function pollOAuthConnectStatus( | |||||
| return r.result; | ||||||
| } | ||||||
| } | ||||||
| if (!r.ok && r.statusCode !== undefined) { | ||||||
| return { status: "error", service: "?", error: r.error ?? "Daemon error during OAuth status poll" }; | ||||||
| } | ||||||
| await new Promise<void>((res) => setTimeout(res, opts.intervalMs)); | ||||||
| } | ||||||
| return { status: "error", service: "?", error: "Timed out waiting for OAuth callback" }; | ||||||
|
|
@@ -493,6 +496,14 @@ Examples: | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| // ok:true but no auth_url means a malformed daemon response — surface an error rather | ||||||
| // than falling back to in-process (which would re-introduce the heap-split bug for | ||||||
| // gateway transport). | ||||||
| if (startResult.ok && !startResult.result?.auth_url) { | ||||||
| writeError("Daemon returned unexpected response for OAuth connect start"); | ||||||
|
Contributor
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. 🔴 User-facing error message uses "Daemon" instead of "assistant" The error string
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // If the daemon was reachable but returned an error, surface it rather than | ||||||
| // falling back to in-process (which would re-introduce the heap-split bug for | ||||||
| // gateway transport). | ||||||
|
|
||||||
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.
🔴 User-facing error message uses "Daemon" instead of "assistant"
The fallback error string
"Daemon error during OAuth status poll"at line 99 is user-facing — it flows throughpollOAuthConnectStatus→final.error→writeError(final.error ?? ...)atassistant/src/cli/commands/oauth/connect.ts:472. AGENTS.md explicitly mandates: "In all user-facing text — CLI output, error messages, help strings… use 'assistant' instead of 'daemon'."Was this helpful? React with 👍 or 👎 to provide feedback.