Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/chenxl6822_fitloop.json
T
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
2.3 KiB
JSON

{"repo": "chenxl6822/fitloop", "files": {"agent-service/tests/test_demo.py": {"59fb7c0d3c69fbb33d69b9ff08ac12ce43ce29bc": {"t": 1786068243.786682, "n": 2031, "h": "8296c3decbc5d0b7", "c": "from types import SimpleNamespace\n\nimport pytest\n\nfrom fitloop_agent import demo\nfrom fitloop_agent.config import Settings\nfrom fitloop_agent.schemas import AppealDecision, CoachOutput\n\n\ndef settings() -> Settings:\n return Settings(\n deepseek_api_key=\"not-used\",\n agent_service_key=\"demo-backend-not-used\",\n agent_worker_enabled=False,\n )\n\n\n@pytest.mark.asyncio\nasync def test_live_demo_runs_both_workflows_with_required_tools(monkeypatch) -> None:\n async def fake_run_coach(_provider, context, _input_text, _settings):\n for tool_name in sorted(demo.COACH_REQUIRED_TOOLS):\n await context.backend.tool(\"/demo\", context.token, tool_name)\n return (\n CoachOutput(answer=\"A gradual plan based on evidence.\", rationale=[\"Normal load.\"]),\n SimpleNamespace(raw_responses=[]),\n )\n\n async def fake_run_appeal(_provider, context, _input_text, _settings):\n for tool_name in sorted(demo.APPEAL_REQUIRED_TOOLS):\n await context.backend.tool(\"/demo\", context.token, tool_name)\n return (\n AppealDecision(\n decision=\"APPROVE\",\n confidence=0.85,\n evidence=[\"The spike was shorter than the configured threshold.\"],\n reason=\"The deterministic rule was not triggered.\",\n ),\n SimpleNamespace(raw_responses=[]),\n )\n\n monkeypatch.setattr(demo, \"run_coach\", fake_run_coach)\n monkeypatch.setattr(demo, \"run_appeal\", fake_run_appeal)\n\n results = await demo.run_live_demo(settings())\n\n assert [result[\"workflow\"] for result in results] == [\"coach\", \"appeal\"]\n assert set(results[0][\"tools\"]) == demo.COACH_REQUIRED_TOOLS\n assert set(results[1][\"tools\"]) == demo.APPEAL_REQUIRED_TOOLS\n\n\n@pytest.mark.asyncio\nasync def test_demo_backend_rejects_unknown_tools() -> None:\n backend = demo.DemoBackend()\n\n with pytest.raises(KeyError, match=\"does not allow tool\"):\n await backend.tool(\"/demo\", \"demo-token\", \"delete_user\")\n"}}}}