fix: remove --mock in the codebase + documentation

This commit is contained in:
Richard Tang
2026-02-06 15:59:22 -08:00
parent cee632f50c
commit 27f28afe9c
11 changed files with 51 additions and 90 deletions
-13
View File
@@ -33,11 +33,6 @@ def register_commands(subparsers: argparse._SubParsersAction) -> None:
type=str,
help="Input context from JSON file",
)
run_parser.add_argument(
"--mock",
action="store_true",
help="Run in mock mode (no real LLM calls)",
)
run_parser.add_argument(
"--output",
"-o",
@@ -192,11 +187,6 @@ def register_commands(subparsers: argparse._SubParsersAction) -> None:
help="Launch interactive TUI dashboard",
description="Browse available agents and launch the terminal dashboard.",
)
tui_parser.add_argument(
"--mock",
action="store_true",
help="Run in mock mode (no real LLM calls)",
)
tui_parser.add_argument(
"--model",
"-m",
@@ -248,7 +238,6 @@ def cmd_run(args: argparse.Namespace) -> int:
try:
runner = AgentRunner.load(
args.agent_path,
mock_mode=args.mock,
model=args.model,
enable_tui=True,
)
@@ -286,7 +275,6 @@ def cmd_run(args: argparse.Namespace) -> int:
try:
runner = AgentRunner.load(
args.agent_path,
mock_mode=args.mock,
model=args.model,
enable_tui=False,
)
@@ -1057,7 +1045,6 @@ def cmd_tui(args: argparse.Namespace) -> int:
try:
runner = AgentRunner.load(
agent_path,
mock_mode=args.mock,
model=args.model,
enable_tui=True,
)
-4
View File
@@ -299,8 +299,6 @@ PYTHONPATH=exports uv run python -m agent_name run --input '{
"customer_id": "CUST-123"
}'
# Run in mock mode (no LLM calls)
PYTHONPATH=exports uv run python -m agent_name run --mock --input '{...}'
```
---
@@ -623,8 +621,6 @@ logging.basicConfig(level=logging.DEBUG)
# Run with verbose output
PYTHONPATH=exports uv run python -m agent_name run --input '{...}' --verbose
# Use mock mode to test without LLM calls
PYTHONPATH=exports uv run python -m agent_name run --mock --input '{...}'
```
---
-2
View File
@@ -154,8 +154,6 @@ PYTHONPATH=exports uv run python -m your_agent_name run --input '{
"task": "Your input here"
}'
# Run in mock mode (no LLM calls)
PYTHONPATH=exports uv run python -m your_agent_name run --mock --input '{...}'
```
## Building New Agents and Run Flow
-4
View File
@@ -127,8 +127,6 @@ PYTHONPATH=exports uv run python -m my_agent run --input '{
"task": "Your input here"
}'
# Run in mock mode (no LLM calls)
PYTHONPATH=exports uv run python -m my_agent run --mock --input '{...}'
```
## API Keys Setup
@@ -194,8 +192,6 @@ uv pip install -e .
# Verify API key is set
echo $ANTHROPIC_API_KEY
# Run in mock mode to test without API
PYTHONPATH=exports uv run python -m my_agent run --mock --input '{...}'
```
### Package Installation Issues
@@ -34,18 +34,17 @@ def cli():
@cli.command()
@click.option("--topic", "-t", type=str, required=True, help="Research topic")
@click.option("--mock", is_flag=True, help="Run in mock mode")
@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")
def run(topic, mock, quiet, verbose, debug):
def run(topic, quiet, verbose, debug):
"""Execute research on a topic."""
if not quiet:
setup_logging(verbose=verbose, debug=debug)
context = {"topic": topic}
result = asyncio.run(default_agent.run(context, mock_mode=mock))
result = asyncio.run(default_agent.run(context))
output_data = {
"success": result.success,
@@ -60,10 +59,9 @@ def run(topic, mock, quiet, verbose, debug):
@cli.command()
@click.option("--mock", is_flag=True, help="Run in mock mode")
@click.option("--verbose", "-v", is_flag=True, help="Show execution details")
@click.option("--debug", is_flag=True, help="Show debug logging")
def tui(mock, verbose, debug):
def tui(verbose, debug):
"""Launch the TUI dashboard for interactive research."""
setup_logging(verbose=verbose, debug=debug)
@@ -97,13 +95,11 @@ def tui(mock, verbose, debug):
if mcp_config_path.exists():
agent._tool_registry.load_mcp_config(mcp_config_path)
llm = None
if not mock:
llm = LiteLLMProvider(
model=agent.config.model,
api_key=agent.config.api_key,
api_base=agent.config.api_base,
)
llm = LiteLLMProvider(
model=agent.config.model,
api_key=agent.config.api_key,
api_base=agent.config.api_base,
)
tools = list(agent._tool_registry.get_tools().values())
tool_executor = agent._tool_registry.get_executor()
+10 -12
View File
@@ -173,7 +173,7 @@ class DeepResearchAgent:
},
)
def _setup(self, mock_mode=False) -> GraphExecutor:
def _setup(self) -> GraphExecutor:
"""Set up the executor with all components."""
from pathlib import Path
@@ -187,13 +187,11 @@ class DeepResearchAgent:
if mcp_config_path.exists():
self._tool_registry.load_mcp_config(mcp_config_path)
llm = None
if not mock_mode:
llm = LiteLLMProvider(
model=self.config.model,
api_key=self.config.api_key,
api_base=self.config.api_base,
)
llm = LiteLLMProvider(
model=self.config.model,
api_key=self.config.api_key,
api_base=self.config.api_base,
)
tool_executor = self._tool_registry.get_executor()
tools = list(self._tool_registry.get_tools().values())
@@ -213,10 +211,10 @@ class DeepResearchAgent:
return self._executor
async def start(self, mock_mode=False) -> None:
async def start(self) -> None:
"""Set up the agent (initialize executor and tools)."""
if self._executor is None:
self._setup(mock_mode=mock_mode)
self._setup()
async def stop(self) -> None:
"""Clean up resources."""
@@ -244,10 +242,10 @@ class DeepResearchAgent:
)
async def run(
self, context: dict, mock_mode=False, session_state=None
self, context: dict, session_state=None
) -> ExecutionResult:
"""Run the agent (convenience method for single execution)."""
await self.start(mock_mode=mock_mode)
await self.start()
try:
result = await self.trigger_and_wait(
"start", context, session_state=session_state
@@ -33,18 +33,17 @@ def cli():
@cli.command()
@click.option("--mock", is_flag=True, help="Run in mock mode")
@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")
def run(mock, quiet, verbose, debug):
def run(quiet, verbose, debug):
"""Execute the news reporter agent."""
if not quiet:
setup_logging(verbose=verbose, debug=debug)
context = {}
result = asyncio.run(default_agent.run(context, mock_mode=mock))
result = asyncio.run(default_agent.run(context))
output_data = {
"success": result.success,
@@ -59,10 +58,9 @@ def run(mock, quiet, verbose, debug):
@cli.command()
@click.option("--mock", is_flag=True, help="Run in mock mode")
@click.option("--verbose", "-v", is_flag=True, help="Show execution details")
@click.option("--debug", is_flag=True, help="Show debug logging")
def tui(mock, verbose, debug):
def tui(verbose, debug):
"""Launch the TUI dashboard for interactive news reporting."""
setup_logging(verbose=verbose, debug=debug)
@@ -95,13 +93,11 @@ def tui(mock, verbose, debug):
if mcp_config_path.exists():
agent._tool_registry.load_mcp_config(mcp_config_path)
llm = None
if not mock:
llm = LiteLLMProvider(
model=agent.config.model,
api_key=agent.config.api_key,
api_base=agent.config.api_base,
)
llm = LiteLLMProvider(
model=agent.config.model,
api_key=agent.config.api_key,
api_base=agent.config.api_base,
)
tools = list(agent._tool_registry.get_tools().values())
tool_executor = agent._tool_registry.get_executor()
@@ -157,7 +157,7 @@ class TechNewsReporterAgent:
},
)
def _setup(self, mock_mode=False) -> GraphExecutor:
def _setup(self) -> GraphExecutor:
"""Set up the executor with all components."""
from pathlib import Path
@@ -197,10 +197,10 @@ class TechNewsReporterAgent:
return self._executor
async def start(self, mock_mode=False) -> None:
async def start(self) -> None:
"""Set up the agent (initialize executor and tools)."""
if self._executor is None:
self._setup(mock_mode=mock_mode)
self._setup()
async def stop(self) -> None:
"""Clean up resources."""
@@ -228,10 +228,10 @@ class TechNewsReporterAgent:
)
async def run(
self, context: dict, mock_mode=False, session_state=None
self, context: dict, session_state=None
) -> ExecutionResult:
"""Run the agent (convenience method for single execution)."""
await self.start(mock_mode=mock_mode)
await self.start()
try:
result = await self.trigger_and_wait(
"start", context, session_state=session_state
@@ -18,8 +18,8 @@ PYTHONPATH=core:exports uv run python -m twitter_outreach validate
# Show agent info
PYTHONPATH=core:exports uv run python -m twitter_outreach info
# Run in mock mode (no API calls)
PYTHONPATH=core:exports uv run python -m twitter_outreach run --mock
# Run the workflow
PYTHONPATH=core:exports uv run python -m twitter_outreach run
# Launch the TUI
PYTHONPATH=core:exports uv run python -m twitter_outreach tui
@@ -33,16 +33,15 @@ def cli():
@cli.command()
@click.option("--mock", is_flag=True, help="Run in mock mode")
@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")
def run(mock, quiet, verbose, debug):
def run(quiet, verbose, debug):
"""Execute the outreach workflow."""
if not quiet:
setup_logging(verbose=verbose, debug=debug)
result = asyncio.run(default_agent.run({}, mock_mode=mock))
result = asyncio.run(default_agent.run({}))
output_data = {
"success": result.success,
@@ -57,10 +56,9 @@ def run(mock, quiet, verbose, debug):
@cli.command()
@click.option("--mock", is_flag=True, help="Run in mock mode")
@click.option("--verbose", "-v", is_flag=True, help="Show execution details")
@click.option("--debug", is_flag=True, help="Show debug logging")
def tui(mock, verbose, debug):
def tui(verbose, debug):
"""Launch the TUI dashboard for interactive outreach."""
setup_logging(verbose=verbose, debug=debug)
@@ -93,13 +91,11 @@ def tui(mock, verbose, debug):
if mcp_config_path.exists():
agent._tool_registry.load_mcp_config(mcp_config_path)
llm = None
if not mock:
llm = LiteLLMProvider(
model=agent.config.model,
api_key=agent.config.api_key,
api_base=agent.config.api_base,
)
llm = LiteLLMProvider(
model=agent.config.model,
api_key=agent.config.api_key,
api_base=agent.config.api_base,
)
tools = list(agent._tool_registry.get_tools().values())
tool_executor = agent._tool_registry.get_executor()
+10 -12
View File
@@ -172,7 +172,7 @@ class TwitterOutreachAgent:
},
)
def _setup(self, mock_mode=False) -> GraphExecutor:
def _setup(self) -> GraphExecutor:
"""Set up the executor with all components."""
from pathlib import Path
@@ -186,13 +186,11 @@ class TwitterOutreachAgent:
if mcp_config_path.exists():
self._tool_registry.load_mcp_config(mcp_config_path)
llm = None
if not mock_mode:
llm = LiteLLMProvider(
model=self.config.model,
api_key=self.config.api_key,
api_base=self.config.api_base,
)
llm = LiteLLMProvider(
model=self.config.model,
api_key=self.config.api_key,
api_base=self.config.api_base,
)
tool_executor = self._tool_registry.get_executor()
tools = list(self._tool_registry.get_tools().values())
@@ -212,10 +210,10 @@ class TwitterOutreachAgent:
return self._executor
async def start(self, mock_mode=False) -> None:
async def start(self) -> None:
"""Set up the agent (initialize executor and tools)."""
if self._executor is None:
self._setup(mock_mode=mock_mode)
self._setup()
async def stop(self) -> None:
"""Clean up resources."""
@@ -243,10 +241,10 @@ class TwitterOutreachAgent:
)
async def run(
self, context: dict, mock_mode=False, session_state=None
self, context: dict, session_state=None
) -> ExecutionResult:
"""Run the agent (convenience method for single execution)."""
await self.start(mock_mode=mock_mode)
await self.start()
try:
result = await self.trigger_and_wait(
"start", context, session_state=session_state