fix: three stability fixes for rollout pruning, CDP outages, and new-session binding - #1
Open
tsubasakong wants to merge 4 commits into
Open
fix: three stability fixes for rollout pruning, CDP outages, and new-session binding#1tsubasakong wants to merge 4 commits into
tsubasakong wants to merge 4 commits into
Conversation
Codex prunes old rollout JSONL files; a file deleted after discovery but before metadata/appended reads crashed the injector with ENOENT. Skip missing files instead of failing.
A temporary CDP outage killed the injector and froze the overlay. Keep polling, re-verify the listener, and re-attach when CDP returns; log errors at most once per minute.
New sessions show an optimistic sidebar id (local:client-new-thread:<uuid>) until Codex assigns the real id. Resolve the real conversation id from the main content area so the meter can bind immediately; fail closed when no real id is available.
A CDP call that never settles (for example after a renderer WebSocket silently dies) could drain the event loop: the call timeout timer was unref'd, so Node exited with code 13 and an unsettled top-level await, freezing the overlay. Keep the timeout timer ref'd, refuse calls on non-open sockets, and exit 130 when stopped by a signal so launchers can distinguish a clean stop from an unexpected crash.
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.
Summary
Three independent stability fixes for the Codex Desktop injector, split into
separate commits so each can be reviewed or reverted on its own.
1.
fix: tolerate rollout files removed between discovery and readafter discovery but before the metadata/appended read, the injector crashed
with an unhandled
ENOENT, killing the meter and leaving a frozen overlay.the underlying range read treats a vanished file as an empty read.
2.
fix: survive transient CDP unavailabilityinjector, freezing the injected overlay until manual restart.
loopback listener when CDP returns, re-attaches to verified renderers, and
logs errors at most once per minute instead of dying.
3.
fix: bind new Codex sessions by real conversation id(
local:client-new-thread:<uuid>) until the real session id exists. Thesession probe only accepted plain UUIDs, so brand-new sessions stayed
UNBOUNDeven though their rollout data was being written.resolves the real conversation id from the main content area
(
data-response-annotation-conversation/data-above-composer-conversation-id). Binding still fails closed when noreal id is available.
case.
Testing
npm test: 27/27 pass (3 new regression tests).npm run check: pass.26.730.61309(macOS 26.3): a new sessionbinds to its real conversation id, token totals advance, and the meter
re-attaches after a transient CDP interruption.
Security implications
existing bundle/signature/listener verifier.
UNBOUND) and are neverguessed from file recency.
prompt, reasoning, tool, or assistant content.