Repository navigation
fix(minimal): a refused sign-in request shows the error and error_description that GitHub sent - #3608
Conversation
A non-success reply to a sign-in request now names the OAuth error and error_description that GitHub sent. A transient error on the device code request adds the command to run again. The reply text is zeroized after it is parsed.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Un-drafted: the |
|
/review |
|
/arch-review |
|
Approved: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The design is silent on the text that min prints when GitHub refuses a sign-in request. Gatehouse §6.1.2 and the un-enrolled bullet of §6.10 state the flows and the keychain item, not this message. The change stays in crates/minimal/src/cmd/auth.rs. The reply text is still zeroized after the parse, and only error and error_description go into the message. No condition applies.
Ruled at 98daece against gominimal/arch@327e1b57d16b by claude-opus-5-5.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. A refused sign-in request now shows only the error and error_description fields that GitHub sent. The code zeroizes the rest of the reply. Design principle 7 (architecture.md line 337) requires that no secret reaches the output, and these fields carry none. The retry hint names min auth login --device, a command in the design grammar. The failed agent-verify test is in otel_cli, outside this change, so investigate it before you mark the PR ready.
Ruled at 98daece against gominimal/arch@327e1b57d16b by claude-opus-5-5.
norrietaylor
left a comment
There was a problem hiding this comment.
Gate passed at 98daece: minimal-review APPROVE, arch-review APPROVED, lanes green, no open threads.
Follow-up
Fixes #3584
crates/minimal/src/cmd/auth.rsTask marker
Proof
A 400 reply from /login/device/code with error=slow_down now makes
min auth login --devicefail with: "GitHub refused the sign-in request to (400 Bad Request). GitHub said: slow_down: <error_description>" and a second line "This refusal is temporary. Wait a minute, then runmin auth login --deviceagain." The test device_code_refusal_shows_github_error pins this exact text.Notes from the agent: post_form takes a new retry argument. The device code request passes
min auth login --device. The browser token exchange passes None, because its caller already ends with "Runmin auth loginto try again." Transient errors are slow_down and temporarily_unavailable. A reply with no OAuth error keeps the old message. I added a second unit test, refusal_without_a_transient_error_has_no_retry_hint, in the same file. All 31 cmd::auth lib tests pass, and clippy -p minimal --all-targets and fmt are clean. poll_device_token is unchanged: it already passes a 4xx OAuth error to device_flow, which prints it.Tests
cargo test -p minimal device_code_refusal_shows_github_errorVerify
min task run agent-verifyexited 100, so this PR is a draft.