Changes in This Fork
July 19, 2026 · View on GitHub
This file captures the fork-specific behavior reapplied on top of the current upstream tag.
TUI composer draft clipboard shortcut
- Added
Ctrl+Shift+Cin the TUI composer to copy the current draft to the system clipboard when the input contains text. - Existing
Ctrl+Cbehavior stays unchanged. - When the composer has no copyable text,
Ctrl+Shift+Cfalls back to the existingCtrl+Cclear/interrupt/quit path. - On WSL2, composer draft copy reuses the existing Windows clipboard fallback so copies still land in the Windows system clipboard.
Ctrl+Shift+Cnow takes its own composer-copy path instead of falling through to the existingCtrl+Cclear/interrupt/quit behavior when draft text is present.- Added footer shortcut help text for the new draft-copy binding.
TUI status header and polling
Implementation must follow the status-header skill .agents/skills/status-header/SKILL.md
- Added a status header above the composer in the app-server-backed
codex-rs/tuisurface. Segment order is fixed as model + reasoning effort, current directory, git branch/ahead/behind/changes, rate-limit remaining/reset time, then account identity. - Status header account identity is the last segment without an icon: ChatGPT accounts render as
user@example.com(Pro)and API-key auth renders asAPI key. - Status header layout no longer adds its own top inset; it uses
Insets::tlbr(/*top*/ 0, …, /*bottom*/ 1, …)and relies on the existing outer bottom-section gap above it so the spacing betweenWorkingand the header stays compact. - Git status is collected in the background (15s interval, 2s timeout) and rendered when available.
- The directory segment represents the session/thread
cwd, not a one-off toolworkdir. - When the session
cwdchanges (for example after switching into a new worktree), the git-status poller now rebinds to that newcwd, clears stale git state, and ignores late results from the previouscwd. - ChatGPT
5h/ weekly usage-limit snapshots in the TUI now refresh in the background every 15 seconds, so the header and any/statuslinelimit items keep moving while the UI is otherwise idle.
TUI auth.json watcher
- The running TUI now watches
CODEX_HOME/auth.jsonand reloads auth when the file changes. - Watch notifications are now trailing-debounced so reload happens after writes settle, reducing partial-file reads.
- If
auth.jsonchanges while the TUI still has an active task/turn running, auth reload is deferred until that work fully finishes; Codex does not hot-swap auth in the middle of the running task. - Auth reload failures no longer clear cached auth (so transient parse/read errors do not appear as a logout).
- On auth reload failure, the TUI retries every 5 seconds for up to 3 attempts before surfacing a final warning.
- When the account identity changes, the TUI surfaces a warning in the transcript (including old/new emails when available).
- Auth change warnings now show the account plan type (e.g., Plus/Team/Free/Pro) instead of the generic ChatGPT label.
- Rate-limit state and polling are refreshed after auth changes so the header reflects the new account.
- That post-task auth refresh also resets cached rate-limit warning/prompt state for the new auth snapshot, so stale usage-limit/UI state from the previous auth context does not keep re-triggering after the reload.
- The TUI now supports
[tui].usage_limit_resume_promptfor the synthetic recovery user turn sent afterUsageLimitExceeded. If the field is unset, Codext uses the built-in default recovery prompt; if the field is set to an empty string, Codext disables the automatic recovery turn. - When a turn hits
UsageLimitExceeded, the TUI now queues that synthetic recovery turn ahead of other queued user input. If anauth.jsonreload is also pending, the reload still runs first, and only then does Codext submit the recovery turn before draining later queued inputs. - After a turn stops on
UsageLimitExceeded, Codext now keeps that synthetic recovery turn parked until the nextauth.jsonreload that actually changes account identity, so switching accounts can continue the interrupted task without a manual resend. - If the user manually submits a new message before that auth reload arrives, Codext clears the parked usage-limit recovery turn instead of replaying the stale synthetic prompt later.
TUI queued messages after usage-limit exhaustion
- When a turn ends because quota/rate limit is exhausted, Codext pauses queued-message autosend instead of draining already queued Tab follow-ups into more failed turns.
- While autosend is paused, pressing Tab still queues new messages even when no turn is currently running.
- When a later Codex rate-limit snapshot shows quota available again, Codext resumes autosend and submits exactly the first queued user message; any additional queued messages remain queued for normal FIFO draining after that turn completes.
- If both a parked usage-limit recovery prompt and user-queued follow-ups exist when quota recovers, the user-queued follow-up wins and the stale synthetic recovery prompt is cleared.
App-server auth.json account switching
- The app-server now reloads auth from storage before
thread/start,thread/resume, andturn/startwhen no turn is running. - This change supports Codex App account switching through Loongphy/codex-auth#103, allowing the app-server to pick up the newly selected account at the next safe request boundary.
- Auth is still not hot-swapped in the middle of an active turn; reload is skipped while
running_turn_countis nonzero and the next request boundary gets the new auth. - ChatGPT account/workspace switches inside the same auth mode are treated as auth changes by comparing the refresh-relevant auth snapshot, not only the top-level auth mode.
- When a reload changes auth, loaded threads invalidate their cached model transport state so a reused WebSocket session created under the previous account is not used for the next turn.
- The app-server also refreshes cloud requirements/default residency state and emits
AccountUpdatedafter a changed reload so app UI account state follows the new snapshot. - Reapply notes: keep
reload_auth_from_storage_if_idlewired into all three request entry points, preserve the idle guard, and preserve the invalidation chainThreadManager::invalidate_model_transport_caches->CodexThread::invalidate_model_transport_cache->ModelClient::invalidate_cached_transport_state. - Reapply validation for this branch follows the temporary guardrails in
AGENTS.md: do not run tests; validate withcd codex-rs && cargo build -p codex-cli.
TUI exit resume command
- Added a fork requirement that user-facing resume hints use
codext resume <session>/codext resume <thread-name>instead ofcodex resume .... - This includes the final resume hint shown after exiting the TUI and other resume guidance surfaced inside the TUI.
Release artifact parity
- Release builds and npm platform packages ship
codex-code-mode-hostbeside thecodextCLI binary so code mode can start from installed and locally packaged artifacts. - The upstream release matrix is audited during reapply instead of assuming that copying the previous fork workflow preserves all companion binaries.