Skip to content

fix: Normalize TMPDIR paths in wrapper#6

Merged
kuitos merged 2 commits into
mainfrom
codex/normalize-tmpdir-paths
Apr 1, 2026
Merged

fix: Normalize TMPDIR paths in wrapper#6
kuitos merged 2 commits into
mainfrom
codex/normalize-tmpdir-paths

Conversation

@kuitos
Copy link
Copy Markdown
Owner

@kuitos kuitos commented Apr 1, 2026

Summary

Fix the wrapper's temporary path handling so macOS-style TMPDIR values that end with / do not produce log and lock paths with doubled separators.

Root Cause

The wrapper composed LOCK_DIR and LOG_DIR with ${TMPDIR:-/tmp}/.... On macOS, TMPDIR usually already ends with /, so the resulting paths were rendered as .../T//opencode-memory-logs/....

Changes

  • normalize the temp base directory once before building lock and log paths
  • reuse the normalized temp base for both lock and log directories
  • add a regression test that runs the wrapper against a fake opencode binary with a trailing-slash TMPDIR

Impact

Paths are now rendered cleanly in logs and internal lock/log file locations are consistent regardless of whether TMPDIR ends with /.

Validation

  • bun test

@kuitos kuitos changed the title [codex] Normalize TMPDIR paths in wrapper fix: Normalize TMPDIR paths in wrapper Apr 1, 2026
@kuitos kuitos marked this pull request as ready for review April 1, 2026 09:45
@kuitos kuitos merged commit aede372 into main Apr 1, 2026
1 check passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

🎉 This PR is included in version 1.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant