Repository navigation
The router answers a placed org's lookup from its cache while the directory is down - #520
Merged
Merged
Conversation
This was referenced Nov 11, 2026
zlareb1
force-pushed
the
feat/cell-router-state
branch
from
November 11, 2026 14:48
3c8f568 to
681c892
Compare
zlareb1
force-pushed
the
feat/cell-router-lookup-cache
branch
from
November 11, 2026 14:48
59f8325 to
260150b
Compare
zlareb1
force-pushed
the
feat/cell-router-state
branch
from
November 11, 2026 15:11
681c892 to
221e6a5
Compare
zlareb1
force-pushed
the
feat/cell-router-lookup-cache
branch
from
November 11, 2026 15:11
260150b to
d3a17d0
Compare
zlareb1
force-pushed
the
feat/cell-router-state
branch
from
November 11, 2026 15:31
221e6a5 to
d1eedc8
Compare
zlareb1
force-pushed
the
feat/cell-router-lookup-cache
branch
from
November 11, 2026 15:31
d3a17d0 to
62935d3
Compare
zlareb1
force-pushed
the
feat/cell-router-state
branch
from
November 11, 2026 15:47
d1eedc8 to
4a6fdcb
Compare
zlareb1
force-pushed
the
feat/cell-router-lookup-cache
branch
from
November 11, 2026 15:47
62935d3 to
70d88ba
Compare
zlareb1
force-pushed
the
feat/cell-router-state
branch
from
November 12, 2026 00:17
4a6fdcb to
907e82c
Compare
…ectory is down, and the lookup before any cell is registered carries NO_CELL Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/cell-router-lookup-cache
branch
from
November 12, 2026 00:51
70d88ba to
a193b36
Compare
zlareb1
marked this pull request as ready for review
November 12, 2026 00:51
This was referenced Nov 12, 2026
Merged
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):
The router answers a placed org's
GET /cells/lookupfrom its cache while its directory cannot be read, and the lookup before any cell is registered answers 503 with the codeNO_CELL, which clients match instead of the message.Why
The sixth of the pull requests that implement cells. It stacks on #519. The page says that with the directory down, only "a lookup of an org it has not cached" answers 503, and that
loom login --orgkeeps its host only on theNO_CELLanswer. The router read the directory on every lookup and answered every 503 with free text, so an outage failed every lookup and a client could not tell "no cell yet" from "directory down". #497's description named both as still to come.Design
server/router/app.py,Router.lookup):(cell, host)with the time it was read;LOOM_ROUTER_DIRECTORY_CACHE_Sthe cached answer is given without a read; once older, the directory is read again, so a cell's changed host reaches the lookup;MAX_KEYS(the limiter's bound), forgetting the oldest read.NO_CELL:_refusedtakes an optionalcode, and the lookup's "the directory holds no cell yet" answer carriescode: "NO_CELL". The outage 503 carries none.NO_CELLis classedconfiguration, not retryable (CLASS_BY_CODE), since it is a settled answer the client acts on, anddocs/reference/errors.mdis regenerated to say so.LOOM_ROUTER_DIRECTORY_CACHE_S's description (and the generated settings reference) says it also bounds how long a placed org's lookup answer stands.Scope and risk
Router only. The cache is per replica and in memory; a restarted replica answers uncached orgs from the directory again. Each replica's lookups still go through its per-client limit before the cache.
Still to come with the routing pull request: routing rules 1 to 4 and the lookup's clients (
loom login --org, the org-first sign-in page, a typedWRONG_CELLerror).Compatibility, rollout and rollback
Additive: a field in one 503 body and a cache inside the router. Rolling back makes every lookup read the directory again.
Tests
tests/unit/test_router.py(70): a lookup before any cell is registered carriesNO_CELL; a looked-up org keeps its answer through a directory outage well past the window, while an uncached one answers 503 with no code; a cached answer is not read again within the window and is read again after it, picking up a changed host; an org with no placement is not cached and answers its own cell once placed; a down directory is read at most once a window per cached org, including by four lookups arriving together while a slow failing read runs; past its bound the cache forgets the oldest, which then answers 503 during an outage while the others keep theirs.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