fix: improve Codex Desktop rollout discovery#130
Merged
Conversation
graykode
approved these changes
May 29, 2026
graykode
left a comment
Owner
There was a problem hiding this comment.
lgtm — security looks clean; this stays within local Codex Desktop rollout discovery and adds no new network, dependency, or workflow surface. I checked the async scanner state flow and Unknown session handling, and the added tests cover the main ownership/fallback cases. Verified with cargo test, cargo clippy --all-targets -- -D warnings, and cargo build.
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
This PR fixes UI stalls when many Codex Desktop
app-serverprocesses are running.Previously, Codex Desktop rollout discovery could call
lsof -F pn -p...synchronously on the TUI refresh path. On macOS, that command can take tens of seconds when many Desktop threads/processes are open, which makes startup, refresh, panel switching, and keyboard interaction feel frozen.Changes
lsofworker.SharedProcessData.desktop_rollout_fd_map.map_pid_to_jsonl()still follows the existing synchronous CLI path.Unknownsession status for recent Desktop sessions whose rollout file is visible but PID ownership is not yet confirmed.Why
Codex Desktop can keep many rollout files and process fds around. Blocking the main TUI thread on
lsofmakes the app appear broken or unresponsive. The new path lets the UI render immediately using filesystem-discovered active rollouts, while fd ownership is filled in asynchronously when available.Validation
cargo testcargo buildcargo build --release/Users/yanxin/GitHub/abtop/target/distrib/abtop-codex-desktop-fixRisk
Low to moderate.
The change is scoped to Codex Desktop/app-server rollout discovery. Regular Codex CLI, Claude, OpenCode, ports, git stats, and MCP panel behavior are intentionally left mostly unchanged. The main tradeoff is that some Desktop sessions may briefly show
Unknownuntil the background fd scan confirms ownership.