Skip to content

Read max model length from nested fields in config.json - #4504

Open
mzegla wants to merge 2 commits into
mainfrom
fix_max_lenght
Open

Read max model length from nested fields in config.json#4504
mzegla wants to merge 2 commits into
mainfrom
fix_max_lenght

Conversation

@mzegla

@mzegla mzegla commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI 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.

🟡 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_config fallback in parseMaxModelLength.
  • Adds unit tests covering nested text_config, precedence of top-level fields, and invalid text_config type.
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.

Comment thread src/llm/servable_initializer.cpp
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants