LCORE-1356: Updated configuration doc#1745
Conversation
WalkthroughDocumentation across JSON schema, Markdown, and HTML formats is updated to introduce a new ChangesCompaction configuration documentation
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/config.json`:
- Around line 376-380: The JSON schema entries for the ratio fields
(threshold_ratio and buffer_max_ratio) lack bounds; add "minimum": 0.0 and
"maximum": 1.0 to both schema objects so their documented 0.0–1.0 range is
enforced at validation time; update the objects that define threshold_ratio and
buffer_max_ratio to include these properties while keeping their existing
"type", "default", "title", and "description".
- Around line 767-775: The schema for the "context_windows" object currently
omits a default, which makes behavior unclear when the entire field is omitted;
update the "context_windows" definition in docs/config.json (the object with
"title": "Per-model context window sizes (tokens)") to include an explicit
default value of an empty object (i.e., add "default": {}) so consumers treat a
missing field as an empty map and fallback logic becomes deterministic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: c8997ca9-d63b-447c-8ca5-a92663793dab
📒 Files selected for processing (3)
docs/config.htmldocs/config.jsondocs/config.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: build-pr
- GitHub Check: unit_tests (3.13)
- GitHub Check: unit_tests (3.12)
- GitHub Check: Pylinter
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: E2E: library mode / ci / group 2
- GitHub Check: E2E: server mode / ci / group 1
- GitHub Check: E2E: library mode / ci / group 1
- GitHub Check: E2E: library mode / ci / group 3
- GitHub Check: E2E: server mode / ci / group 3
- GitHub Check: E2E Tests for Lightspeed Evaluation job
🧰 Additional context used
🪛 LanguageTool
docs/config.md
[style] ~169-~169: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...d_ratio. Prevents triggering on very small context windows. buffer_turns: Init...
(EN_WEAK_ADJECTIVE)
[style] ~183-~183: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...ion can trigger. Prevents triggering on very small context windows. | | buffer_turns | int...
(EN_WEAK_ADJECTIVE)
🔇 Additional comments (3)
docs/config.json (1)
483-487: LGTM!docs/config.md (1)
150-186: LGTM!Also applies to: 207-207, 296-296
docs/config.html (1)
501-563: LGTM!Also applies to: 654-660, 901-910
| "threshold_ratio": { | ||
| "default": 0.7, | ||
| "description": "Trigger compaction when estimated tokens exceed this fraction of the model's context window (0.0-1.0).", | ||
| "title": "Threshold ratio", | ||
| "type": "number" |
There was a problem hiding this comment.
Add schema constraints for ratio fields.
The threshold_ratio and buffer_max_ratio fields are documented as fractions that should be between 0.0 and 1.0, but the JSON schema lacks minimum and maximum constraints to enforce these bounds. Without schema-level validation, invalid values (e.g., negative numbers or values > 1.0) could pass validation and cause runtime issues.
🛡️ Add validation constraints
Apply these changes to enforce the documented ranges at schema validation time:
"threshold_ratio": {
"default": 0.7,
"description": "Trigger compaction when estimated tokens exceed this fraction of the model's context window (0.0-1.0).",
+ "minimum": 0.0,
+ "maximum": 1.0,
"title": "Threshold ratio",
"type": "number"
} "buffer_max_ratio": {
"default": 0.3,
"description": "Maximum fraction of context window the buffer zone can occupy, regardless of buffer_turns.",
+ "minimum": 0.0,
+ "maximum": 1.0,
"title": "Buffer max ratio",
"type": "number"
}Also applies to: 396-400
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/config.json` around lines 376 - 380, The JSON schema entries for the
ratio fields (threshold_ratio and buffer_max_ratio) lack bounds; add "minimum":
0.0 and "maximum": 1.0 to both schema objects so their documented 0.0–1.0 range
is enforced at validation time; update the objects that define threshold_ratio
and buffer_max_ratio to include these properties while keeping their existing
"type", "default", "title", and "description".
| "context_windows": { | ||
| "additionalProperties": { | ||
| "minimum": 0, | ||
| "type": "integer" | ||
| }, | ||
| "description": "Map of fully-qualified model identifier (e.g., \"openai/gpt-4o-mini\") to context window size in tokens. Used by the conversation compaction trigger to decide when older turns must be summarized before the input exceeds the window. Models absent from this map have no registered window — callers fall back to their own default or skip the token-based trigger.", | ||
| "title": "Per-model context window sizes (tokens)", | ||
| "type": "object" | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Consider adding an explicit default value for context_windows.
The context_windows field is optional but lacks a default value in the schema. While the description explains fallback behavior for models not in the map, it doesn't explicitly state what happens when the entire field is omitted from the configuration. Adding "default": {} would make the behavior clearer and more predictable for users.
📝 Suggested enhancement
"context_windows": {
"additionalProperties": {
"minimum": 0,
"type": "integer"
},
+ "default": {},
"description": "Map of fully-qualified model identifier (e.g., \"openai/gpt-4o-mini\") to context window size in tokens. Used by the conversation compaction trigger to decide when older turns must be summarized before the input exceeds the window. Models absent from this map have no registered window — callers fall back to their own default or skip the token-based trigger.",
"title": "Per-model context window sizes (tokens)",
"type": "object"
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "context_windows": { | |
| "additionalProperties": { | |
| "minimum": 0, | |
| "type": "integer" | |
| }, | |
| "description": "Map of fully-qualified model identifier (e.g., \"openai/gpt-4o-mini\") to context window size in tokens. Used by the conversation compaction trigger to decide when older turns must be summarized before the input exceeds the window. Models absent from this map have no registered window — callers fall back to their own default or skip the token-based trigger.", | |
| "title": "Per-model context window sizes (tokens)", | |
| "type": "object" | |
| } | |
| "context_windows": { | |
| "additionalProperties": { | |
| "minimum": 0, | |
| "type": "integer" | |
| }, | |
| "default": {}, | |
| "description": "Map of fully-qualified model identifier (e.g., \"openai/gpt-4o-mini\") to context window size in tokens. Used by the conversation compaction trigger to decide when older turns must be summarized before the input exceeds the window. Models absent from this map have no registered window — callers fall back to their own default or skip the token-based trigger.", | |
| "title": "Per-model context window sizes (tokens)", | |
| "type": "object" | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/config.json` around lines 767 - 775, The schema for the
"context_windows" object currently omits a default, which makes behavior unclear
when the entire field is omitted; update the "context_windows" definition in
docs/config.json (the object with "title": "Per-model context window sizes
(tokens)") to include an explicit default value of an empty object (i.e., add
"default": {}) so consumers treat a missing field as an empty map and fallback
logic becomes deterministic.
Description
LCORE-1356: Updated configuration doc
Type of change
Tools used to create PR
Related Tickets & Documents
Summary by CodeRabbit
CompactionConfigurationschema documenting conversation history summarization settings, including triggering thresholds and buffer controlsConfigurationschema with compaction field to enable/disable history summarizationInferenceConfigurationschema with model-specific context window sizes used for compaction decisions