fix(probe): correct command-default-location flag, owner-only probe umask, robust binary resolution - #4
Merged
Conversation
…mask, robust binary resolution Three independent defects in install-cli's stage version probe and binary resolution, all blocking install-cli on the pinned 2470.4 release: 1. The probe passed --command-default-locations (plural), which Junie's CLI does not accept. The supported flag is --command-default-location (singular) for commands, while config/mcp/skill/model stay plural. The probe and the launch flag builder both used the plural form, so the probe exited non-zero with 'no such option --command-default-locations'. 2. Junie is a JVM app that writes runtime state (~/.junie) under the isolated probe HOME. Under an ambient umask (e.g. 022) that state is not private, and require_private_directory rejected it. Run the probe under an owner-only umask (0o077) via preexec_fn so anything Junie creates is already private. 3. resolve_junie_binary only caught FileNotFoundError when probing candidate paths. When versions/<v>/junie is the launcher script (a regular file), lstat on versions/<v>/junie/bin/junie raises NotADirectoryError, which escaped the loop and crashed install-cli. Catch NotADirectoryError too so the next candidate (the launcher itself) is tried.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
install-clifailed on the pinned 2470.4 release with:Root cause — three independent defects
Wrong CLI flag form. The probe and launch flag builder used
--command-default-locations(plural), but Junie accepts--command-default-location(singular) for commands (config/mcp/skill/model stay plural). Verified againstjunie --helpon 2470.4.Probe runtime state not private. Junie is a JVM app that writes
~/.junieunder the isolated probe HOME. Under an ambient umask that state is not private andrequire_private_directoryrejected it.resolve_junie_binarynot robust. Whenversions/<v>/junieis the launcher script (a regular file),lstatonversions/<v>/junie/bin/junieraisesNotADirectoryError, which escaped the candidate loop (it only caughtFileNotFoundError).Fix
--command-default-location(singular) in the probe and the launch flag builder.0o077) viapreexec_fn.NotADirectoryErrorin the candidate loop so the launcher-script candidate is tried.Verification