Skip to content

Device code auth support#281

Closed
anvilpete wants to merge 1 commit into
zed-industries:mainfrom
anvilpete:device-code-auth
Closed

Device code auth support#281
anvilpete wants to merge 1 commit into
zed-industries:mainfrom
anvilpete:device-code-auth

Conversation

@anvilpete

Copy link
Copy Markdown
Contributor

This PR adds device code auth support for ChatGPT login when no browser is available.

Ideally this should use a URL Elicitation Required Error once the Elicitations RFD is approved. Instead it responds with Error::auth_required() with data: { message, url, user_code }. Happy to change this to a URLElicitationRequiredError if you prefer that.

I didn't add an equivalent of the optional elicitation/complete notification, as our client doesn't require this. But I can do if you like.

It requires the client to advertise "clientCapabilities": {"_meta": {"codex-acp": {"deviceCodeAuth": true } } }, to avoid breaking any assumptions in existing client implementations.

Comment thread src/codex_agent.rs
cx.spawn(async move {
responder.respond_with_result(agent.authenticate(request).await)
responder
.respond_with_result(agent.authenticate(request, auth_cx).await)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread README.md
- Custom Prompts
- Client MCP servers
- Auth Methods:
- ChatGPT subscription (requires paid subscription and doesn't work in remote projects)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Paid subscriptions aren't required.. maybe they were at some point in the past?

@anvilpete

Copy link
Copy Markdown
Contributor Author

Support for #149

@anvilpete anvilpete marked this pull request as draft May 14, 2026 07:15
@benbrandt

Copy link
Copy Markdown
Member

Hi thanks for taking the time to dig in!
Development is moving to agentclientprotocol/codex-acp. The new adapter is built on the new Codex App Server, and we are pooling implementation and maintenance work across teams there. If this is still needed, please open a PR for that one. Thanks!

@benbrandt benbrandt closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants