Skip to content

Conversation

@gagik
Copy link
Collaborator

@gagik gagik commented Nov 25, 2025

This is actually largely irrelevant for CLI-based parsing because yargs-parser takes care of this for us but it's generally better to have this for other types of input.
So...

  1. This adds tests to clarify the expected behavior that we're parsing
  2. Renames disableEmbeddingsValidation -> embeddingsValidation

Two steps:
chore: add tests and pre-processor for other cases
chore: disableEmbeddingsValidation -> embeddingsValidation

Copilot AI review requested due to automatic review settings November 25, 2025 16:05
@gagik gagik requested a review from a team as a code owner November 25, 2025 16:05
* Preprocessor for boolean values that handles string "false"/"0" correctly.
* Zod's coerce.boolean() treats any non-empty string as true, which is not what we want.
*/
export function parseBoolean(val: unknown): unknown {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is actually largely irrelevant for CLI-based parsing because yargs-parser takes care of this for us but it's generally better to have this for other types of input.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could remove this to be honest, it's more relevant for headers case but it still doesn't hurt

Copy link
Contributor

Copilot AI left a comment

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 renames the embeddings validation configuration from disableEmbeddingsValidation to embeddingsValidation with inverted boolean semantics, and adds comprehensive boolean parsing support for CLI arguments.

Key Changes:

  • Renamed disableEmbeddingsValidation to embeddingsValidation (flipped from "disable" to "enable" semantics)
  • Implemented parseBoolean helper to correctly handle string "false"/"0" values in CLI arguments
  • Added extensive test coverage for boolean CLI argument parsing behavior

Reviewed changes

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

Show a summary per file
File Description
src/common/config/userConfig.ts Renamed field from disableEmbeddingsValidation to embeddingsValidation, inverted default from false to true, and added parseBoolean preprocessing for boolean fields
src/common/config/configUtils.ts Added parseBoolean function to correctly parse boolean values from strings, and improved commaSeparatedToArray implementation
src/common/config/argsParserOptions.ts Updated boolean field name in OPTIONS configuration
src/common/search/vectorSearchEmbeddingsManager.ts Updated logic to use embeddingsValidation with inverted boolean check and removed redundant validation check in embed method
tests/unit/common/config.test.ts Updated test expectations to use new field name and added comprehensive tests for boolean CLI argument parsing
tests/unit/common/search/vectorSearchEmbeddingsManager.test.ts Updated test fixtures to use new field name with inverted boolean values
server.json Updated configuration metadata with renamed field and reordered entries alphabetically
scripts/generateArguments.ts Removed assertion that required array descriptions to start with "An array of"
README.md Updated documentation to reflect renamed configuration field

Comment on lines +462 to +464
cli: ["--readOnly", "FALSE"],
// This is yargs-parser default
expected: { readOnly: true },
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The test expects uppercase 'FALSE' to result in true, but the parseBoolean function converts to lowercase and checks for 'false', which would return false. This test case doesn't match the actual implementation behavior.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you're understandably confused but this isn't actually hitting the string case, yargs-parser gives a boolean-based situation

@coveralls
Copy link
Collaborator

coveralls commented Nov 25, 2025

Pull Request Test Coverage Report for Build 19676499266

Details

  • 16 of 31 (51.61%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 79.822%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/common/config/configUtils.ts 6 21 28.57%
Files with Coverage Reduction New Missed Lines %
src/common/config/configUtils.ts 1 70.21%
Totals Coverage Status
Change from base Build 19674974109: -0.1%
Covered Lines: 6368
Relevant Lines: 7885

💛 - Coveralls

Copy link
Collaborator

@himanshusinghs himanshusinghs left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@gagik gagik merged commit cfb965b into main Nov 25, 2025
19 checks passed
@gagik gagik deleted the gagik/bool branch November 25, 2025 17:08
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.

4 participants