Repository navigation
fix(codex): a Codex row keeps its working and waiting bar when the model errors mid-turn - #2977
Merged
Merged
Conversation
…del errors mid-turn
Codex sends an `error` notification for every retried reply stream
("Reconnecting... 1/2") and a `systemError` thread status for a turn that
failed for good. Both are about one turn, not about Koloft losing sight of
the session, yet both marked the tab "Status unavailable": the row lost its
run-state bar until the tab moved to another thread. Now a retried turn stays
working, a failed turn ends like any other, and the next turn works as usual.
Measured on codex-cli 0.169.0 and written down as CODEX§39.
A turn whose `error` says `willRetry: false` shows its message as a toast again, without marking the tab "Status unavailable"; a retried stream still shows nothing. A child agent whose thread goes `systemError` now waits, as the main thread does.
…r with no willRetry is still told
…n-status-indicator
…n-status-indicator
…n-status-indicator
…n-status-indicator
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.
What it does — A Codex row keeps its working / waiting bar when the model errors in the middle of a turn, instead of losing it and showing "?" (Status unavailable) until the tab moves to another thread.
What a user sees change
Runtime code — +16/−9 lines under
src/.How to see it in the shipped app — no easy way from the app: it needs Codex's connection to the model to drop mid-reply. When that happens to a Codex tab, its row keeps breathing while the terminal shows "Reconnecting...".
Confidence to ship as-is — high: the exact frames Codex sends (
errorwithwillRetry,systemError,turn/completed failed) were measured on the real codex-cli 0.169.0 app-server, and the unit test feeds those frames through the real observer and the real run-state.Hand-test before merging — no.
Why
CodexObservationread everyerrornotification and everysystemErrorthread status as "Koloft can no longer see this session" (observation: 'degraded'), which drops the row's run-state class. Both are only about one turn (CODEX§39, measured here):errorwithwillRetry: true;systemError,errorwithwillRetry: false, thenturn/completedfailed; the nextturn/startworks normally.Now
systemErrorcounts as a turn that ended (main thread and child agents), and anerrorthat does not saywillRetry: trueonly shows its message as a toast (as before), skipped for a tab being stopped. The degraded mark stays for what it means: a TUI that lost its connection, or a thread opener that failed.Each kind of tab
CodexObservation.What ran
codexObservation.test.ts(new case red first: 3 degraded events before the fix)npm run test:unit:changedtest/e2e/codex-session.spec.ts+test/e2e/remote-codex.spec.tsscripts/code-review.mjssystemErrorstayed unknown — fixed; round 2: toast for a stopping tab and anerrorwithoutwillRetry— fixedDid not run: the whole e2e suite (no change reaches other flows); the fake codex sends neither
errornorsystemError, so the new path is covered by the unit test, not e2e.Out of scope
systemErrorthat is not part of a failing turn (e.g. a thread that cannot load) now reads as waiting — inferred, not checked; no such case was seen.willRetry— not probed; anerrorwithout it is told, as before.