Skip to content

fix: preserve relative paths in Codex configuration - #887

Merged
alphaxiv-bot[bot] merged 2 commits into
mainfrom
clo/codex-config-mirror
Nov 4, 2026
Merged

alphaxiv-bot[bot] merged 2 commits into
mainfrom
clo/codex-config-mirror

Conversation

@small-angel

Copy link
Copy Markdown
Contributor

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

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
@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Every prompt rereads shared files ▶
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.

Summary

Codex now shares native home entries by default, except known runtime state, so relative configuration files remain available.

  • Codex config files stay available in isolated chats.

Reviews (1) · Last reviewed commit: "fix: preserve relative paths in Codex co..." · Reviewed by Greptile

Comment thread src/local/codex.rs
Comment on lines +882 to +885
let codex_home =
tokio::task::spawn_blocking(move || native_store::prepare_codex(native_store))
.await
.map_err(|error| anyhow!("Codex config preparation failed: {error}"))??;

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!

@small-angel small-angel added the auto-merge Queue for automatic merge once all checks pass label Nov 4, 2026
@alphaxiv-bot
alphaxiv-bot Bot merged commit 21acf03 into main Nov 4, 2026
12 checks passed
@alphaxiv-bot
alphaxiv-bot Bot deleted the clo/codex-config-mirror branch November 4, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Queue for automatic merge once all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

与magpie的兼容性问题

1 participant