Skip to content

Conversation

@ultmaster
Copy link
Contributor

Summary

  • allow passing defaults for lightning_cli arguments
  • support programmatic defaults overriding required CLI args
  • test default overrides for required parameters

Testing

  • pytest

https://chatgpt.com/codex/tasks/task_e_689590e72300832e95482ca7a6b7e4f8

@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 23:24
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 enhances the lightning_cli function to accept programmatic defaults that can override required CLI arguments, allowing more flexible configuration management.

Key changes:

  • Added a defaults parameter to lightning_cli function for providing programmatic defaults
  • Modified argument parsing logic to prioritize programmatic defaults over required argument validation
  • Added comprehensive test coverage for the new default override functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
agentlightning/config.py Adds defaults parameter support throughout the CLI parsing pipeline with proper type annotations and overloads
tests/test_config.py Extends test helper and adds test cases for programmatic defaults overriding required parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

param_obj,
dest_name,
actual_param_annotation,
default_override if provided_defaults and param_name in provided_defaults else _DEFAULT_SENTINEL,
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The condition provided_defaults and param_name in provided_defaults is duplicated from lines 257-258. Consider extracting this logic into a variable to avoid repetition and improve maintainability.

Suggested change
default_override if provided_defaults and param_name in provided_defaults else _DEFAULT_SENTINEL,
default_override if has_default_override else _DEFAULT_SENTINEL,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant