Skip to content

Code retrieval defaults to unlimited context - #1150

Merged
zlareb1 merged 9 commits into
mainfrom
fix/unlimited-code-token-defaults
Nov 22, 2026
Merged

zlareb1 merged 9 commits into
mainfrom
fix/unlimited-code-token-defaults

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Related: #1111

Changelog category (leave one):

  • 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):

Code retrieval returns selected context without an implicit response token cap. Callers and deployments can opt into a cap; result counts and requested body modes still apply.

Why

Repository size and the amount of context a caller needs vary. A fixed response cap can withhold a definition that retrieval already found and force another read. Return the selected context and let callers choose a cap.

Scope and risk

Includes the search default work from #1111, with the history-budget gaps found in fresh review fixed. Search history fits before body budgeting, including missing-pool cursor fallback and no-hit history responses.

The default token budget is unlimited for symbol, enclosing, outline, trace, map, context-pack and review-brief reads. Large symbol definitions return complete retained source instead of automatic skeletons; an explicitly capped container request retains skeleton navigation. If a full container body is unavailable, retained skeletons and outlines remain available. Source completeness checks and bounded source reads still apply.

Ask retrieval, attached file lessons and internal code grounding default to unlimited context. Positive configured caps remain supported. Python SDK defaults, both SDKs' code-query wrappers and dashboard retrieval calls follow the server defaults. Cache warming uses the deployment's ask budget. Generated references and settings history describe the change. Larger responses can consume more client context; no cost, speed or quality improvement is claimed without a measurement.

Compatibility, rollout and rollback

  • Wire: response token budgets accept nonnegative integers with no upper bound; 0 means unlimited. Search and ask accept omission and use their deployment defaults. Review tiers select sections without adding an implicit token cap.
  • Settings: code_search_token_budget is new and defaults to 0; code_ask_token_budget, code_result_lessons_tokens, memory_ask_code_symbol_token_budget and memory_ask_code_search_token_budget and code_review_brief_rationale_tokens default to 0. Existing explicit deployment values keep their caps.
  • Operator steps: none. No migration, backfill or re-index. Deploy upgraded replicas before sending 0 or values outside the previous request bounds.
  • Rolling upgrade: omitted budgets follow the serving replica's defaults. Existing positive budgets in the previous supported range work on both versions.
  • Rollback: remove the new setting and stop sending newly accepted budget values before reverting. Stored data is unchanged. Answer and search cache keys distinguish unlimited from finite budgets.

Tests

  • make lint, make typecheck, make format-check: passed.
  • TypeScript SDK lint and type checking: passed.
  • Dashboard build and bundle-size check: passed.
  • SDK, reference, settings and reach generators: regenerated or checked current.
  • Regression coverage is authored for unlimited retained definitions, enclosing bodies, outlines, context packs, file lessons, defaults, explicit caps, history fitting, compact uses fitting, review rationale and answer cache separation. Relevant existing expectations reflect the new defaults.
  • Local unit and integration tests were not run, as requested. CI is not awaited.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex wrote the changes and checked the static gates. A fresh agent review is required before merge.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint and type checks pass. Local tests were not run, as requested.
  • Generated references and settings artifacts are current.
  • No migration changes.
  • No plugin hook or manifest changes.
  • Dashboard API defaults inherit the server settings; its build and bundle-size check pass.
  • Docs describe the defaults and rollout steps.
  • Commits are signed off.

Make token limits an explicit deployment or request choice, including MCP and cursor pages. Keep finite budgets on recomputed cursor pages and document server configuration.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Skip risk annotations when their reservation would leave less than the result-head allowance. Cover finite request and deployment budgets, cursor pages, and the annotation threshold.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…t' into fix/unlimited-code-token-defaults

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Let callers choose response caps for their repository. Preserve whole retained definitions and selected lessons by default, and fit search history within explicit finite caps.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 22, 2026 8:36am UTC

Request Review

Keep tiny explicit context caps within their limit, remove implicit dashboard caps and warm the same ask budget clients use.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Keep retained container navigation when full source is unavailable, and honor finite caps on uses summaries and unavailable context messages.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Use the symbol output's definition list and keep the map fixture cache private.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 67b4669 into main Nov 22, 2026
57 of 60 checks passed
@zlareb1
zlareb1 deleted the fix/unlimited-code-token-defaults branch November 22, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant