Skip to content

invalidate cache when the expected binary is missing#268

Merged
eirikb merged 1 commit into
mainfrom
feature/eirikb/cache-invalidate-missing-bin
Jun 15, 2026
Merged

invalidate cache when the expected binary is missing#268
eirikb merged 1 commit into
mainfrom
feature/eirikb/cache-invalidate-missing-bin

Conversation

@eirikb

@eirikb eirikb commented Jun 15, 2026

Copy link
Copy Markdown
Owner

A populated cache dir was treated as a hit on install_dir.exists() alone, without checking the executor's binary was actually there. When a tool's backing executor changes between gg versions (e.g. codex moving from a GitHub release to the @openai/codex npm package), the old dir lingered and prep returned a hit that then failed at run time with "Unable to find executable", until the user manually cleared the cache.

prep now verifies the expected bin resolves under the cache's own search paths (not $PATH) before accepting a hit; if it doesn't, the stale dir is removed and a fresh download runs. The resolution logic is factored out of try_run into a shared resolve_bin_path so the cache check and the run path stay in lock-step.

A populated cache dir was treated as a hit on install_dir.exists() alone,
without checking the executor's binary was actually there. When a tool's
backing executor changes between gg versions (e.g. codex moving from a
GitHub release to the @openai/codex npm package), the old dir lingered and
prep returned a hit that then failed at run time with "Unable to find
executable", until the user manually cleared the cache.

prep now verifies the expected bin resolves under the cache's own search
paths (not $PATH) before accepting a hit; if it doesn't, the stale dir is
removed and a fresh download runs. The resolution logic is factored out of
try_run into a shared resolve_bin_path so the cache check and the run path
stay in lock-step.
@eirikb eirikb enabled auto-merge (squash) June 15, 2026 20:42
@eirikb eirikb merged commit c2d92f1 into main Jun 15, 2026
166 checks passed
@eirikb eirikb deleted the feature/eirikb/cache-invalidate-missing-bin branch June 15, 2026 20:55
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.

1 participant