Repository navigation
loom login --org signs in at the org's cell, as the router's lookup names it - #522
Merged
Merged
Conversation
Merged
8 of 9 tasks
zlareb1
force-pushed
the
feat/cell-wrong-cell-error
branch
from
November 11, 2026 14:48
9dbb584 to
ee490a8
Compare
zlareb1
force-pushed
the
feat/cell-login-org
branch
from
November 11, 2026 14:48
452ee5c to
9ce65fe
Compare
zlareb1
force-pushed
the
feat/cell-wrong-cell-error
branch
from
November 11, 2026 15:11
ee490a8 to
c342df7
Compare
zlareb1
force-pushed
the
feat/cell-login-org
branch
from
November 11, 2026 15:11
9ce65fe to
7d23c72
Compare
zlareb1
force-pushed
the
feat/cell-wrong-cell-error
branch
from
November 11, 2026 15:31
c342df7 to
5386e61
Compare
zlareb1
force-pushed
the
feat/cell-login-org
branch
from
November 11, 2026 15:31
7d23c72 to
649c4e8
Compare
zlareb1
force-pushed
the
feat/cell-wrong-cell-error
branch
from
November 11, 2026 15:47
5386e61 to
1f1a1b2
Compare
zlareb1
force-pushed
the
feat/cell-login-org
branch
from
November 11, 2026 15:47
649c4e8 to
6002130
Compare
zlareb1
force-pushed
the
feat/cell-wrong-cell-error
branch
from
November 12, 2026 01:10
1f1a1b2 to
f920c51
Compare
…ames it Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/cell-login-org
branch
from
November 12, 2026 01:40
6002130 to
b5f0cad
Compare
zlareb1
marked this pull request as ready for review
November 12, 2026 01:40
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
loom login --org <org>(andloom.login(org=…)) signs in at the org's own cell, as the router'sGET /cells/lookupnames it. With no router, or no cell registered yet, it signs in at the server it was given; it waits out the router's 429 for at most--waitseconds (default 120); on any other answer it refuses without starting a sign-in.Why
The eighth of the pull requests that implement cells. It stacks on #521. The page says
loom login --orgstarts every flow at the org's cell host so no flow crosses cells, with these exact rules per lookup answer. #497 and #520 added the lookup and itsNO_CELLcode; this adds the client.Design
loom.credentials.org_server(server, org, *, wait_s)asksGET {server}/cells/lookup?org=:https://and the cell's host, whatever the router's own scheme (its URL may be a local port-forward; the cell is reached in the open); a host that is not a barename[:port]the sign-in can reach (not a string, userinfo, a path, a query, a bad port, whitespace, or oneurlsplitor httpx rejects; the host must be its whole netloc, so even an empty?or#refuses) or a body that is not JSON refuses, naming the router, as the router's fault (INVALID_RESPONSE, classedinternal);NO_CELL:serveritself; the code is matched, never the message;Retry-After, read as the transport reads it (loom.transport.parse_retry_after: seconds or an HTTP-date) and held to 1 to 60 s, and asks again, until the next wait would passwait_s, then raisesRateLimited(status 429, so classedcapacity, retryable) naming the router's wait and the--waitleft; time goes through a seam (_monotonic) so the loop is tested;dependency, retryable, as the SDK's other sign-in errors are; every refusal after an answer carries the router's status.login(..., org=None, wait_s=120)refuses await_sthat is negative or not finite (with or without an org) and an empty org, then resolves the server first, says which cell host it chose when it is not the same server (same_server), then signs in there as before. The sign-in's own check that a server's endpoints are its own still applies at the cell host.loom logingains--organd--wait(sdk/python/loom/cli.py);--waitwithout--org(whatever its value),--org "", and a--waitthat is negative or not finite (nan,inf) are refused;loom.login(org="")refuses too.loom.login(org=…), and that the session is then the cell host's, sobase_urlorLOOM_BASE_URLpoints there), the CLI reference's session-commands paragraph, the guide to using Loom without the dashboard, and the page's code map.Scope and risk
SDK only, and only with
--org: aloom loginwithout it is unchanged. Still to come with the routing pull request: routing rules 1 to 4, the first cell's org-first sign-in page, and the page's two-cell integration test forloom login --org(no router,NO_CELL, a 429 until--waitruns out, a down directory with a cached and an uncached org).Compatibility, rollout and rollback
Additive flags and keyword arguments. Against a deployment with no router the lookup's 404 keeps the server, so
--orgis harmless there.Tests
tests/unit/test_sdk_credentials.py: with--org, the lookup asks for that org (org=beta), the sign-in happens at the cell host the router names and the stored session names that server; a 404 and aNO_CELL503 keep the given server; an outage's 503, a 500 and an answer with no host refuse with no sign-in started and nothing stored; a 429 is waited out (theRetry-Afterhonoured) and the sign-in goes on at the cell; withRetry-After: 7and a 20 s--waitit waits twice and then refuses as aRateLimitedclassedcapacity, with status 429, with no sign-in; anhttprouter still sends the sign-in tohttps://at the cell; each malformed host (including[eu-2and999.1.1.1) refuses with no sign-in, classedinternal, with status 200; an outage's 503 is classeddependency, retryable, with status 503, and a 400 is not retryable, with status 400; a body that is not JSON refuses naming the router; a lookup naming the given server (case and all) prints no 'Org … is at';--waitwithout--org(whatever its value),--org "", and a--waitthat is negative or not finite (nan,inf) are refused;loom.login(org=""), await_sofnan,infor -1 (with or without an org) refuse with no lookup and no sign-in; the lookup asks for the org it was given; aRetry-Afterof 7,inf,nan,soon, 600 or 0 is waited as 7, 1, 1, 1, 60 and 1 s. The fake server now advertises each host's own endpoints, as a cell does at its own host.NO_CELLcase made its test fail.make lintandmake typecheckpass. The full unit suite has not run on this stack.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass (the full unit suite result follows in Tests).docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code