Device code auth support#291
Open
anvilpete wants to merge 1 commit into
Open
Conversation
anvilpete
commented
May 15, 2026
| responder.respond_with_result(agent.authenticate(request).await) | ||
| responder.respond_with_result( | ||
| agent.authenticate(request, auth_cx, request_id).await, | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
cx is passed in here to allow the handler to spawn a complete_device_code_login() task. We could perhaps pass a narrower spawner trait instead, or maybe even return a Future from the handler.
anvilpete
commented
May 15, 2026
| - Custom Prompts | ||
| - Client MCP servers | ||
| - Auth Methods: | ||
| - ChatGPT subscription (requires paid subscription and doesn't work in remote projects) |
Contributor
Author
There was a problem hiding this comment.
Paid subscriptions aren't required.. maybe they were at some point in the past?
anvilpete
commented
May 15, 2026
| let agent = agent.clone(); | ||
| let auth_cx = cx.clone(); | ||
| let request_id = request_id_from_json(responder.id()) | ||
| .expect("request id must be a string or number"); |
Contributor
Author
There was a problem hiding this comment.
This could be avoided if responder exposed a Responder::request_id() -> RequestId or similar.
Contributor
Author
|
This PR adds support for #149. CI failures are due to the dependency on agentclientprotocol/rust-sdk#163. |
faac66f to
9594756
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.
This PR adds device code auth support for ChatGPT login when no browser is available.
It's an alternative implementation to #281. Instead of using a custom error data, the agent sends a URL-mode elicitation to initiate a device code auth flow:
An
elicitation/completeisn't required, due to theAuthenticateResponsesent when authentication is complete (or an error if it failed).The Rust SDK doesn't currently include elicitation schema in its
unstablefeature. I've added this in agentclientprotocol/rust-sdk#163, which this PR depends on.