Repository navigation
Description
Summary
About 32 tests across the api and agent_server tiers call pytest.skip(...) whenever a real chat/task call returns HTTP 503, with a generic reason like "Agent server not ready" / "Agent not ready (503)". A 503 caused by an exhausted model-provider credit balance is therefore reported as a benign skip rather than a failure — so a run stays green-looking while all chat, task, execution, parallel-task, and fan-out coverage is silently lost.
Context
Observed on an instance where the platform credential had no remaining balance and no subscription fallback was configured (GET /api/subscriptions returned []). A direct probe returns:
POST /api/agents/<agent>/task -> 503
{"detail":"...Claude Code execution failed (exit code 1): Credit balance is too low.
To resolve: (1) add credits to your account, or (2) assign a subscription token
with available usage in Settings -> Subscriptions."}
The suite reported these 32 tests as skips. They are coverage loss, not acceptable skips. This contradicts the documented testing doctrine that a partial run is a failed run and that infra-broken skips must be counted as failures.
Skip-on-503 sites:
| File | Count |
|---|---|
tests/test_parallel_task.py |
12 |
tests/test_executions.py |
11 |
tests/test_agent_chat.py |
6 |
tests/test_execution_queue.py |
1 |
tests/test_execution_streaming.py |
1 |
tests/agent_server/test_agent_chat_direct.py |
1 |
The shared wording is the core defect: "agent server still starting" and "provider credential is unusable" are indistinguishable in the report, so the second hides behind the first indefinitely.
Acceptance Criteria
- A 503 whose body indicates credit / billing / subscription exhaustion FAILS the test rather than skipping it
- A 503 that is a genuine transient readiness race still skips (or, better, retries with backoff), and the reason text states which of the two it concluded and on what evidence
- Skip reasons distinguish "agent server still starting" from "provider credential unusable"
- A session-level preflight fails fast with one clear message when the configured credential cannot execute at all, instead of producing 32 individually-skipped tests
Technical Notes
The classification policy should live in one place — e.g. a helper in tests/conftest.py that inspects a 503 body once — rather than being re-implemented at ~32 call sites, which is how the two causes came to share one reason string.
Activity
dolho commentedon Sep 18, 2026
/claim
github-actions commentedon Sep 18, 2026
Claimed by @dolho. Label
status-in-progressadded.Next steps:
feature/2889-<short-slug>Fixes #2889fix(tests): classify a model-turn 503 instead of skipping on it (#2889)…