Repository navigation
The code.repo ops that register or change a repository refuse when code intelligence is off - #211
Merged
Merged
Conversation
9 tasks done
zlareb1
force-pushed
the
fix/code-repo-ops-kill-switch
branch
from
November 3, 2026 11:45
2b6de18 to
d76603e
Compare
zlareb1
force-pushed
the
fix/code-repo-ops-kill-switch
branch
3 times, most recently
from
November 3, 2026 13:08
4f026d2 to
40bb1d7
Compare
LOOM_CODE_INTEL_ENABLED is checked at the top of every code.* handler except the six repository-admin ones, which registered and changed repositories with the switch off. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…s over the ops Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…st patches settings directly Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ne sweep round Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
code.repo.remove only deletes: refusing it left a maintainer no way to retire an index on a code-off deployment, while the workers kept building it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…e HTTP route Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
fix/code-repo-ops-kill-switch
branch
from
November 3, 2026 13:18
40bb1d7 to
83bf14d
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…hat stay on Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
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):
With
LOOM_CODE_INTEL_ENABLED=false, thecode.repo.*operations that register or change a repository (add, add a branch, list remote branches, set access, set source) answer a precondition error like every othercode.*operation.code.repo.removestays available, so an index can be retired on a deployment with code off.Why
code_intel_enabledis the code plane's kill switch. Its setting comment says it is checked at the top of everycode.*handler (require_code_intel). The six handlers inserver/code/app/repo_admin.pynever called it; five of them now do.So with code intelligence off and self-service on (
code_self_service_enableddefaults to on):code.repo.addprobed the sandbox and registered a repository;code.repo.set_accessandcode.repo.set_sourcechanged repository state. (code.repo.removeran too; it stays available on purpose, see Scope and risk.)The deployment the switch exists for, one that serves memory without the code index, still let maintainers start indexing.
Calling every
code.*handler in the registry with the switch off found exactly these six.code.search,code.grep,code.callersandcode.calleescall it from the function they delegate to.Scope and risk
repo_adminhandlers, and a comment oncode.repo.removesaying why it is exempt.code.repo.removeonly deletes, so it is not behind the switch. Refusing it would leave a maintainer no way to retire an index while the code workers, each on its own switch (only the coverage workers follow this one), keep building it. With the switch off the dashboard cannot list repositories (code.reposrefuses), so a retirement goes throughcode.repo.removeover HTTP, MCP or the SDK. The replica that serves the call removes its mirror; the other replicas sweep theirs only once code intelligence is on again, as the repositories and operations pages say.code.repos, and its Add repository button (shown from the sandbox check, not the switch) now gets the precondition error fromcode.repo.remote_branches/code.repo.addinstead of registering a repository.code_intel_enabledcomment (and the generated configuration reference, settings schema and example file) names the exception.Compatibility, rollout and rollback
LOOM_CODE_INTEL_ENABLED=false, fivecode.repo.*ops answerPRECONDITION_FAILED.Tests
tests/unit/test_code_kill_switch.pycalls the handler of everycode.*op in the registry butcode.repo.remove(51) with the switch off and an empty input, and expects the precondition error before anything is read; a new code op that skips the switch fails it. A second test checks thatcode.repo.removegets past the switch and its confirm check, and reaches the registry lookup (NOT_A_REPOwith an empty registry).code.repo.*cases fail onmainand pass here.test_package_contracts.py, pass (148 tests).mypy_gate) and the function-length gate pass.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. The six handlers were found by inspecting every
code.*handler in the registry for the switch.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lintandmake typecheckpass; the targeted unit files above pass, and CI runsmake test-unit.docs/reference/configuration.md,schemas/loom-settings.schema.jsonandloom.example.yamlcome from thecatalog.pycomment (settings_reference,settings_schema,settings_example).main; no merged migration is edited (none).frontend/changed (unchanged).docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s).🤖 Generated with Claude Code