Repository navigation
Coding context uses bounded lookups and leaves loading to the host - #868
Merged
Merged
Conversation
Allow the code skill to load automatically and reuse evidence supplied by hooks. Document tool discovery, managed permissions and how to distinguish automatic retrieval from explicit agent calls. Signed-off-by: zlareb1 <[email protected]>
Exclude local-first sessions from the automatic skill trigger and defer to the startup primer when the skill is loaded. A regression checks the exemption alongside automatic availability. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
The startup module changes only static code guidance. Its request builders and sender classifications are unchanged, so renew the canonical and generated source review hashes after checking their provenance. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Explain expected quiet paths and separate prompt code controls from memory recall. A private debug capture and matching server requests distinguish hook execution from context delivery. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Use exact symbol, caller and impact operations for clear named questions, keep conceptual search confidence, and skip self-contained or local-only requests. Bound first-prompt recall after empty answers and let later prompts receive fresh indexed evidence. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ed recall Named code-only questions leave default memory recall available for a later task. Requested definition bodies use the existing server budget and whole-unit elision; location and signature questions remain pointer-only. Signed-off-by: zlareb1 <[email protected]>
Use the existing Git status classification before symbol substitution for modified and untracked files. Leave eager tool loading opt-in while preserving all descriptors and permissions, and document which integration layer owns calls and validation. Signed-off-by: zlareb1 <[email protected]>
Recognize explicit saved decisions and preferences without searching code. Resolve clear named code requests before the memory-only exclusion, and keep memory recall when a mixed request asks what was decided. Signed-off-by: zlareb1 <[email protected]>
8 tasks done
A definition alone cannot establish its caller chain. Teach tool discovery and distinguish a semantic code question quoting an identifier from an explicit literal search. Match scope guidance to the MCP transport. Signed-off-by: zlareb1 <[email protected]>
Call graph output includes indexed overrides and inheritance. Retain the relation type and target instead of presenting every edge as a call site, and disclose bounded output. Renew the reviewed sender hashes for the changed renderers and startup guidance. Signed-off-by: zlareb1 <[email protected]>
Local code exclusions do not exclude a separate request for saved context. Preserve short, slash-command and supplied-only task boundaries while allowing mixed local and memory questions in both recall modes. Signed-off-by: zlareb1 <[email protected]>
7 of 8 tasks
Retain hook labels, native callback protection and connected-account contracts alongside bounded prompt context. Keep both coding-agent plugins at 1.2.37. Signed-off-by: zlareb1 <[email protected]>
zlareb1
added a commit
that referenced
this pull request
Nov 18, 2026
Related: #868 ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in a release) ### 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 `org` to 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 omit `org`, 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 - Wire: no operation, field, schema or setting changes. - Operator steps: deploy the server update. No plugin update, credential change, migration or re-index is required. - Rollback: reverting restores the omitted-organization refusal; stored data is unchanged. ### Tests - Eight regressions fail before the fix and pass after it: `code.symbol`, `code.callers`, `code.search` and `code.impact` over 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. - Four write replay regressions reproduce `IDEMPOTENT_CONFLICT` before the read-only restriction and replay the exact pre-upgrade hash after it. Their MCP routes retain `OP_NOT_ON_MCP`; no hidden write is exposed. Existing cross-transport replay checks also pass. - The focused transport, authorization and replay selection passes all 92 checks. The changed architecture page's link check and two public-copy checks pass. - Ruff, the function-length gate, the three changed transport modules' mypy check and whitespace checks pass. Full suites remain for CI; no live backend or provider is used by these checks. ### 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. - [x] I can explain every line of this diff and how it interacts with the rest of Loom. ### Checklist - [ ] Full formatting, lint, type, unit and integration checks pass in CI on this head. - [x] No generated API, schema or plugin files require changes. - [x] No migration is added. - [x] No plugin version or frontend changes are required. - [x] Documentation describes the identity handoff and operator steps. - [x] Public text contains no deployment details or credentials. - [x] Commits are signed off. Signed-off-by: zlareb1 <[email protected]>
zlareb1
added a commit
that referenced
this pull request
Nov 18, 2026
Related: #868 ### Changelog category (leave one): - Build/Testing/Packaging Improvement ### 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 SDK issue harness compares code-index lookups with an identical local-tool baseline and grades both patches outside the agent. Authorization refusals retain their status and execution stage, including during binding preflight and cleanup. ### Why A tool being connected does not show that an agent used it. Unequal test execution, missing usage after errors and collecting pre-existing edits can also distort an evaluation. The harness freezes the protocol before inference and retains unsuccessful attempts with their evidence. SDK authorization failures carry HTTP status metadata; a preflight refusal must stop before agent inference instead of appearing to be an agent provider failure. ### Scope and risk Adds a benchmark tool loop, process supervision, structured grader validation and documentation. Both arms share model instructions, local search with bounded context, file reads and edits. Neither agent can execute tests; an external evaluator uses the same declared checks and timeout. The treatment adds one read-only SDK binding. Tool choice remains automatic, and zero-use runs remain in the results. SDK HTTP 401, 403 and 409 errors and local permission failures produce `guard_refused`. Result artifacts record the execution stage, preflight state and whether the inference loop was attempted; unavailable progress remains unknown. SDK tool-time refusals retain HTTP status, code and request ID. Patch collection errors remain visible without replacing a refusal. Cleanup records its own stage and cannot replace the first refusal. Persisted refusals remain primary across supervisor timeouts, interruptions and nonzero exits; the outer outcome remains separately available. A failed preflight supplies no valid paired efficiency measurement. Controllers must stop on refusals before grading or advancing, including serialized HTTP denial metadata from an older worker. The harness measures code-index integration. It makes no long-term-memory or general performance claim. Provider calls require an explicitly requested run. No benchmark results are published by this change. ### Compatibility, rollout and rollback - Wire: no server operation, request field or default changes. `RESULT.json` adds `stage`, `preflight_status`, `preflight_failed` and `agent_inference_started` diagnostics, plus the raw outer `supervision` outcome. - Operator steps: none for the server. Benchmark users install the optional cloud dependency and Python SDK, provide an isolated checkout and configure an external grader. - Rollback: reverting removes the harness and documentation; user-created run artifacts remain outside the checkout. ### Tests - `python -m pytest tests/unit/test_sdk_issue_resolution.py -q`: 44 focused protocol tests pass, including typed SDK 401/403/409 preflight refusals, 400/503 neighbors, provider errors after successful preflight, cleanup-origin refusals, typed tool-time refusal metadata, patch-error refusal precedence, persisted denials across failed supervision, cleanup preserving the first guard, dirty setup refusal, partial patches, unfinished lookups, contextual search and contradictory grader reports. - Seven added preflight/provider cases failed on the committed runtime and passed with the fix. A further review regression selection reproduced seven failing guard paths with one passing non-refusal control; all eight cases passed after correction. A separate supervisor-boundary selection reproduced twelve refusal failures with three passing non-refusal controls; all fifteen passed after correction. All calls use mocks; no live model, backend or credential change was used for this validation. - Documentation links, public-copy checks, formatting, prose and generated documentation checks pass. - A fresh whole-head review accompanies the pushed source and CI. - Full CI passes on this head: 43 successful checks, two conditional publication skips and all four workflows successful. No local full-suite run was used. ### AI assistance in the code (leave one; writing this description with AI is fine): - AI-generated: Codex. Protocol parity, failure artifacts, grader outcomes and the whole diff were independently reviewed. - [x] I can explain every line of this diff and how it interacts with the rest of Loom. ### Checklist - [x] Full formatting, lint, type, unit and integration checks pass in CI; focused checks are listed above. - [x] Generated documentation index is regenerated. - [x] No migrations or plugin files change. - [x] No frontend files change. - [x] Documentation describes the implemented behavior and operator steps. - [x] Public text contains no private deployment details or credentials. - [x] Commits are signed off.
Keep the current server compatibility floor, use an unused plugin version, and record the loading-default change after the retained release cut. Document code and memory tool policies with receipt and freshness checks. 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
Coding-agent prompt context uses bounded symbol, caller and impact lookups for named questions, searches concepts, and skips supplied-only or local-only requests. Default memory recall skips named code-only questions, modified-file greps stay local, and MCP schema loading follows the host unless configured explicitly.
Why
A question naming a definition, callers or an edit target can use a typed lookup directly. An exact text search, supplied excerpt or local change has a different retrieval path. The prompt hooks select the matching path and keep requests within the existing bounds.
Memory recall has a separate one-attempt budget. A named code-only question leaves that budget for a later memory request. Mixed requests for saved decisions, conventions or lessons still qualify. An empty or abstaining reply consumes the attempt. Pointer deduplication applies within one reply so later turns can receive changed evidence.
Scope and risk
The hooks reuse existing operations and request models. Identifiers are bounded and redacted before sending; redaction that changes an identifier refuses the lookup. Empty or ambiguous typed results stay silent without another automatic request. Caller output retains relationship kinds, targets, static-analysis limits and truncation warnings.
Named implementation questions request a definition body within the existing 600-token budget. Location and signature questions retain pointers. An unambiguous, non-elided body is untrusted data; elided bodies do not trigger a fallback request.
Modified and untracked single-file greps use the existing local path. The code skill and startup guidance follow the same selective retrieval contract. The change also documents deferred-tool discovery, managed permissions, bare mode and hook delivery. Copyable code and memory policies cover scoped retrieval, fresh evidence, durable facts, corrections, code-reference limits and write receipts.
The MCP eager-loading default changes from
code.search,code.symbolto an empty list. Tool names, schemas, roles and annotations stay available. Loading follows the host; an explicit operation list still requests eager loading. Discovery may add a turn. Model tool selection, task quality, latency and cost improvement require separate measurements.Compatibility, rollout and rollback
LOOM_MCP_ALWAYS_LOAD_TOOLS=code.search,code.symbolretains explicit eager loading.Tests
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex wrote the hook changes, documentation and regressions, inspected the wire models and sender provenance, and reconciled the release composition.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist