mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 15:01:34 +08:00
Compare commits
4 Commits
codex-port
...
ci/matrix-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c56d60d82 | ||
|
|
5d179b9777 | ||
|
|
c2559b80fa | ||
|
|
50f23ea522 |
10
.github/workflows/tests.yml
vendored
10
.github/workflows/tests.yml
vendored
@@ -16,8 +16,13 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: test (${{ matrix.group }}/4)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
group: [1, 2, 3, 4]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||||
@@ -37,10 +42,11 @@ jobs:
|
|||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
uv pip install -e ".[all,dev]"
|
uv pip install -e ".[all,dev]"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests (shard ${{ matrix.group }}/4)
|
||||||
run: |
|
run: |
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
python -m pytest tests/ -q --ignore=tests/integration --ignore=tests/e2e --tb=short -n auto
|
python -m pytest tests/ -q --ignore=tests/integration --ignore=tests/e2e --tb=short \
|
||||||
|
--splits 4 --group ${{ matrix.group }}
|
||||||
env:
|
env:
|
||||||
# Ensure tests don't accidentally call real APIs
|
# Ensure tests don't accidentally call real APIs
|
||||||
OPENROUTER_API_KEY: ""
|
OPENROUTER_API_KEY: ""
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ dependencies = [
|
|||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
modal = ["modal>=1.0.0,<2"]
|
modal = ["modal>=1.0.0,<2"]
|
||||||
daytona = ["daytona>=0.148.0,<1"]
|
daytona = ["daytona>=0.148.0,<1"]
|
||||||
dev = ["debugpy>=1.8.0,<2", "pytest>=9.0.2,<10", "pytest-asyncio>=1.3.0,<2", "pytest-xdist>=3.0,<4", "mcp>=1.2.0,<2"]
|
dev = ["debugpy>=1.8.0,<2", "pytest>=9.0.2,<10", "pytest-asyncio>=1.3.0,<2", "pytest-xdist>=3.0,<4", "pytest-split>=0.9,<1", "mcp>=1.2.0,<2"]
|
||||||
messaging = ["python-telegram-bot[webhooks]>=22.6,<23", "discord.py[voice]>=2.7.1,<3", "aiohttp>=3.13.3,<4", "slack-bolt>=1.18.0,<2", "slack-sdk>=3.27.0,<4", "qrcode>=7.0,<8"]
|
messaging = ["python-telegram-bot[webhooks]>=22.6,<23", "discord.py[voice]>=2.7.1,<3", "aiohttp>=3.13.3,<4", "slack-bolt>=1.18.0,<2", "slack-sdk>=3.27.0,<4", "qrcode>=7.0,<8"]
|
||||||
cron = ["croniter>=6.0.0,<7"]
|
cron = ["croniter>=6.0.0,<7"]
|
||||||
slack = ["slack-bolt>=1.18.0,<2", "slack-sdk>=3.27.0,<4"]
|
slack = ["slack-bolt>=1.18.0,<2", "slack-sdk>=3.27.0,<4"]
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class TestGeneric400Heuristic:
|
|||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-12345",
|
api_key="test-key-12345",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ def agent():
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ class TestFlushDeduplication:
|
|||||||
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
session_db=session_db,
|
session_db=session_db,
|
||||||
@@ -271,6 +273,8 @@ class TestFlushIdxInit:
|
|||||||
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -283,6 +287,8 @@ class TestFlushIdxInit:
|
|||||||
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ class TestFlushAfterCompression:
|
|||||||
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
with patch.dict(os.environ, {"OPENROUTER_API_KEY": "test-key"}):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
session_db=session_db,
|
session_db=session_db,
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ from run_agent import AIAgent
|
|||||||
def test_create_openai_client_does_not_mutate_input_kwargs(mock_openai):
|
def test_create_openai_client_does_not_mutate_input_kwargs(mock_openai):
|
||||||
mock_openai.return_value = MagicMock()
|
mock_openai.return_value = MagicMock()
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ from run_agent import AIAgent
|
|||||||
|
|
||||||
def _make_agent():
|
def _make_agent():
|
||||||
return AIAgent(
|
return AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ def _make_agent(fallback_model=None):
|
|||||||
):
|
):
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="test-key",
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ def test_plugin_engine_gets_context_length_on_init():
|
|||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -75,6 +76,7 @@ def test_plugin_engine_update_model_args():
|
|||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
model="openrouter/auto",
|
model="openrouter/auto",
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ def _make_agent(fallback_model=None):
|
|||||||
):
|
):
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="test-key",
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ def _make_agent(monkeypatch, provider, api_mode="chat_completions", base_url="ht
|
|||||||
)
|
)
|
||||||
if model:
|
if model:
|
||||||
kwargs["model"] = model
|
kwargs["model"] = model
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
return AIAgent(**kwargs)
|
return AIAgent(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ def agent():
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -76,6 +77,7 @@ def agent_with_memory_tool():
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-k...7890",
|
api_key="test-k...7890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -112,12 +114,14 @@ def test_aiagent_reuses_existing_errors_log_handler():
|
|||||||
):
|
):
|
||||||
AIAgent(
|
AIAgent(
|
||||||
api_key="test-k...7890",
|
api_key="test-k...7890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
)
|
)
|
||||||
AIAgent(
|
AIAgent(
|
||||||
api_key="test-k...7890",
|
api_key="test-k...7890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -491,6 +495,7 @@ class TestInit:
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="openai/gpt-4o",
|
model="openai/gpt-4o",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -542,6 +547,7 @@ class TestInit:
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -557,6 +563,7 @@ class TestInit:
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -694,6 +701,7 @@ class TestBuildSystemPrompt:
|
|||||||
):
|
):
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="test-k...7890",
|
api_key="test-k...7890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -726,6 +734,7 @@ class TestToolUseEnforcementConfig:
|
|||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
model=model,
|
model=model,
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -822,6 +831,7 @@ class TestToolUseEnforcementConfig:
|
|||||||
):
|
):
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="test-key-1234567890",
|
api_key="test-key-1234567890",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
@@ -3433,7 +3443,7 @@ class TestAnthropicBaseUrlPassthrough:
|
|||||||
):
|
):
|
||||||
mock_build.return_value = MagicMock()
|
mock_build.return_value = MagicMock()
|
||||||
a = AIAgent(
|
a = AIAgent(
|
||||||
api_key="sk-ant-api03-test1234567890",
|
api_key="sk-ant...7890",
|
||||||
api_mode="anthropic_messages",
|
api_mode="anthropic_messages",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -3457,6 +3467,7 @@ class TestAnthropicCredentialRefresh:
|
|||||||
mock_build.side_effect = [old_client, new_client]
|
mock_build.side_effect = [old_client, new_client]
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="sk-ant-oat01-stale-token",
|
api_key="sk-ant-oat01-stale-token",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
api_mode="anthropic_messages",
|
api_mode="anthropic_messages",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -3487,6 +3498,7 @@ class TestAnthropicCredentialRefresh:
|
|||||||
):
|
):
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="sk-ant-oat01-same-token",
|
api_key="sk-ant-oat01-same-token",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
api_mode="anthropic_messages",
|
api_mode="anthropic_messages",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -3514,6 +3526,7 @@ class TestAnthropicCredentialRefresh:
|
|||||||
):
|
):
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="sk-ant-oat01-current-token",
|
api_key="sk-ant-oat01-current-token",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
api_mode="anthropic_messages",
|
api_mode="anthropic_messages",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ class TestStreamingAccumulator:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -120,6 +122,8 @@ class TestStreamingAccumulator:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -167,6 +171,8 @@ class TestStreamingAccumulator:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -205,6 +211,8 @@ class TestStreamingAccumulator:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -245,6 +253,8 @@ class TestStreamingCallbacks:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -277,6 +287,8 @@ class TestStreamingCallbacks:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -308,6 +320,8 @@ class TestStreamingCallbacks:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -346,6 +360,8 @@ class TestStreamingCallbacks:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -381,6 +397,8 @@ class TestStreamingCallbacks:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -428,6 +446,8 @@ class TestStreamingFallback:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -455,6 +475,8 @@ class TestStreamingFallback:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -477,6 +499,8 @@ class TestStreamingFallback:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -500,6 +524,8 @@ class TestStreamingFallback:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -542,6 +568,8 @@ class TestStreamingFallback:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -577,6 +605,8 @@ class TestStreamingFallback:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -619,6 +649,8 @@ class TestReasoningStreaming:
|
|||||||
mock_create.return_value = mock_client
|
mock_create.return_value = mock_client
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -646,6 +678,8 @@ class TestHasStreamConsumers:
|
|||||||
def test_no_consumers(self):
|
def test_no_consumers(self):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -656,6 +690,8 @@ class TestHasStreamConsumers:
|
|||||||
def test_delta_callback_set(self):
|
def test_delta_callback_set(self):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -667,6 +703,8 @@ class TestHasStreamConsumers:
|
|||||||
def test_stream_callback_set(self):
|
def test_stream_callback_set(self):
|
||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -688,6 +726,8 @@ class TestCodexStreamCallbacks:
|
|||||||
deltas = []
|
deltas = []
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -729,6 +769,8 @@ class TestCodexStreamCallbacks:
|
|||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -792,6 +834,8 @@ class TestCodexStreamCallbacks:
|
|||||||
)
|
)
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -810,6 +854,8 @@ class TestCodexStreamCallbacks:
|
|||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
@@ -861,6 +907,8 @@ class TestAnthropicStreamCallbacks:
|
|||||||
from run_agent import AIAgent
|
from run_agent import AIAgent
|
||||||
|
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
model="test/model",
|
model="test/model",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ def _make_agent(session_db, *, platform: str):
|
|||||||
):
|
):
|
||||||
agent = AIAgent(
|
agent = AIAgent(
|
||||||
api_key="test-key",
|
api_key="test-key",
|
||||||
|
base_url="https://openrouter.ai/api/v1",
|
||||||
quiet_mode=True,
|
quiet_mode=True,
|
||||||
skip_context_files=True,
|
skip_context_files=True,
|
||||||
skip_memory=True,
|
skip_memory=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user