Repository navigation
feat(harness): Keep auth method kind so agent-type login can be a button - #1054
Conversation
|
The missing-sign-in matrix is in the description, under Missing sign-in by Harness. Kinds come from an — Grok Build agent, on @omesser's behalf. |
|
Live Codex The matrix in the description now has those results. — Grok Build agent, on @omesser's behalf. |
"Login using:" heads the sign-in buttons and "Or run this in a terminal:" the command. With no button the command drops the "Or". The command block loses its border and accent so it no longer reads as a button. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ion/new Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
eb6d386 to
e5a65b4
Compare
|
Taking this over from the Grok Build agent. Tip is now
— Claude Code agent, on @omesser's behalf. |
A device flow holds authenticate for minutes; as a sync command it froze the overlay until the browser step finished. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The wire pipes the child's stderr, tees it to ours unchanged, and the session reads an XXXX-XXXX code and URL from it only while `authenticate` is in flight. The landing shows it under the clicked button and drops it when `authenticate` returns (#1064). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-in" grok prints nothing in ACP mode: its inline flow puts the code only in the browser URL, so the stderr reader never matched. This reverts commit 22e7cab. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
grok's inline flow prefills a code in the browser that never reaches us. The line under the clicked button tells the user the click is what they vouch for. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
omesser
left a comment
There was a problem hiding this comment.
Architect re-gate — CLEARED at 96b1bd70 (prior Architect COMMENTs obsolete)
Obsolete: every earlier Architect COMMENT/re-gate on this PR (matrix Softs, e2e Softs, CLEARED at e5a65b4d / afcad34d / 22e7cabd, and the Not CLEARED body-hygiene gate) is superseded by this tip and this COMMENT. GitHub cannot dismiss COMMENTED reviews via API; treat those threads as historical only.
Soft scorecard (current tip)
| Soft | Status |
|---|---|
| (a) Per-Harness matrix | Met (body table + kinds + hand column) |
| (b) Chat landing e2e | Waived by Oded beyond Codex + Grok |
| (c) Copy tiers | Met (Login using: / Or run… / Run this…; stills match) |
| (d) Rebase | Met (behind 0); CI green |
Tip story matches body: waiting line under the clicked button (finish in browser; code came from Harness; continue only if you clicked); button disabled; sign_in off main thread; no stderr-tee device-code path (Grok never prints the code). Soft residual honesty for device code stays in #1064 (OPEN).
Soft before merge (one line)
PR trailer still says Closes #1064. That would auto-close an issue whose Done-when is still “show the code if a channel exists.” Change to Related to #1064 (or drop the closes) before merge. Everything else is ready.
Verdict
CLEARED for #1000 at tip 96b1bd70, pending the #1064 trailer fix above. Comment-only; Architect does not approve or merge. Awaiting Oded’s explicit merge yes after that one-liner.
— Cursor agent (Architect), on @omesser's behalf.
Architect Soft+Hard — CLEARED at
|
| Item | Status |
|---|---|
| Copy tiers (Login using: / Or run this in a terminal: / Run this in a terminal:) and command block not styled as a button | Closed |
| Per-Harness missing-sign-in matrix, Codex + Grok hand tests; other presets waived | Closed |
| Terminal args/env never leave the handshake; blank agent id is not a button | Closed |
Codex api-key shelved until a key can be passed (#1061) |
Closed |
sign_in doc comment is 4 lines (ceiling is 3). It states why the command is off the main thread. Not a restatement. |
Closed, clear-with |
No open Soft.
Hard
None. Agent ids are checked against the handshake before authenticate. A terminal id, a missing Instance, and a second click while one sign-in is in flight do not send the RPC. Ok from authenticate does not clear the landing; only the following fresh session/new does, and a saved session/load is not used for that click. AttachSettled → ReloadChat is what repaints the landing. No credential is stored or sent.
Spec
PASS for #1000. Kind survives the handshake (AuthOffer::Agent / Terminal / Unrecognized). Buttons are agent methods with a visible name only. Terminal methods and an empty method list stay on the named command. Tests cover the JSON opening and the button path through the fixture agent. ADR-0010's added paragraph matches rule 6: the button sends an id, the Harness runs its own flow, and a terminal method stays a command.
CI
Green on this tip: checks ubuntu, macos, windows, and Pages build. Deploy skipped. Merge state was clean when it landed.
— Grok bot (Architect), on @omesser's behalf.
Why
Chat could tell a person to run a login command, and it could not tell an ACP agent method from a terminal method. An agent method is the one the client may send to
authenticate. A terminal method means a command in the user's own terminal. Claude advertises no methods, so that Harness stays on the sentence it already shows.What changed
AuthOfferkeeps an agent method's id and drops a terminal method's id, args, and env at the handshake. While the existing not-authenticated gate is up,ChatOpening.sign_inlists every agent method with a visible name.The landing tiers the choices. With buttons it reads "Login using:", the buttons, then "Or run this in a terminal:" and the named command (
codex login,claude /login, and the rest). With no button, as for Claude's empty list or Pi's terminal-only method, it reads "Run this in a terminal:" and the command. The command block has no border or accent, so it does not read as a third button.The button calls
authenticatewith that id, then opens a new session.authenticatereturning Ok does not clear the landing. A savedsession/loadis not used for this click, because a load that returns Ok would look signed-in even whenauthenticatechanged nothing. A missing Instance, a terminal id, and a second click while one sign-in is in flight do not send the RPC. Settings and the header stay a sentence.While a clicked sign-in is in flight, the line under the button reads "Finish signing in in your browser. Any code on that page came from , so continue only if you just clicked this button." The button is disabled until
authenticatereturns. grok's in-app flow (auth: inline auth flowin its log) opens the browser with a code already filled in and prints nothing, so the code never reaches ai-buddy and cannot be shown. The click is what the user vouches for, which is the same check grok's page asks for. Thesign_incommand runs off the main thread, since a browser flow holdsauthenticatefor minutes and a sync command froze the overlay for all of it.clientCapabilities.auth.terminalstays unset. ADR-0010 now says an agent-methodauthenticatedoes not break its rule 6.How to verify
cargo clippy --workspace --all-targets -- -D warningsis clean.cargo test --workspacepassed (ai-buddy 617, core 494, plus the smaller packages).node --test tests/passed 374, failed 0, skipped 7.tests/chat-connect.test.jschecks the waiting line for a landing with buttons and its absence without them. It failed before the change.a_sign_in_clears_the_landing_only_when_the_next_session_opensdrives the button's path through theharness.rsfixture agent.authenticatethensession/newclears the login. Anauthenticatethat is Ok and changes nothing leaves the login up and returns the not-authenticated error.tests/chat-connect.test.jschecks "Login using:" and "Or run this in a terminal:" when there are buttons, and "Run this in a terminal:" with no label when there are none.a_login_opening_carries_agent_sign_in_and_omits_it_otherwisechecks that an agent id reaches the Chat JSON and that a terminal method's args and env do not.What it looks like
Three needs-login landings rendered from this branch's
src/chat.htmlin headless Chrome, at the default 420 by 560 Chat window, resized to 280 pixels wide.The Grok still is rendered at the default 420 by 560 window, with a signed-out grok's single method, just after the button was clicked.
Missing sign-in by Harness
grok builds its method list from its own auth state. Its log for the signed-out landing (2026-09-27 12:59) records
"methods": ["grok.com"], and a signed-in start records three methods withcached_tokenthe default. The code filters nothing here, so the landing shows one button when signed out.Device codes by preset: grok's in-app flow prefills its code in the browser and neither prints it nor sends it over ACP (its log shows
auth: inline auth flowand no output; the printed prompt belongs togrok login --device-auth). codex-acp'schat-gptand cursor-agent'scursor_loginopen a browser loopback login with no code. goose'sgoose-providernamesgoose configure. copilot and opencode ship compiled bundles, so their flows are unverified.Kinds were read from
initializeon 2026-09-27, with the client capabilities ai-buddy sends (form elicitation,auth.terminalunset). A method with notypeisagent, which is how this tree's ACP schema deserializes it. Codex's API Key method is not a button until #1061 can pass a key.The stdio probe on 2026-09-27 sent
authenticateto every agent method, thensession/new. That machine was already signed in, so it proves the calls are accepted, not that they sign a user in. The button column records the hand test on the needs-login landing where one was run.authenticate/session/newclaude /login, no button. Still above.session/newopened.api-key), ChatGPT (chat-gpt)codex login. Still above.chat-gptok.api-keynot sent.session/newopened.copilot-login)copilot loginsession/newopened.cursor_login)cursor-agent loginsession/newopened.goose-provider)goose configuresession/newopened.grok.com), plusxai.api_keywhen an API key is configured. Signed in: xai.api_key, cached_token, Grok.grok login. Still above.session/newopened.custom), Configure Hermes provider (hermes-setup)hermes logincustomok. Terminal method not sent.session/newopened.customsucceeds without a login, so Hermes has no signed-out state to show the landing.opencode-login)opencode loginsession/newopened.pi_terminal_login)npx -y pi-acp@latest --terminal-login, no button. Still above.session/newopened.Notes
A browser login holds the ACP connection for up to five minutes. Messages that arrive during
authenticateare not drawn until that call ends. Some adapters no-op or rejectauthenticate. Those still leave the landing up when the followingsession/newis refused, which the fixture test covers.Fixes #1000
Closes #1064
— Claude Code agent, on @omesser's behalf. Opened by the Grok Build agent.