改用Grok联网搜索并保留每轮信号

This commit is contained in:
Codex
2026-07-09 00:14:20 +08:00
parent 4f50de8def
commit e02d5db495
14 changed files with 465 additions and 110 deletions
+12 -5
View File
@@ -35,22 +35,29 @@ def test_home_page_returns_dashboard_shell(monkeypatch) -> None:
assert response.status_code == 200
assert "SignalScout" in response.text
assert "今日 AI 信号" in response.text
assert "手动搜索" in response.text
assert "renderMarkdownReport" in response.text
assert "自动记录" not in response.text
assert "采集今日情报" not in response.text
def test_manual_agent_run_endpoint_is_not_exposed(monkeypatch) -> None:
# Agent只通过后台调度器自动运行,HTTP API不提供手动启动入口
def test_manual_agent_run_endpoint_starts_background_job(monkeypatch) -> None:
# 手动搜索入口复用调度任务,方便验证每轮候选和入库数量
monkeypatch.setenv("SIGNALSCOUT_ENV", "test")
get_settings.cache_clear()
started = []
def fake_run_scheduled_job(settings):
started.append(settings.env)
monkeypatch.setattr("app.api.routes.run_scheduled_job", fake_run_scheduled_job)
with TestClient(create_app()) as client:
response = client.post("/agent/runs/daily")
stream_response = client.post("/agent/runs/daily/stream")
get_settings.cache_clear()
assert response.status_code == 404
assert stream_response.status_code == 404
assert response.status_code == 200
assert response.json()["status"] == "started"
assert started == ["test"]
def test_dashboard_returns_news_and_github_signals_separately(monkeypatch) -> None: