Repository navigation
feat: sign in to Copilot from vibe-kanban, and restore the Sign in button - #3498
Merged
Merged
Conversation
The legacy cleanup (139b181, #2790) removed NextActionCard, the only caller of runAgentSetup, so needs_setup was computed but never shown. The next-action row now reaches the conversation list only when needs_setup is set, and renders a Sign in button for agents with the SETUP_HELPER capability. It calls runAgentSetup with the failed turn's own executor profile (carried as NextAction.executor_profile_id), so a variant signs in with its own config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cursor's CLI now says "run 'agent login'" instead of "run 'cursor-agent login'", so the exact-message match missed it and the error was tagged Other, with no Sign in button. Match on "Authentication required" and "login" instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A signed-out ACP agent rejects session/new with -32000 (AuthRequired), and an expired token does the same on session/prompt. The harness flattened every error into a string, so the user saw a generic error. The run's exit error is now logged as AcpEvent::AuthRequired when its code is -32000, and normalize_logs turns that into a SetupRequired error entry, which is what offers the Sign in button. Other errors are unchanged. Session history skips the new event, like Error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_codex_setup and run_cursor_setup repeated the same steps: chain the workspace's latest coding-agent action after the setup action, ensure the container, find or create a session, and start it as a setup script. That's now start_agent_setup in agent_setup.rs, and each agent keeps only its own setup action. No change in behaviour; this is so the Copilot sign-in doesn't add a third copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot now has the SetupHelper capability, and the agent setup API has a Copilot branch. It runs `<copilot base> login --device-code` as a setup script, then the failed prompt again. - Copilot::login_command() takes the package from base_command(), so it matches the run (cached registry, no network) and honours base_command_override. It drops the run args (--acp) and ignores additional_params, which are run flags login would reject. - --device-code prints a code and link in the conversation, needs no browser on the backend's machine, and works without a TTY. - The script carries no env: it's saved in the database and shown in the output, and profile env can hold tokens. Copilot's sign-in doesn't depend on env. - On Unix the program and args are shell-quoted, so paths with spaces work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A login script waiting for a device code printed "visit <url> and enter code <code>" only to its logs, so the conversation showed just "Tool Install Script - Running". While a script runs, its output is now checked for a link and a code on the same line (parseDeviceCode, not agent-specific). If both are there, a card under the script shows the code and a "Copy code and open <host>" button. The button copies the code in the user's browser, then opens the page, and only then says the code was copied. A CLI's own copy lands on the backend's machine, which isn't the user's when it runs remotely. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In device-code mode Copilot opens the sign-in page on the backend's machine, which took the user away before they saw the code card. The login script now runs with BROWSER=true (Copilot honours BROWSER, and `true` does nothing), so the user stays in the conversation and opens the page from the card. Unix only; Windows keeps Copilot's default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Option discovery opens a throwaway session with session/new, so a signed-out agent fails it with -32000 too. The model selector then showed the agent's message plus the last stderr line. It now shows "Not signed in. Start a task and click Sign in." instead. The text is agent-agnostic, and the failure is still not cached. A Unix test runs run_live against a fake sh agent that rejects session/new with -32000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Registry agents share the discovery code but don't get SetupHelper, so "Start a task and click Sign in." sent their users to a button that never appears. The model selector now says "Not signed in to this agent." Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parseDeviceCode ran on every running script, including the user's own setup and cleanup scripts, so a line with a link and something like a request ID or ticket key (ABCD-1234) could show "Enter this code to sign in" with a button opening that link. Only the app's own install/login scripts run as Tool Install Script, so the card now needs that too. The parser stays generic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot sends `auto` twice: as its own entry and again in the model list. We kept both, so the selector showed Auto twice. Keep the first choice for each value, and drop repeats from lists already saved in the disk cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Discovery runs once per stream connection, and a failure is kept for 30s, so after signing in the selector kept showing "Not signed in" and the old list until the page was reloaded. - When a run opens a session, forget the agent's failed discovery: the agent works now. Copilot and registry agents pass their discovery key. - When the dropdown opens while it shows an error, reconnect the stream so discovery runs again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 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.
Why
A signed-out Copilot rejects
session/newwith ACP error -32000 (AuthRequired), andinitializestill succeeds. The harness turned every error into a string, so users saw a generic error and had no way to sign in from vibe-kanban.The sign-in flow for Cursor and Codex was broken too. The legacy cleanup in 139b181 (#2790) deleted
NextActionCard, the only caller ofrunAgentSetup. Since thenneeds_setupwas computed but never rendered. This PR brings the Sign in button back for Cursor and Codex as well.What changed
Each commit builds on its own:
feat(ui))needs_setupis set. It renders Sign in for agents with theSETUP_HELPERcapability.runAgentSetupwith the failed turn's own executor profile, carried as a new optionalNextAction.executor_profile_id, so a variant signs in with its own config.fix(cursor)): Cursor's CLI renamedcursor-agenttoagent, and its sign-in message changed with it. The exact-text match missed the new wording, so the error was taggedOtherand no button showed. It now matches "Authentication required" + "login".feat(acp)): a newexit_eventturns a -32000 run error intoAcpEvent::AuthRequired, whichnormalize_logsmaps toNormalizedEntryError::SetupRequired. This coverssession/new(signed out) andsession/prompt(token expired mid-session), since both return throughrun_session. Other errors are unchanged.refactor(server)): the duplicated chain-and-start code fromcodex_setup.rsandcursor_setup.rsmoved intoagent_setup.rs::start_agent_setup. No change in behaviour.feat(copilot))SetupHelper, and the agent setup API has a Copilot branch.Copilot::login_command()builds<base> login --device-codefrombase_command(). That's the same registry package as a run, read from the cache with no network, andbase_command_overrideis honoured. It drops the run args (--acp) and ignoresadditional_params.--device-codeprints a code and link we can show, needs no browser on the backend's machine, and works without a TTY. Setup scripts get stdin = null.execution_processes.executor_actionand shown in the output, and profile env can hold tokens. Copilot's sign-in doesn't depend on env.feat(ui))parseDeviceCodeisn't agent-specific: it looks for a link and a code on the same line. The card shows only for Tool Install Scripts (the app's own agent andghsetup), never for the user's setup or cleanup scripts, where a link next to a request ID or ticket key could look like a code.fix(copilot)): in device mode Copilot opens the sign-in page on the backend's machine, which took the user away before they saw the card. The login script now runs withBROWSER=true. Copilot honoursBROWSER, andtruedoes nothing.feat(acp)): discovery also opens a session withsession/new, so it gets the same -32000. It now says "Not signed in to this agent." instead of the raw message plus a stderr line. It doesn't mention a Sign in button, because registry agents share this code and don't have one. Like any failed discovery, it isn't cached.fix(acp)): Copilot sendsautotwice, as its own entry and again in the model list, so the selector showed Auto twice. Reading an agent's options now keeps the first choice for each value, and lists already saved in the disk cache drop their repeats when read.fix(acp)): discovery ran once per stream connection, and a failure blocked a new one for 30 seconds, so after signing in the selector kept "Not signed in" and the old list until a reload.attemptquery param the backend ignores), so discovery runs again.Also:
packages/web-core/vitest.config.tswith the app's aliases. Before this,npx vitest runcouldn't resolve@/andshared/, and 2 of the 3 existing test files failed. Vitest still isn't a dependency or run in CI.Reviewer notes
copilot login, thengh auth token. Users signed in togh, or with a token in their env, never see it.AcpServer) show the setup-required message but no button, and the API returnsSetupHelperNotSupportedfor them.start_agent_setupreruns the workspace's latest coding-agent action, in the workspace's latest session, not necessarily the session where you clicked. That was already true for Cursor and Codex; Copilot now has it too.session_idinRunAgentSetupRequest, so sign-in reruns the prompt of the session you clicked in.initializeofferscopilot-loginwith notype. When we declareclientCapabilities.auth.terminal, it adds_meta["terminal-auth"] = { command, args: ["login"], label }. That's the older extension, not ACP'stype: "terminal".Testing
cargo test -p executors(118 passed) andcargo test -p server. New tests cover:with_timeout, andexit_eventwith and without a message;normalize_logsturningAuthRequiredintosetup_required;shagent that rejectssession/newwith -32000, checked to fail without the fix;configOptions, legacymodels, and the disk cache);forget_failureclearing a failure but not a recent success.npx vitest runinpackages/web-core: 29 passed. New tests cover the next-action filter, the executor-profile helper andparseDeviceCode.pnpm run check,pnpm run lint,pnpm run generate-types:check.ghonPATH, token env unset,/logout): setup-required, then the button, then the device code card. After authorising, the prompt runs again.🤖 Generated with Claude Code