Skip to content

Conversation

@nicolasnoble
Copy link
Contributor

This makes the CLI arguments work properly in the client CLI, like they do on the server.

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 refactors the CLI argument handling to eliminate duplication by introducing a shared ClientArgs structure that is flattened into the CLI-specific argument structure. This creates a single source of truth for client configuration arguments.

Key Changes

  • Introduced ClientArgs as a shared structure for common client arguments (endpoint, timeout, cache settings)
  • Used #[command(flatten)] to embed ClientArgs into the CLI's Cli structure
  • Removed duplicate argument definitions from the CLI binary
  • Added comprehensive documentation explaining the architecture and how to add new arguments
  • Reorganized ClientConfig::load() with clear sections for applying CLI argument overrides
  • Added extensive test coverage for argument parsing and configuration loading

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
modelexpress_common/src/client_config.rs Added Clone derive to ClientArgs, removed -v short flag from log_level to avoid conflict with CLI's verbose flag, added extensive documentation about the argument architecture, reorganized ClientConfig::load() with clear sections, and added comprehensive tests for argument parsing
modelexpress_client/src/bin/modules/args.rs Refactored to flatten ClientArgs into Cli struct, removed duplicate argument definitions (endpoint, timeout, cache_path, quiet), added extensive documentation, and added PartialEq derive to OutputFormat for test assertions
modelexpress_client/src/bin/cli.rs Simplified main function by directly using flattened client_args, removed manual construction of ClientArgs, updated all references to use cli.client_args.*, added module-level documentation explaining the argument architecture, and added comprehensive integration tests

This makes the CLI arguments work properly in the client CLI, like they do on the server.

Signed-off-by: Nicolas Pixel Noble <pixel@nobis-crew.org>
@nv-hwoo
Copy link
Contributor

nv-hwoo commented Dec 19, 2025

Thanks for the fixes. Do we know why some checks are failing?

@AndyDai-nv
Copy link
Contributor

AndyDai-nv commented Dec 19, 2025

@nv-hwoo I suspect one of the failures is some access issue, token expiration or sth... Created one ticket in the backlog

Copy link
Contributor

@nv-hwoo nv-hwoo left a comment

Choose a reason for hiding this comment

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

LGTM

@nv-hwoo
Copy link
Contributor

nv-hwoo commented Dec 19, 2025

@nicolasnoble looks like there's a clippy failure on the "Test Suite" check (thanks @AndyDai-nv for pointing out).

Signed-off-by: Nicolas Pixel Noble <pixel@nobis-crew.org>
Signed-off-by: Nicolas Pixel Noble <pixel@nobis-crew.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants