Skip to content

Disable input count validation flag - #4492

Open
przepeck wants to merge 9 commits into
mainfrom
przepeck/kfs_disable_input_count_validation_flag
Open

Disable input count validation flag#4492
przepeck wants to merge 9 commits into
mainfrom
przepeck/kfs_disable_input_count_validation_flag

Conversation

@przepeck

Copy link
Copy Markdown
Collaborator

🛠 Summary

CVS-187884
Adding flag --disable_input_count_validation to match TFS behavior with number of sent input entries grater then model input count

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

this change has introduced the parameter for disabling input count validation to match TFS's behavior as the customer requested
@przepeck
przepeck requested review from atobiszei and dtrawins and a lite review from Copilot August 31, 2026 09:55

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.

Pull request overview

This PR introduces a new server flag --disable_input_count_validation intended to relax inference-request validation behavior (to align with TFS behavior around extra request inputs), and wires it through CLI parsing, runtime validation, tests, and documentation.

Changes:

  • Added CLI/config plumbing for disable_input_count_validation and exposed it via ovms::Config.
  • Modified request validation to conditionally skip input-count validation when the flag is enabled.
  • Added/updated unit tests and documentation to cover the new flag.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/test/predict_validation_test.cpp Adds KFS validation tests for the new flag using a config-toggling test fixture.
src/test/ovmsconfig_test.cpp Extends CLI parsing tests to include the new flag and verifies its default value.
src/predict_request_validation_utils.hpp Gates validateNumberOfTensors() behind the new config flag.
src/config.hpp Declares Config::disableInputCountValidation().
src/config.cpp Implements Config::disableInputCountValidation().
src/cli_parser.cpp Adds the --disable_input_count_validation CLI option and maps it into ServerSettingsImpl.
src/capi_frontend/server_settings.hpp Adds disableInputCountValidation to server settings with a default of false.
src/BUILD Adds deps to a CAPI library target (currently used to satisfy new header inclusion requirements).
docs/security_considerations.md Documents security implications of enabling the new flag.
docs/parameters.md Documents the new CLI parameter and its behavior.
Suppressed comments (1)

src/test/predict_validation_test.cpp:144

  • TearDown() ignores the return value of Config::parse(...) when restoring global settings. If this fails, it can pollute subsequent tests in the same binary.
        ovms::Config::instance().parse(&originalServerSettings, &originalModelsSettings);

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 293 to 297
Status finalStatus = StatusCode::OK;
RETURN_IF_ERR(validateNumberOfTensors());
if (choice == ValidationChoice::INPUT && !ovms::Config::instance().disableInputCountValidation()) {
RETURN_IF_ERR(validateNumberOfTensors());
}
RETURN_IF_ERR(validateRequestCoherency());

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I cannot agree with this comment, error "INVALID_MISSING_INPUT" is better for described scenario

Comment thread src/cli_parser.cpp Outdated
Comment thread docs/parameters.md Outdated
Comment thread docs/security_considerations.md Outdated
Comment thread src/test/predict_validation_test.cpp
Comment thread src/BUILD
Comment thread docs/security_considerations.md Outdated
Comment thread docs/parameters.md Outdated
przepeck and others added 3 commits September 2, 2026 07:28
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