fix: expose actionable session details in login --json#334
Merged
Conversation
manojbajaj95
approved these changes
May 25, 2026
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.
Description
Expose actionable session details in
authsome login --jsonfor interactive login flows. The CLI now includessession_idandauth_urlwhen a login session starts, and it also surfaces device-code fields likeuser_code,verification_uri, andverification_uri_completewhen the server has them available.Motivation and Context
Issue
#320reports thatauthsome login --jsononly returns a minimal status payload even though the runtime already knows the session ID and next action. That makes interactive flows much harder for agents and other programmatic clients, which should not have to scrape terminal text or rely onwebbrowser.open(...).This change fixes that contract gap by preserving actionable session metadata in JSON mode while leaving the non-JSON behavior unchanged.
Fixes #320.
How Has This Been Tested?
Ran:
uv run pytestuv run ruff check src/ tests/uv run ty check src/uv run --with pre-commit pre-commit run --all-filesAlso added regression coverage for:
login --jsonresponses exposingsession_idandauth_urllogin --jsonresponses exposingsession_id,auth_url,user_code,verification_uri, andverification_uri_completeTypes of changes
Checklist: