[Feature] Add a selectable Codex app-server runtime
Is your feature request related to a problem? Please describe.
CloudCLI currently runs regular Codex chat turns through @openai/codex-sdk. The app-server integration introduced for Codex thread forking and message editing is started separately for those operations.
This means CloudCLI cannot use one managed app-server process for normal chat streaming, thread history, fork/edit operations, and interactive permission requests. Users also cannot choose between the app-server protocol and the existing SDK runtime.
A long-lived app-server needs an explicit restart mechanism so changes to ~/.codex/config.toml or ~/.codex/auth.json can be loaded without restarting the entire CloudCLI server. It should also remain lazy rather than being started by background session indexing before a user performs a Codex operation.
Describe the solution you would like
Add a supervised Codex app-server runtime and make the Codex runtime selectable in Settings:
- Codex app-server
- Codex SDK
The app-server runtime should:
- keep one initialized process for Codex conversations and thread operations;
- start lazily only when app-server chat or history, fork/edit, or a manual restart needs it;
- keep background session indexing file-backed so startup synchronization does not launch app-server;
- translate app-server events into the existing normalized chat events;
- bridge command and file-change approval requests into the existing permission UI;
- reuse the managed process for history, forking, and message editing;
- provide a restart action for reloading Codex configuration and authentication;
- refuse a manual restart while an app-server turn is active.
The selected runtime should fail explicitly rather than silently retrying through the other implementation. The SDK runtime should remain available for compatibility.
Source: siteboon/claudecodeui