Repository navigation
Code reads receive their authorized organization - #913
Merged
Merged
Conversation
An omitted optional organization remains blank in the validated code input even when authorization resolves it from the token. Copy that approved target into the handler input without importing the caller memory namespace or replacing explicit identity. Signed-off-by: zlareb1 <[email protected]>
Idempotent writes retain their validated organization so cached request hashes match across adjacent builds. Pass the operation into the shared target handoff while preserving existing namespace filling and explicit identity. 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.
Related: #868
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):
Code reads with an omitted organization use the organization already approved by authorization over HTTP and MCP. Calls no longer fail when the token supplies the organization and the deployment has no default code organization.
Why
Code input models default an omitted
orgto an empty string. The shared gate resolves the authorized organization from the request, code-plane default or verified token, but its handoff fills only the namespace. A handler receiving the empty organization then refuses the call when no code-plane organization is configured. MCP tool schemas omitorg, so a client following the advertised schema encounters this failure.For read-only operations, the handoff copies an absent optional organization from the authorized target. Code calls keep their repository namespace and never inherit the caller's personal memory namespace.
Scope and risk
The shared post-authorization handoff fills a read-only operation's optional organization and preserves explicit values. Writes retain their existing validated organization and canonical idempotency hash so a request can replay across adjacent builds. Existing namespace filling also remains in place for writes. Target selection, validation of required fields, namespace grants, cross-organization checks and connection-header precedence keep their existing rules. HTTP and MCP use the same helper. The architecture page describes this contract.
Compatibility, rollout and rollback
Tests
code.symbol,code.callers,code.searchandcode.impactover HTTP and MCP with an explicit code namespace and omitted organization.pytest tests/unit/test_code_transport_target_org.py -q: 32 checks pass, including deployment and explicit organization precedence, missing grants, cross-organization refusal, an unresolved organization, connection headers, auth-disabled defaults and required fields.IDEMPOTENT_CONFLICTbefore the read-only restriction and replay the exact pre-upgrade hash after it. Their MCP routes retainOP_NOT_ON_MCP; no hidden write is exposed. Existing cross-transport replay checks also pass.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex prepared the source fix, transport regressions and documentation; the authorization handoff and neighboring cases were checked.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist