diff --git a/docs/features/code-index/history-and-prs.md b/docs/features/code-index/history-and-prs.md index a68506ba21..9c0a6f0dfa 100644 --- a/docs/features/code-index/history-and-prs.md +++ b/docs/features/code-index/history-and-prs.md @@ -83,8 +83,8 @@ a decision recorded or changed after the merge shows up on the next read. It rea first `LOOM_CODE_REVIEW_BRIEF_RATIONALE_PATHS` (10) changed files, source files first, of those the brief stores, and keeps at most `LOOM_CODE_REVIEW_BRIEF_RATIONALE_ROWS` (8) rows, those with something to check first. It serves whole rows, `check` rows first and -then constraints, up to `LOOM_CODE_REVIEW_BRIEF_RATIONALE_TOKENS` (250) tokens, and always -the first row; the tier's budget may still trim the section like any other. Each row +then constraints. `LOOM_CODE_REVIEW_BRIEF_RATIONALE_TOKENS` defaults to `0` (unlimited); +a positive setting or request token budget trims whole rows to fit. Each row carries the pre-edit block's line for it with its value cut at the line length (source, `(pinned)` and the code-change note kept), `pinned`, `code_state` and a `verdict`. Each changed file read is one `memory.for_file` read: four ClickHouse reads (files match, code diff --git a/docs/features/code-index/operations.md b/docs/features/code-index/operations.md index a3067dc946..6124791bc5 100644 --- a/docs/features/code-index/operations.md +++ b/docs/features/code-index/operations.md @@ -129,6 +129,17 @@ located = await agent.code.enclosing(["src/quota/limiter.py:88", "src/api/routes `bodies: "none"` (spans and signatures only, the cheapest answer), `token_budget`, `expand` (one LLM hop to bridge wording to identifiers) and `cursor` for the next page. +`code.search` has no response token cap by default. Set +`LOOM_CODE_SEARCH_TOKEN_BUDGET` to a positive token count to set a deployment default; +`0` means unlimited. A request's `token_budget` overrides that default, including +`token_budget: 0` for an unlimited response. This applies to HTTP and MCP, cursor pages +and searches across repositories. `top_k` still limits the number of results per page, +and `bodies: "none"` still returns pointers without code bodies (the MCP default). +Small finite budgets prioritize result heads over optional risk annotations. + +For a Compose installation, put the variable in the `.env` file beside `compose.yaml` +and recreate the server container after changing it. + ## Follow a specification to code and back Repository Markdown and imported knowledge documents take different paths. An indexed @@ -334,3 +345,20 @@ Adding, branching, restricting and removing repositories (`code.repo.add`, - [history-and-prs.md](history-and-prs.md) — the PR plane, bisect, backports - [Python SDK reference](../../reference/python-sdk.md), [MCP reference](../../reference/mcp.md) - [operations reference](../../reference/operations.md#code) — generated arguments + +### Response token limits + +Code retrieval returns selected context without an implicit token cap. `code.symbol`, +`code.enclosing`, `code.outline`, `code.trace`, `code.context_pack`, `code.map` and +`code.review_brief` default `token_budget` to `0` (unlimited). A positive value opts +into a cap. Symbol lookups return complete retained bodies, including large containers; +explicitly capped container lookups can return a skeleton and member outline. + +`code.ask` uses `code_ask_token_budget` when the request omits a budget; the setting +defaults to `0`. An explicit request value of `0` overrides a finite deployment cap. +Attached file lessons use `code_result_lessons_tokens`, also unlimited by default. +The internal code grounding reads for memory questions likewise default to no token cap. + +Result counts, requested body modes, access checks, source completeness checks and +execution deadlines still apply. Unlimited does not reconstruct source absent from the +index. Model generation limits are separate from retrieval context limits. diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 76c28f2dff..6e71bb2db7 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -44,6 +44,11 @@ Every change to a setting's default, from `server/settings/_history.py`. A deplo | Release | Variable | Was | Is | Why | | --- | --- | --- | --- | --- | +| 1.3.1 | `LOOM_CODE_REVIEW_BRIEF_RATIONALE_TOKENS` | `250` | `0` | Return selected review rationale without an implicit token cap. | +| 1.3.1 | `LOOM_MEMORY_ASK_CODE_SEARCH_TOKEN_BUDGET` | `1400` | `0` | Return selected retrieval context without an implicit token cap; positive values opt in to a cap. | +| 1.3.1 | `LOOM_MEMORY_ASK_CODE_SYMBOL_TOKEN_BUDGET` | `400` | `0` | Return selected retrieval context without an implicit token cap; positive values opt in to a cap. | +| 1.3.1 | `LOOM_CODE_RESULT_LESSONS_TOKENS` | `250` | `0` | Return selected retrieval context without an implicit token cap; positive values opt in to a cap. | +| 1.3.1 | `LOOM_CODE_ASK_TOKEN_BUDGET` | `4000` | `0` | Return selected retrieval context without an implicit token cap; positive values opt in to a cap. | | 1.3.1 | `LOOM_MCP_ALWAYS_LOAD_TOOLS` | `'code.search,code.symbol'` | `''` | Leave tool loading to the host so sessions do not need unused code schemas upfront. Set an explicit operation list to request eager loading. | | 1.2.0 | `LOOM_KNOWLEDGE_INGEST_INTERVAL_SECONDS` | `2` | `0` | The ingest worker takes the next job as soon as one ends instead of waiting 2 s after every job, so a queue of small documents drains at the speed of its jobs; a pass that finds no job still waits `LOOM_KNOWLEDGE_INGEST_IDLE_INTERVAL_SECONDS`. | | 1.2.0 | `LOOM_CLICKSTACK_USER_ID_KEYS` | `'user_id,user.id,enduser.id'` | `'user_id,user.id,enduser.id,loom.user_id,langfuse.user.id'` | A user-scoped ClickStack erasure also matches the user-id keys Loom's own child spans carry, so they are erased with the request span. A deployment that sets the variable keeps its own list and should add both keys. | @@ -242,7 +247,7 @@ The code plane: ingest, indexes, search, ask, review. | --- | --- | --- | --- | --- | | `LOOM_CODE_INTEL_ENABLED` | `bool` | `True` | | Master kill switch, checked at the top of every code.* handler but the retirement (code.repo.remove), which only deletes. | | `LOOM_CODE_TEST_GATE_RUN_TEMPLATES` | `str` | `''` | | code.test_gate run recipes (LOOM_CODE_TEST_GATE_RUN_TEMPLATES): JSON list of {"pattern": , "run":