Pre-flight checklist
codex-lb version
1.22.0 (latest tag)
Deployment method
Docker
Client used against codex-lb
Codex CLI via Hermes Agent
ChatGPT account plan(s) involved
3x Plus
Model(s) involved
gpt-5.6-sol
What happened?
The dashboard overview error rate is dramatically inflated because it counts status=cancelled / error_code=client_disconnected requests as errors alongside genuine upstream failures.
The error rate is computed in app/modules/usage/builders.py (line ~307):
error_logs = [log for log in logs_secondary if log.status != "success"]
This treats any request that didn't end with a clean terminal event as an error. status=cancelled requests are normal agent lifecycle — they occur whenever a Codex CLI client disconnects before the final SSE event lands (e.g. agent finishes a turn, user stops a session, parallel agents cycle). They are not upstream errors.
On an instance running multiple parallel Codex CLI agents, cancelled requests dominate the total:
SELECT status, COUNT(*) as cnt FROM request_logs
WHERE requested_at > datetime('now', '-1 hour')
GROUP BY status ORDER BY cnt DESC;
success | 4
cancelled | 204
error | 0
Real upstream error rate: 0%
Dashboard displayed error rate: 98%
A user with previously stable error rate (0.2-0.7%) sees it spike to 60-98% due to normal agent activity, making the dashboard metric misleading for operational monitoring.
What did you expect to happen?
cancelled requests should be excluded from the error rate calculation, or the dashboard should display a breakdown (success / cancelled / error) so users can distinguish upstream failures from normal client lifecycle disconnects.
Suggested: error_rate = error_count / (success_count + error_count)
Steps to reproduce
- Run multiple parallel Codex CLI sessions through codex-lb
- Let agents start/stop naturally over an hour
- Observe dashboard error rate climbing due to
cancelled requests
- Query
request_logs table to confirm cancelled dominates
Relevant logs
N/A — reproducible purely from the request_logs table.
Configuration / environment
Default configuration, bridge disabled (CODEX_LB_HTTP_RESPONSES_SESSION_BRIDGE_ENABLED=false), but issue reproduces regardless.
Additional context
Issue #1323 documents the cancelled/client_disconnected metadata recording. This is a separate issue about how that status is then used in the error rate calculation.
Pre-flight checklist
codex-lb version
1.22.0 (latest tag)
Deployment method
Docker
Client used against codex-lb
Codex CLI via Hermes Agent
ChatGPT account plan(s) involved
3x Plus
Model(s) involved
gpt-5.6-sol
What happened?
The dashboard overview error rate is dramatically inflated because it counts
status=cancelled/error_code=client_disconnectedrequests as errors alongside genuine upstream failures.The error rate is computed in
app/modules/usage/builders.py(line ~307):This treats any request that didn't end with a clean terminal event as an error.
status=cancelledrequests are normal agent lifecycle — they occur whenever a Codex CLI client disconnects before the final SSE event lands (e.g. agent finishes a turn, user stops a session, parallel agents cycle). They are not upstream errors.On an instance running multiple parallel Codex CLI agents, cancelled requests dominate the total:
Real upstream error rate: 0%
Dashboard displayed error rate: 98%
A user with previously stable error rate (0.2-0.7%) sees it spike to 60-98% due to normal agent activity, making the dashboard metric misleading for operational monitoring.
What did you expect to happen?
cancelledrequests should be excluded from the error rate calculation, or the dashboard should display a breakdown (success / cancelled / error) so users can distinguish upstream failures from normal client lifecycle disconnects.Suggested:
error_rate = error_count / (success_count + error_count)Steps to reproduce
cancelledrequestsrequest_logstable to confirmcancelleddominatesRelevant logs
N/A — reproducible purely from the
request_logstable.Configuration / environment
Default configuration, bridge disabled (CODEX_LB_HTTP_RESPONSES_SESSION_BRIDGE_ENABLED=false), but issue reproduces regardless.
Additional context
Issue #1323 documents the
cancelled/client_disconnectedmetadata recording. This is a separate issue about how that status is then used in the error rate calculation.