Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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,
Comment on lines +111 to +114
) -> 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:
Comment on lines 487 to 495
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.
"""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.
Comment on lines +504 to 505
"""
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 560 to +563
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] = []
Comment on lines 560 to 564
model_dict: dict[str, str] = {}
models_params: dict[str, dict[str, Any]] = {}
Expand Down
Loading