Repository navigation
MCP search places read their limits from settings - #1871
Merged
Merged
Conversation
The unit gate rejects operator limits declared as module constants. Put the reply budget, source line cap and query word cap in the settings catalog and retain their defaults. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 64cca9e. Configure here.
Record the three catalog defaults so the settings gate detects future changes to them. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
5 of 7 tasks
The feature inventory requires a test for the setting. A search with two matching words checks that lowering the limit keeps only the longer match. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The source limit controls the full body. A single place and cursor pages can exceed the reply's token target. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
4 tasks done
ZYZ666-RGB
added a commit
to ZYZ666-RGB/loom
that referenced
this pull request
Dec 1, 2026
…a-delta Picks up ClickHouse#1871, which moved MCP places limits into settings so test_no_new_tunable_constant no longer fails on this branch. Signed-off-by: yuzhou <1991039819@qq.com>
9 of 10 tasks
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: #1679
Changelog category
Changelog entry
None.
Why
The unit gate rejects three search place limits in
server/transport/code_lean.py. It fails with the same three constants on clean main and on the merge tree for the related pull request.Scope and risk
MCP search places read the default reply budget, leading-source line cap and query word cap from the settings catalog. The defaults remain 600 tokens, 30 lines and 32 words. A request's explicit
token_budgetstill takes precedence.Compatibility, rollout and rollback
LOOM_CODE_SEARCH_PLACES_*settings. No action is needed for the existing defaults.Tests
test_no_new_tunable_constantfails before the change on clean main and the related merge tree, and passes with this change.make format-check,make lintandmake typecheckpass.AI assistance in the code
Checklist
Note
Low Risk
Behavior-preserving refactor with unchanged defaults; only adds optional operator overrides for search-place sizing.
Overview
Replaces three hardcoded limits in MCP search places formatting (
code_lean.py) with settings-backed values so they can be tuned and satisfy the tunable-constant gate.code_search_places_token_budget(default 600) is the default reply token target when the request omitstoken_budget.code_search_places_source_max_lines(default 30) caps the leading place’s full body.code_search_places_query_max_words(default 32, minimum 1) limits distinct query words used for matching-line selection. Per-requesttoken_budgetstill overrides the default.Settings are wired through the catalog, JSON schema, example YAML, and configuration reference; the defaults snapshot and unit tests (including a new test for the query-word cap) use the settings fields instead of module constants.
Reviewed by Cursor Bugbot for commit b208525. Bugbot is set up for automated code reviews on this repo. Configure here.