Read max model length from nested fields in config.json - #4504
Open
mzegla wants to merge 2 commits into
Open
Conversation
mzegla
requested review from
dtrawins and
michalkulakowski
and
a lite review from Copilot
September 3, 2026 08:48
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new helper can assert/crash if called with a non-object RapidJSON value, so it should defensively check IsObject() before member access.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates OVMS LLM config parsing so max model length can be read from composite/VLM/omni config.json layouts where the relevant fields are nested under text_config, with accompanying unit tests to validate precedence and invalid shapes.
Changes:
- Refactors max-length field probing into a helper and adds a
text_configfallback inparseMaxModelLength. - Adds unit tests covering nested
text_config, precedence of top-level fields, and invalidtext_configtype.
File summaries
| File | Description |
|---|---|
src/llm/servable_initializer.cpp |
Adds a helper for probing max-length fields and falls back to reading them from text_config when missing at the top level. |
src/test/llm/max_model_length_test.cpp |
Adds tests for nested text_config parsing, precedence rules, and invalid text_config shapes. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
michalkulakowski
approved these changes
Sep 3, 2026
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.
No description provided.