Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/seclab_taskflow_agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def main(
list[str] | None,
typer.Argument(help="Remaining prompt text."),
] = None,
model_config: Annotated[
str | None,
typer.Option("-m", "--model-config", help="Model configuration module path. Only relevant when running taskflows."),
] = None,
) -> None:
"""Run a taskflow or personality-based agent session."""
# Debug mode from flag or env var
Expand Down Expand Up @@ -156,7 +160,7 @@ def main(
asyncio.run(
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.
),
debug=debug,
)
Expand Down
4 changes: 4 additions & 0 deletions src/seclab_taskflow_agent/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ async def run_main(
taskflow_path: str | None,
cli_globals: dict[str, str],
prompt: str | None,
cli_model_config: str | None,
resume_session_id: str | None = None,
) -> None:
"""Main entry point for taskflow/personality execution.
Expand All @@ -461,6 +462,7 @@ async def run_main(
taskflow_path: Taskflow module path, or None.
cli_globals: Global variables from CLI.
prompt: User prompt text.
cli_model_config: Model configuration module path, or None.
resume_session_id: Session ID to resume from a checkpoint.
"""
from .session import TaskflowSession
Expand Down Expand Up @@ -511,6 +513,8 @@ async def on_handoff_hook(context: RunContextWrapper[TContext], agent: Agent[TCo

# Resolve model config
model_config_ref = taskflow_doc.model_config_ref
if cli_model_config:
model_config_ref = cli_model_config
Comment on lines 514 to +517
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.
model_keys: list[str] = []
model_dict: dict[str, str] = {}
models_params: dict[str, dict[str, Any]] = {}
Expand Down
Loading