Make max file size configurable via SEMBLE_MAX_FILE_BYTES and warn on skipped files - #252
Merged
stephantul merged 1 commit intoAug 25, 2026
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "feat: make max file size configurable vi..." | Re-trigger Greptile |
TommyC81
added a commit
to TommyC81/semble
that referenced
this pull request
Aug 18, 2026
Greptile P2 on PR MinishLab#252: the any-handler early return meant a foreign handler attached to the semble logger by an embedding application would suppress the CLI stderr handler, redirecting or discarding oversized-file warnings. Idempotence now keys on the CLI-owned handler type (_CliLogHandler), so repeated setup still adds exactly one handler while a preconfigured foreign logger no longer blocks stderr visibility. Lore-id: f488e6e1 Constraint: CLI logging setup must be idempotent across repeated in-process invocations Tested: 328 tests pass; ruff, ruff format, mypy clean Tested: in-process check: with a foreign NullHandler attached, CLI handler installed exactly once across two setup calls Related: c9380176 Confidence: high Scope-risk: narrow Reversibility: clean
Files larger than 1 MB are skipped during indexing without any indication, silently leaving gaps in search results (MinishLab#250). Resolve the limit per call from the SEMBLE_MAX_FILE_BYTES environment variable (following SEMBLE_CACHE_LOCATION / SEMBLE_CLONE_TIMEOUT / SEMBLE_MODEL_NAME), falling back to the unchanged 1 MB default; malformed or nonpositive values warn and fall back instead of crashing indexing. Warn at index time naming files skipped for size, with the CLI surfacing warnings on stderr via an idempotent, CLI-owned handler.
TommyC81
force-pushed
the
feat/configurable-max-file-size
branch
from
August 18, 2026 06:32
78d5bb0 to
68f3c45
Compare
Contributor
Author
|
Squashed the branch into a single commit ( |
Contributor
|
@TommyC81 sorry for not getting back to you on this. It looks good to me, making greptile do a final pass. |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
4 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.
Closes #250
Following the discussion in #250, this makes the 1 MB max file size configurable via a
SEMBLE_MAX_FILE_BYTESenvironment variable and makes skipped files visible — no CLI flag, no default change.Changes
SEMBLE_MAX_FILE_BYTESenv var (src/semble/index/files.py) — newget_max_file_bytes()resolves the limit per call from the environment, falling back to the unchanged 1 MB default. Follows the existingSEMBLE_CACHE_LOCATION/SEMBLE_CLONE_TIMEOUT/SEMBLE_MODEL_NAMEidiom, and works for the MCP server path too, where env vars are the only channel.src/semble/index/create.py) —create_index_from_pathcollectsTOO_LARGEfiles and logs oneWARNINGnaming them (up to 5, then...) with the active limit. The CLI installs an idempotent stderr handler on thesemblelogger so the warning is visible; the root logger is untouched.tests/index/test_index.py: env resolution (default + override), invalid values fall back, oversized file skipped with a warning naming the file, and oversized file indexed once the limit is raised.Checklist
Closes #250)make test— 328 passed (4 new)make lint/make typecheck— ruff check, ruff format, mypy clean