Problem
The background auto-upgrade mechanism fails silently on systems where /tmp is
mounted with noexec or has restricted write permissions (common in corporate
and hardened Linux/macOS environments).
In run_install_script (Unix path), the install script is written to
std::env::temp_dir() (typically /tmp) before execution. If this write fails
due to permissions, the background process calls process::exit(1) with all
output suppressed (stdout/stderr → /dev/null), so the user sees nothing and
the auto-update silently stops working.
Steps to reproduce
- Mount
/tmp as noexec: mount -o remount,noexec /tmp
- Run any git command (which triggers
maybe_schedule_background_update_check)
- Observe: no update is applied, no error is shown
Expected behavior
The upgrade should use a directory that git-ai already owns and has guaranteed
write access to (e.g., ~/.git-ai/tmp/), rather than relying on /tmp.
Proposed fix
Replace std::env::temp_dir() with ~/.config/git-ai/tmp/ (or platform
equivalent), creating the directory if needed, with fallback to temp_dir() if
the home path is unavailable.
Problem
The background auto-upgrade mechanism fails silently on systems where
/tmpismounted with
noexecor has restricted write permissions (common in corporateand hardened Linux/macOS environments).
In
run_install_script(Unix path), the install script is written tostd::env::temp_dir()(typically/tmp) before execution. If this write failsdue to permissions, the background process calls
process::exit(1)with alloutput suppressed (
stdout/stderr → /dev/null), so the user sees nothing andthe auto-update silently stops working.
Steps to reproduce
/tmpasnoexec:mount -o remount,noexec /tmpmaybe_schedule_background_update_check)Expected behavior
The upgrade should use a directory that git-ai already owns and has guaranteed
write access to (e.g.,
~/.git-ai/tmp/), rather than relying on/tmp.Proposed fix
Replace
std::env::temp_dir()with~/.config/git-ai/tmp/(or platformequivalent), creating the directory if needed, with fallback to
temp_dir()ifthe home path is unavailable.