fix(login): build the device-code approval URL from the CLI's own app base#36
Closed
hbrooks wants to merge 1 commit into
Closed
fix(login): build the device-code approval URL from the CLI's own app base#36hbrooks wants to merge 1 commit into
hbrooks wants to merge 1 commit into
Conversation
The device-code approval URL was taken verbatim from the server's verification_uri_complete. The backend fills that from ELLIPSIS_APP_BASE_URL, which is unset in every environment and defaults to https://app.ellipsis.dev — so a login against beta-api (or dev) prints a prod approval URL, and a code minted in beta Aurora can never be approved on the prod dashboard, hanging login forever. Build the URL client-side instead: new urls.cliAuthUrl(appBase, userCode) fed by resolveAppBase(), which already derives the app host from the configured API base (beta-api. -> beta-app.). The host now always matches the environment the CLI talks to. No new env var or config field — reuses the existing config.json apiBase chain.
Member
Author
|
Superseded by #37, which folds this login-URL fix into the |
hbrooks
added a commit
that referenced
this pull request
Jul 11, 2026
…te) (#37) Adds an `agent host` command group so the CLI can target Ellipsis Cloud, a preview environment, or a self-hosted deployment, and switch between them without re-exporting env vars. Config becomes a named set of hosts + an active pointer; each host keeps its own token (switching doesn't re-auth) and its own dashboard/app URL. The app/dashboard URL is derived from the API URL (api. -> app.) or set explicitly per host (--app-base) for self-hosted instances whose dashboard isn't a mechanical swap. `login` builds the device-code approval URL from the active host's app base, not the server's verification_uri_complete (which the backend defaults to prod) — this fixes beta/dev/self-hosted login and supersedes #36. Precedence unchanged (arg -> env -> active host -> prod default), so sandbox env injection still works. A pre-hosts v1 config is migrated in place on first load. Closes #36.
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.
What
agent loginprinted the approval URL verbatim from the server'sverification_uri_complete. The backend builds that fromELLIPSIS_APP_BASE_URL, which is unset in every environment and defaults tohttps://app.ellipsis.dev. So a login againstbeta-api.ellipsis.dev(or dev) sends you to the prod dashboard, where a device code minted in beta Aurora can never be approved — login hangs until it times out.Repro:
Fix
Build the approval URL client-side from the app base derived from our API base, not the server's copy:
urls.cliAuthUrl(appBase, userCode)(unit-tested, same pattern assessionUrl/configUrl).loginfeeds itresolveAppBase(), which already maps the configured API base to the app host (beta-api.->beta-app.,api.->app.) off the existingconfig.jsonapiBasechain.No new env var, no new config field — the host now always tracks the environment the CLI is pointed at.
Notes
verification_uri_completefor non-prod; that is a separate, lower-urgency config fix (setELLIPSIS_APP_BASE_URLper env and consolidate the three divergent app-host helpers). The CLI no longer depends on it.Test plan
bun run typecheckclean;bun run testgreen (189 passed, incl. newcliAuthUrlcases).ELLIPSIS_API_BASE_URL=https://beta-api.ellipsis.dev agent loginnow prints abeta-app.ellipsis.devapproval URL.