Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LCORE-1356: Updated configuration doc#1745

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:lcore-1356-updated-config-doc
May 17, 2026
Merged

LCORE-1356: Updated configuration doc#1745
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:lcore-1356-updated-config-doc

Conversation

@tisnik

@tisnik tisnik commented May 17, 2026

Copy link
Copy Markdown
Contributor

Description

LCORE-1356: Updated configuration doc

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-1356

Summary by CodeRabbit

  • Documentation
    • Added new CompactionConfiguration schema documenting conversation history summarization settings, including triggering thresholds and buffer controls
    • Extended Configuration schema with compaction field to enable/disable history summarization
    • Extended InferenceConfiguration schema with model-specific context window sizes used for compaction decisions

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Documentation across JSON schema, Markdown, and HTML formats is updated to introduce a new CompactionConfiguration schema defining conversation history summarization behavior, integrate it into the Configuration schema, and document a context_windows field in InferenceConfiguration that specifies per-model context window sizes for triggering compaction.

Changes

Compaction configuration documentation

Layer / File(s) Summary
CompactionConfiguration schema definition
docs/config.json, docs/config.md, docs/config.html
New CompactionConfiguration schema defines fields for enablement (enabled), trigger thresholding (threshold_ratio, token_floor), and buffer sizing (buffer_turns, buffer_max_ratio).
Configuration schema compaction field
docs/config.json, docs/config.md, docs/config.html
Configuration schema gains a compaction field referencing CompactionConfiguration, documenting that compaction is disabled by default and prevents HTTP 413 by summarizing history before context window is exceeded.
InferenceConfiguration context windows
docs/config.json, docs/config.md, docs/config.html
InferenceConfiguration schema gains a context_windows field mapping model identifiers to context window sizes, used by the compaction trigger to determine when older conversation turns should be summarized.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'LCORE-1356: Updated configuration doc' is vague and generic, using non-descriptive terms like 'Updated' and 'configuration doc' that don't convey specific meaningful information about what changed. Revise the title to be more specific about the changes made, such as: 'Add CompactionConfiguration schema and context_windows field to configuration docs' to clearly describe the actual modifications.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b9ce55f and b44d507.

📒 Files selected for processing (3)
  • docs/config.html
  • docs/config.json
  • docs/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

Comment thread docs/config.json
Comment on lines +376 to +380
"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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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".

Comment thread docs/config.json
Comment on lines +767 to 775
"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"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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.

Suggested change
"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.

@tisnik tisnik merged commit 392413e into lightspeed-core:main May 17, 2026
31 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 21, 2026
16 tasks
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