Repository navigation
fix: preserve relative paths in Codex configuration - #887
Conversation
Share configuration assets from the native Codex home while keeping session and runtime state isolated. Refresh links before each turn so provider changes also reach existing chats. Closes #866 Assisted-by: gpt-6.1-sol
[Medium impact] The changes reach isolated Codex chats and shared native-home link handling. The PR appears safe to merge, with a non-blocking concern about rereading shared files before every prompt. Findings
Fix with agent prompt### Issue 1
src/local/codex.rs:882-885
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.
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!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryCodex now shares native home entries by default, except known runtime state, so relative configuration files remain available.
Reviews (1) · Last reviewed commit: "fix: preserve relative paths in Codex co..." · Reviewed by Greptile |
| let codex_home = | ||
| tokio::task::spawn_blocking(move || native_store::prepare_codex(native_store)) | ||
| .await | ||
| .map_err(|error| anyhow!("Codex config preparation failed: {error}"))??; |
There was a problem hiding this 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.
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!
Codex could fail to load settings when a relative path pointed to a model catalog or another file that OpenResearch did not link into its isolated home. Share native home entries except known runtime state, preserving relative paths and refreshing links before each turn, including in running chats.
Closes #866
Assisted-by: gpt-6.1-sol