Skip to content
Closed
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ ignore = [
"A001", # Variable shadows built-in
"A002", # Argument shadows built-in
"A004", # Import shadows built-in
"FBT001", # Boolean positional arg
"FBT002", # Boolean default value
"N801", # Class name casing
"N802", # Function name casing
Expand Down
1 change: 1 addition & 0 deletions src/seclab_taskflow_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def __init__(
name: str = "TaskAgent",
instructions: str = "",
handoffs: list[Any] | None = None,
*,
exclude_from_context: bool = False,
mcp_servers: list[Any] | None = None,
model: str = DEFAULT_MODEL,
Expand Down
1 change: 1 addition & 0 deletions src/seclab_taskflow_agent/mcp_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def build_mcp_servers(
available_tools: AvailableTools,
toolboxes: list[str],
blocked_tools: list[str] | None = None,
*,
headless: bool = False,
) -> list[MCPServerEntry]:
"""Build MCP server instances for the given toolboxes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ def __init__(
rpc: RPC,
name: str = "watchdog",
interval: float = 0.1,
*,
daemon: bool = False,
start: bool = True,
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/seclab_taskflow_agent/render_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def flush_async_output(task_id: str) -> None:
await render_model_output(data)


async def render_model_output(data: str, log: bool = True, async_task: bool = False, task_id: str | None = None) -> None:
async def render_model_output(data: str, *, log: bool = True, async_task: bool = False, task_id: str | None = None) -> None:
"""Print model output to the console, optionally buffering for async tasks."""
async with async_output_lock:
if async_task and task_id:
Expand Down
13 changes: 9 additions & 4 deletions src/seclab_taskflow_agent/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def _resolve_task_model(

async def _build_prompts_to_run(
task_prompt: str,
*,
repeat_prompt: bool,
last_mcp_tool_results: list[str],
available_tools: AvailableTools,
Expand Down Expand Up @@ -309,7 +310,7 @@ async def deploy_task_agents(
model_settings = ModelSettings(**model_params)

# Build MCP servers and collect server prompts
entries = build_mcp_servers(available_tools, toolboxes, blocked_tools, headless)
entries = build_mcp_servers(available_tools, toolboxes, blocked_tools, headless=headless)
mcp_params = mcp_client_params(available_tools, toolboxes)
server_prompts = [sp for _, (_, _, sp, _) in mcp_params.items()]

Expand Down Expand Up @@ -581,11 +582,15 @@ async def on_handoff_hook(context: RunContextWrapper[TContext], agent: Agent[TCo

with TmpEnv(env):
prompts_to_run: list[str] = await _build_prompts_to_run(
task_prompt, repeat_prompt, last_mcp_tool_results,
available_tools, global_variables, inputs,
task_prompt,
repeat_prompt=repeat_prompt,
last_mcp_tool_results=last_mcp_tool_results,
available_tools=available_tools,
global_variables=global_variables,
inputs=inputs,
)

async def run_prompts(async_task: bool = False, max_concurrent_tasks: int = 5) -> bool:
async def run_prompts(*, async_task: bool = False, max_concurrent_tasks: int = 5) -> bool:
if run:
await render_model_output("** 🤖🐚 Executing Shell Task\n")
try:
Expand Down
1 change: 1 addition & 0 deletions src/seclab_taskflow_agent/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def record_task(
self,
index: int,
name: str,
*,
success: bool,
tool_results: list[str] | None = None,
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/seclab_taskflow_agent/template_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_source(
raise jinja2.TemplateNotFound(template)


def env_function(var_name: str, default: Optional[str] = None, required: bool = True) -> str:
def env_function(var_name: str, default: Optional[str] = None, *, required: bool = True) -> str:
"""Jinja2 function to access environment variables.

Args:
Expand Down
Loading