You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(expansion): admit complete input through model capacity - #1029
Document expansion silently replaced its input with the first 4,000 characters. Render the complete supplied string and use the existing model-input admission scope for each final native request, including its output reservation. Capacity refusal retains empty optional enrichment; host delegation, existing enrichment timeout/error handling and source text stay unchanged.
SQLite now forwards an explicitly configured tenant generation output reservation to its storage-owned client. Custom gateways retain the existing endpoint-specific context declaration and explicit-output requirements. No new input, replacement prefix, output-cap normalization or schema change. The enterprise companion applies that wiring to its two native adapters.
Validation: 113 focused SDK cases, nine-file combined typecheck with zero errors/warnings, Ruff and whitespace checks passed. A real loopback HTTP provider behind the production isolated worker received all 5,021 Unicode characters through the actual renderer; an oversized request generated no second call. All four counterfactuals (restore clipping / bypass admission / restore document prompt logging / restore query prompt logging) fail their targeted regressions, with source restored byte-identical. Companion native/related gate: 753 passed, including 16 new real storage cases across both adapters and APP/owner roles, no skips.
Supported count remains 325; this hidden-policy correction earns zero reduction credit. No paid model, customer environment, remote database or deployment changes. TestSprite is unavailable/unlinked; local native/HTTP gates are the executed evidence. Current-head Codex CODE/SECURITY P0/P1 and ordinary CI remain merge gates.
Review follow-up: expansion and reformulation debug logs now contain prompt sizes instead of raw rendered text. Direct closed/half-open circuit regressions verify capacity refusal is neutral, frees its probe and permits the next admissible request.
Document expansion now uses the full supplied content and checks model input capacity around the LLM request. SQLite storage applies a configured generation output limit. Tests cover admission, capacity refusal, gateway policies, and storage behavior.
Changes: Document expansion
Layer / File(s)
Summary
Expansion input and capacity handling reflexio/server/services/pre_retrieval/_document_expander.py, reflexio/server/services/storage/sqlite_storage/_base.py, tests/server/services/test_document_expansion_capacity.py, reflexio/server/services/pre_retrieval/README.md
The expander passes full content to the LLM request within model_input_budget(). SQLite storage applies the configured generation output limit. Tests cover capacity admission, refusal, gateway policies, and storage behavior. The README documents these handling rules and unchanged storage and embedding behavior.
Document expansion now renders the complete input and refuses oversized requests through the existing capacity check, leaving optional enrichment empty. No concrete merge-blocking risk was established. The debug-log comment is retained as an unverified note for the author to consider.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the primary change: document expansion now admits the complete input through model capacity checks. The raw summary and PR objectives confirm that expansion renders the full string ins…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title names the primary change: document expansion now admits the complete input through model capacity checks. The raw summary and PR objectives confirm that expansion renders the full string instead of truncating to 4,000 characters, and that the existing model-input admission scope is applied to each native request. The title uses a conventional type(scope) prefix, is one sentence, and is 59 characters long. It does not describe anything absent from the changeset.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Remove the full-prompt debug log.
When debug logging is enabled, removing the input clipping makes this statement log the complete document, including customer content beyond the previous 4,000-character prefix. The statement also logs documents that capacity admission subsequently refuses.
Replace the prompt with non-content metadata, such as its length. The customer-content restriction documented in _parse_expansion_json at Lines 178-180 also applies to this input.
Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 1 remain after this review.
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
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.
Document expansion silently replaced its input with the first 4,000 characters. Render the complete supplied string and use the existing model-input admission scope for each final native request, including its output reservation. Capacity refusal retains empty optional enrichment; host delegation, existing enrichment timeout/error handling and source text stay unchanged.
SQLite now forwards an explicitly configured tenant generation output reservation to its storage-owned client. Custom gateways retain the existing endpoint-specific context declaration and explicit-output requirements. No new input, replacement prefix, output-cap normalization or schema change. The enterprise companion applies that wiring to its two native adapters.
Validation: 113 focused SDK cases, nine-file combined typecheck with zero errors/warnings, Ruff and whitespace checks passed. A real loopback HTTP provider behind the production isolated worker received all 5,021 Unicode characters through the actual renderer; an oversized request generated no second call. All four counterfactuals (restore clipping / bypass admission / restore document prompt logging / restore query prompt logging) fail their targeted regressions, with source restored byte-identical. Companion native/related gate: 753 passed, including 16 new real storage cases across both adapters and APP/owner roles, no skips.
Supported count remains 325; this hidden-policy correction earns zero reduction credit. No paid model, customer environment, remote database or deployment changes. TestSprite is unavailable/unlinked; local native/HTTP gates are the executed evidence. Current-head Codex CODE/SECURITY P0/P1 and ordinary CI remain merge gates.
Review follow-up: expansion and reformulation debug logs now contain prompt sizes instead of raw rendered text. Direct closed/half-open circuit regressions verify capacity refusal is neutral, frees its probe and permits the next admissible request.