From af10494b31be1ce46d9c2c9d3df7a8b706cc8e65 Mon Sep 17 00:00:00 2001 From: Richard Tang Date: Tue, 17 Mar 2026 20:41:08 -0700 Subject: [PATCH] chore: ruff lint --- core/framework/server/session_manager.py | 4 +-- core/framework/tools/queen_lifecycle_tools.py | 20 +++++++++---- examples/templates/sdr_agent/__main__.py | 29 ++++++++++++++++--- examples/templates/sdr_agent/agent.py | 1 + 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/core/framework/server/session_manager.py b/core/framework/server/session_manager.py index 2cce52f1..bcd74cac 100644 --- a/core/framework/server/session_manager.py +++ b/core/framework/server/session_manager.py @@ -914,9 +914,7 @@ class SessionManager: ) ) - async def _emit_flowchart_on_restore( - self, session: Session, agent_path: str | Path - ) -> None: + async def _emit_flowchart_on_restore(self, session: Session, agent_path: str | Path) -> None: """Emit FLOWCHART_MAP_UPDATED from persisted flowchart file on cold restore.""" from framework.runtime.event_bus import AgentEvent, EventType from framework.tools.flowchart_utils import load_flowchart_file diff --git a/core/framework/tools/queen_lifecycle_tools.py b/core/framework/tools/queen_lifecycle_tools.py index 6d9833bf..e00b1598 100644 --- a/core/framework/tools/queen_lifecycle_tools.py +++ b/core/framework/tools/queen_lifecycle_tools.py @@ -2123,10 +2123,14 @@ def register_queen_lifecycle_tools( _agent_folder.mkdir(parents=True, exist_ok=True) _save_flowchart_file(_agent_folder, original_copy, fmap) phase_state.agent_path = str(_agent_folder) - _update_meta_json(session_manager, manager_session_id, { - "agent_path": str(_agent_folder), - "agent_name": _agent_name.replace("_", " ").title(), - }) + _update_meta_json( + session_manager, + manager_session_id, + { + "agent_path": str(_agent_folder), + "agent_name": _agent_name.replace("_", " ").title(), + }, + ) dissolved_count = len(original_nodes) - len(converted.get("nodes", [])) decision_count = sum(1 for n in original_nodes if n.get("flowchart_type") == "decision") @@ -2301,9 +2305,13 @@ def register_queen_lifecycle_tools( if parsed.get("success", True): if phase_state is not None: # Set agent_path so the frontend can query credentials - phase_state.agent_path = phase_state.agent_path or str(Path("exports") / agent_name) + phase_state.agent_path = phase_state.agent_path or str( + Path("exports") / agent_name + ) await phase_state.switch_to_building(source="tool") - _update_meta_json(session_manager, manager_session_id, {"phase": "building"}) + _update_meta_json( + session_manager, manager_session_id, {"phase": "building"} + ) # Reset draft state after successful scaffolding phase_state.build_confirmed = False # Persist flowchart now that the agent folder exists diff --git a/examples/templates/sdr_agent/__main__.py b/examples/templates/sdr_agent/__main__.py index 16ca4326..d6d2872d 100644 --- a/examples/templates/sdr_agent/__main__.py +++ b/examples/templates/sdr_agent/__main__.py @@ -34,9 +34,27 @@ def cli(): @cli.command() -@click.option("--contacts", "-c", type=str, required=True, help="JSON string or file path of contacts list") -@click.option("--goal", "-g", type=str, default="coffee chat", help="Outreach goal (e.g. 'coffee chat', 'sales pitch')") -@click.option("--background", "-b", type=str, default="", help="Your background/role for personalization") +@click.option( + "--contacts", + "-c", + type=str, + required=True, + help="JSON string or file path of contacts list", +) +@click.option( + "--goal", + "-g", + type=str, + default="coffee chat", + help="Outreach goal (e.g. 'coffee chat', 'sales pitch')", +) +@click.option( + "--background", + "-b", + type=str, + default="", + help="Your background/role for personalization", +) @click.option( "--max-contacts", "-m", @@ -44,7 +62,9 @@ def cli(): default=20, help="Max contacts to process per batch (default: 20)", ) -@click.option("--mock", is_flag=True, help="Run in mock mode without LLM or Gmail calls") +@click.option( + "--mock", is_flag=True, help="Run in mock mode without LLM or Gmail calls" +) @click.option("--quiet", "-q", is_flag=True, help="Only output result JSON") @click.option("--verbose", "-v", is_flag=True, help="Show execution details") @click.option("--debug", is_flag=True, help="Show debug logging") @@ -204,6 +224,7 @@ async def _interactive_shell(verbose=False): except Exception as e: click.echo(f"Error: {e}", err=True) import traceback + traceback.print_exc() finally: await agent.stop() diff --git a/examples/templates/sdr_agent/agent.py b/examples/templates/sdr_agent/agent.py index 907b21d0..047098b8 100644 --- a/examples/templates/sdr_agent/agent.py +++ b/examples/templates/sdr_agent/agent.py @@ -233,6 +233,7 @@ class SDRAgent: if mock_mode: from framework.llm.mock import MockLLMProvider + llm = MockLLMProvider() else: llm = LiteLLMProvider(