Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions arc/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ a message sent during a turn waits in the chat's queue.
An agent runs in the chat's worktree with a configuration home orx prepares
inside its data directory. The user's sign-in, settings, instructions, plugins
and skills are linked into that home, so the agent behaves as the user set it
up, while its sessions and history stay out of the user's own. **orx never
edits the user's agent configuration.** What it needs to add, such as hooks,
an MCP server or sandbox roots, goes in through the agent's command line or a
settings file of orx's own.
up, while its sessions and history stay out of the user's own. Codex shares
home entries by default so relative configuration paths keep working; known
session stores, databases, memories and runtime state are excluded. The links
are reconciled before each turn, including when reusing a running Codex
process. **orx never edits the user's agent configuration.** What it needs to
add, such as hooks, an MCP server or sandbox roots, goes in through the agent's
command line or a settings file of orx's own.

Chats the user had in an agent's own CLI can be adopted. Those keep resolving
to the user's native store, and orx copies recent history only for display.
Expand Down
8 changes: 4 additions & 4 deletions src/local/codex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,14 +879,14 @@ impl CodexHost {
session_id: &str,
native_store: NativeStore,
) -> Result<Arc<CodexClient>> {
let codex_home =
tokio::task::spawn_blocking(move || native_store::prepare_codex(native_store))
.await
.map_err(|error| anyhow!("Codex config preparation failed: {error}"))??;
Comment on lines +882 to +885

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Every prompt rereads shared files

Each turn now runs prepare_codex before reusing the child. Even unchanged symlinks call write_marker, which reads every shared top-level regular file in full through file_hash.

If the Codex home contains large catalogs or other custom assets, every prompt pays that disk and memory cost. These reads also hold LINK_LOCK, making other chats and providers wait. Cache unchanged hashes or avoid reading file contents when refreshing unchanged symlinks.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/local/codex.rs
Line: 882-885

Comment:
**Every prompt rereads shared files**

Each turn now runs `prepare_codex` before reusing the child. Even unchanged symlinks call `write_marker`, which reads every shared top-level regular file in full through `file_hash`.

If the Codex home contains large catalogs or other custom assets, every prompt pays that disk and memory cost. These reads also hold `LINK_LOCK`, making other chats and providers wait. Cache unchanged hashes or avoid reading file contents when refreshing unchanged symlinks.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

let host = self.clone();
let session = session_id.to_string();
self.ensure_with_spawn(session_id, native_store, async move {
let bin = find_codex_required()?;
let codex_home =
tokio::task::spawn_blocking(move || native_store::prepare_codex(native_store))
.await
.map_err(|error| anyhow!("Codex config preparation failed: {error}"))??;
Ok(move || {
spawn_client(
&session,
Expand Down
Loading
Loading