Skip to content

fix: expose Codex diff snapshot directories#699

Merged
wesm merged 1 commit intomainfrom
fix-codex-snapshot-add-dir
May 7, 2026
Merged

fix: expose Codex diff snapshot directories#699
wesm merged 1 commit intomainfrom
fix-codex-snapshot-add-dir

Conversation

@mariusvniekerk
Copy link
Copy Markdown
Collaborator

@mariusvniekerk mariusvniekerk commented May 6, 2026

Summary

  • write large diff snapshots inside per-snapshot roborev temp subdirectories
  • pass the snapshot directory to Codex with --add-dir instead of exposing all of /tmp
  • ignore snapshot-looking prompt paths unless they are existing files inside a private roborev snapshot directory

Large diff reviews can hand Codex a filesystem path instead of inlining the whole diff, but Codex runs with the repository as its sandbox root. When the snapshot lived directly in the system temp directory, Codex could fail to read it unless the whole temp directory was exposed.

Write each external diff snapshot into its own roborev temp subdirectory and pass that exact directory to Codex with --add-dir. This keeps the non-agentic read-only sandbox while avoiding broad access to all of /tmp.

Validation: go fmt ./...; go vet ./...; go test ./...

🤖 Generated with [OpenAI Codex](https://openai.com/codex)
Co-authored-by: OpenAI Codex <noreply@openai.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 6, 2026

roborev: Combined Review (5253314)

No Medium, High, or Critical findings were reported.

All reviewed agents found the change acceptable; only a Low-severity path-joining style issue was noted, so it is omitted per the review threshold.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 63.15789% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/agent/codex.go 66.66% 5 Missing and 5 partials ⚠️
internal/prompt/prompt.go 50.00% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@wesm wesm merged commit aa11a7e into main May 7, 2026
8 checks passed
@wesm wesm deleted the fix-codex-snapshot-add-dir branch May 7, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants