Severity: Low · Area: Tests / quality · Category: test-coverage
Location: services/agent/selene_agent/selene_agent.py:421
What's wrong
The /v1/chat/completions route and its single-use orchestrator builder (selene_agent.py:396-421) are the external OpenAI-compatible API surface, yet no test exercises request validation, message passthrough, tool handling, or the response envelope. Every other chat entry point (REST /api/chat, WS /ws/chat, resume) has dedicated tests; this one relies entirely on manual testing.
How it fails
A refactor of AgentOrchestrator's constructor or run() event shapes (the kind of change tests exist to guard) breaks only the ephemeral-orchestrator wiring; the suite stays green and external clients get 500s until someone notices in production.
Suggested fix
Add tests mirroring the /api/chat pattern: FastAPI app + the v1 route, fake provider, asserting a well-formed chat.completion response, statelessness (no pool interaction), and error mapping for bad payloads.
Adversarial verification — both skeptics confirmed
Skeptic 1 (confirmed) — Confirmed. Grep across all 45 files in services/agent/tests/ finds zero references to /v1/chat/completions, ChatCompletionRequest, _build_ephemeral_orchestrator, collect_response, or _stream_sse — the endpoint at selene_agent.py:421 and its ephemeral-orchestrator builder (395-418) are entirely untested. The contrast claim is also accurat…
Skeptic 2 (confirmed) — Confirmed. selene_agent.py:421 defines @app.post("/v1/chat/completions") and lines 395-418 hold _build_ephemeral_orchestrator; grep of services/agent/tests/ finds no reference to the route, the builder, collect_response, or _stream_sse — zero coverage. The comparison holds: /api/chat and /ws/chat are tested in test_chat_header_idle_timeo…
Filed from a multi-agent audit of 855f5cc: 16 reviewers over ~42k lines produced 170 raw findings; each was handed to 2 independent agents prompted to refute it, and only findings both confirmed were kept (19 refuted, 10 split-verdict, 127 unique confirmed). Line numbers are 1-indexed against 855f5cc and will drift as the code changes.
Severity: Low · Area: Tests / quality · Category:
test-coverageLocation:
services/agent/selene_agent/selene_agent.py:421What's wrong
The /v1/chat/completions route and its single-use orchestrator builder (selene_agent.py:396-421) are the external OpenAI-compatible API surface, yet no test exercises request validation, message passthrough, tool handling, or the response envelope. Every other chat entry point (REST /api/chat, WS /ws/chat, resume) has dedicated tests; this one relies entirely on manual testing.
How it fails
A refactor of AgentOrchestrator's constructor or run() event shapes (the kind of change tests exist to guard) breaks only the ephemeral-orchestrator wiring; the suite stays green and external clients get 500s until someone notices in production.
Suggested fix
Add tests mirroring the /api/chat pattern: FastAPI app + the v1 route, fake provider, asserting a well-formed chat.completion response, statelessness (no pool interaction), and error mapping for bad payloads.
Adversarial verification — both skeptics confirmed
Filed from a multi-agent audit of
855f5cc: 16 reviewers over ~42k lines produced 170 raw findings; each was handed to 2 independent agents prompted to refute it, and only findings both confirmed were kept (19 refuted, 10 split-verdict, 127 unique confirmed). Line numbers are 1-indexed against855f5ccand will drift as the code changes.