Skip to content

add cli argument for model config#232

Open
m-y-mo wants to merge 2 commits intomainfrom
cli_model_config
Open

add cli argument for model config#232
m-y-mo wants to merge 2 commits intomainfrom
cli_model_config

Conversation

@m-y-mo
Copy link
Copy Markdown
Contributor

@m-y-mo m-y-mo commented Apr 27, 2026

Allow model config file to be passed via cli argument when running taskflows

Copilot AI review requested due to automatic review settings April 27, 2026 15:17
Copy link
Copy Markdown
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

Adds support for specifying a model configuration reference via a CLI option when running taskflows, allowing the CLI-provided value to override the taskflow’s embedded model_config_ref.

Changes:

  • Add --model-config/-m option to the Typer CLI.
  • Thread the CLI model config through run_main(...).
  • Override taskflow_doc.model_config_ref with the CLI-provided value during taskflow execution.
Show a summary per file
File Description
src/seclab_taskflow_agent/cli.py Adds --model-config option and forwards it into run_main.
src/seclab_taskflow_agent/runner.py Accepts cli_model_config and uses it to override the taskflow’s model config reference.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 4

run_main(
available_tools, personality, effective_taskflow,
cli_globals, user_prompt, resume_session_id=resume,
cli_globals, user_prompt, cli_model_config = model_config, resume_session_id=resume,
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

The keyword argument is written with spaces around the '=' ("cli_model_config = model_config"), which violates Ruff/pycodestyle E251 and will fail linting. Remove the spaces (use "cli_model_config=model_config").

Suggested change
cli_globals, user_prompt, cli_model_config = model_config, resume_session_id=resume,
cli_globals, user_prompt, cli_model_config=model_config, resume_session_id=resume,

Copilot uses AI. Check for mistakes.
Comment on lines 448 to 456
async def run_main(
available_tools: AvailableTools,
personality_path: str | None,
taskflow_path: str | None,
cli_globals: dict[str, str],
prompt: str | None,
cli_model_config: str | None,
resume_session_id: str | None = None,
) -> None:
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

run_main now takes a new required positional parameter (cli_model_config) inserted before resume_session_id, which is a breaking API change for any external callers passing resume_session_id positionally (and run_main is exported via __all__). To preserve compatibility, consider making cli_model_config optional with a default and/or moving it after resume_session_id (e.g., add it at the end as a keyword-only option).

Copilot uses AI. Check for mistakes.
Comment on lines 514 to +517
# Resolve model config
model_config_ref = taskflow_doc.model_config_ref
if cli_model_config:
model_config_ref = cli_model_config
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

New behavior allows overriding the taskflow’s model_config_ref via cli_model_config, but there are existing tests for runner logic (e.g., tests/test_runner.py) and none cover this override path. Please add a unit test that verifies the CLI-provided model config takes precedence over the taskflow document value.

Copilot uses AI. Check for mistakes.
Comment thread src/seclab_taskflow_agent/cli.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 18:10
Copy link
Copy Markdown
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.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new

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