fix(#44): retry grouping — hide startup errors from real turns#61
Merged
Conversation
Codex sessions mix 502/429/499 retries (0.1s, no output) with real API turns (85–249s, has output). Users see inflated failure rates and noisy turn lists. This separates retries from real turns client-side: - isRetry heuristic: !isHttpStatusOk(status) && !(output_tokens > 0) - Session card shows retry count badge (e.g. "4t 2r") - Turn list hides retry cards (still in allEntries for drill-down) - Gap timing and compression scans skip retries - Cost efficiency filter aligned with sparkline (input_tokens > 0) - Claude sessions completely unaffected (zero retry entries) Verified: 836 tests pass, browser smoke with real Codex sessions, keyboard nav confirmed to skip hidden retries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
繁中摘要
Codex session 把啟動失敗的 502/429/499 retry(0.1 秒、無 output)跟真正的 API 對話混在同一個 turn list,使用者看到 66% failure rate 但實際 100% 成功。
這個 PR 在 client 端把 retry 從 real turn 分開:
2t 2r(2 real turns, 2 retries)而非6tNo turns — 1 failed request (504)而非空白沉默只改 client-side(2 個 production 檔 + 1 個測試檔),server 完全不動。Heuristic 在 27,219 筆真實 log 驗證 99.9% 準確。
Problem
Codex sessions mix startup 502/429/499 retries (0.1s, no output) with real API turns (85–249s, has output). Users see inflated failure rates and a cluttered turn list.
Expert consensus (Tufte/Norman/Charity Majors roundtable):
!httpbadges lose meaning when 4/6 turns show themSolution
Heuristic —
isRetry = !isHttpStatusOk(status) && !(output_tokens > 0)Validated against 27,219 real log entries with independent adversarial verification (6 auditors + 1 judge, 13 claims cross-checked). 99.9% accuracy; 26 edge cases deferred to Phase 2.
Session card — shows real turn count + retry badge:
Turn list — retry entries hidden (still in allEntries for drill-down):
Empty state — all-retry sessions explain instead of silence:
Downstream filters fixed:
getVisibleTurnIndicesexcludes retries (keyboard nav skips hidden entries)renderCostEfficiencyPanelfilter aligned with sparkline (input_tokens > 0)Files changed (3, client-side only — server untouched)
public/entry-rendering.jspublic/miller-columns.jsNr), getVisibleTurnIndices filter, cost efficiency filter alignment,updateRetryEmptyState()for all-retry sessionstest/retry-grouping.test.jsVerification
019e9225(1t 1r) — retry hidden, badge visibleee89450f(521t) — zero retries, completely unaffected019e929d(0t 1r) — shows "No turns — 1 failed request (504)"Known limitations (Phase 2)
status=101(WS upgrade shells + interrupted turns) bypass the heuristic — needs transport-aware classificationstatus=200+ SSE error bypass — needs SSE event type detectioninput_tokens > 0butoutput_tokens = 0) leak through sparkline filterCloses #44
🤖 Generated with Claude Code