Ideas from a remote Codex helper prototype: faster long-session history, durable queue, and MCP process reuse #22987
Replies: 2 comments 1 reply
|
Adding screenshots for visual context. Community thread with additional discussion: The screenshots show:
|
1I think you should try managing better your threads and contexts, I think reaching 500 MB is a lot. How is your workflow? Also I would try to use lazy loading technique to not load the entire file at one time in the chat app. 2I think codex doesn't have natively a prompt queue feature in the codex app server. It is usually managed in the client side. Maybe using sqlite is a good approach to persist. But usually, if your app close/restart the connection with the codex app server will be closed as well and thread may be interrupted, as it happens if you close a running thread in the IDE Extension or CLI for example. And if you go back, depending on how you configured the trigger, your queued prompt can be sent automatically after the last interrupted turn. So the queue feature usually is your customized approach. |






Uh oh!
There was an error while loading. Please reload this page.
Hi Codex team,
First of all, thank you for the work on Codex. I use it heavily every day, and it has become one of my main development tools.
Recently I built a personal web interface for working remotely with Codex running on my home PC from other devices, such as a laptop or phone. A few days later, OpenAI shipped a very similar remote-work direction, which was exciting to see.
While building and using my prototype, I ran into a few practical issues with the native Codex app and experimented with possible fixes/workarounds.
1. Large session history files can make the app freeze
For long-running conversations, Codex rollout/history JSONL files can grow to hundreds of MB. I have several sessions that are 500 MB or larger. When working with those conversations, the Codex app can freeze for a noticeable amount of time, especially when sending a new prompt.
I think this could be improved either by changing how Codex stores session history, or, if the current JSONL format needs to stay for compatibility/legacy/architecture reasons, by reading the existing files more efficiently.
In my prototype I tested the second approach:
This made the remote UI stay responsive even with very large session files.
2. Durable queued and delayed messages
As far as I understand, the Codex app already has a queue, but in my implementation queued messages are stored in SQLite. That means they are not lost if the app/helper is closed or restarted.
When the current task finishes, saved messages are sent automatically. I also implemented time-based delayed tasks using the same queue storage/processing model.
3. Duplicate MCP server processes
One issue I noticed but have not solved yet is MCP server duplication. It looks like Codex starts separate MCP server instances for different conversations, even when they are the same servers with the same configuration.
On my home PC, I recently had 14 instances each of four MCP servers, around 56 processes total. I also saw a similar pattern on my MacBook: multiple instances of
serena,context7,node_repl, andcodex app-server --listen stdio://, started in groups as I worked with different sessions.This is not necessarily critical by itself, but during long-running work it creates extra memory and process overhead. Maybe this could be improved with a shared MCP runtime, reuse of already-running servers across conversations, or more aggressive cleanup of inactive MCP processes.
Other remote-work pieces in the prototype
The prototype also includes:
I built this primarily for myself, because I use Codex intensively and wanted to remove friction from long working sessions. If any of these ideas overlap with what the Codex team is thinking about, I would be happy to share more implementation details, show a demo, or discuss possible collaboration.
Thanks again for building Codex.
All reactions