fix(service): find bundled KumoService helper from CLI in Contents/Helpers - #9
Open
tom-cat-mao wants to merge 1 commit into
Open
tom-cat-mao wants to merge 1 commit into
tom-cat-mao wants to merge 1 commit into
Conversation
…lpers Bundle.main does not resolve to Kumo.app for the unbundled CLI at Kumo.app/Contents/Helpers/kumo, so the helper at Contents/MacOS/KumoService was never a candidate and `kumo service install` failed. Compute the candidate list in a pure, testable helper that also covers the Helpers -> MacOS sibling layout, keeping the bundled helper ahead of working-directory fallbacks. Add KumoServiceManagerTests covering CLI-in-Helpers resolution and the unchanged GUI-first ordering.
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.
Summary
kumo service installfailing with "KumoService executable was not found" when invoked through the bundled CLI (Kumo.app/Contents/Helpers/kumo), even though the app ships the helper atKumo.app/Contents/MacOS/KumoService.Contents/MacOS/KumoService. It sits after theBundle.main-derived candidates and before the working-directory fallbacks, so a bundled helper outranks stray files; existing candidates and order are unchanged.helperExecutableCandidates(bundleURL:executableURL:workingDirectory:installedHelperURL:)and add two XCTest cases covering CLI-style and GUI-style resolution.Root cause
The CLI ships in
Contents/Helpers/rather thanMacOS/to avoid colliding with the case-insensitiveContents/MacOS/KumoGUI binary (documented indocs/interfaces/cli-agent-control.md). In the CLI processBundle.maindoes not resolve toKumo.app, so all bundle-derived candidates pointed insideContents/Helpers/and the helper's real location one directory over was never searched. GUI installs worked becauseBundle.main=Kumo.app. This PR keeps the documented layout and only extends the lookup accordingly.Verification
swift build --target KumoCoreKitpasses.Helpersnow findsContents/MacOS/KumoServiceahead of working-directory fallbacks; GUI resolution keepsContents/MacOS/KumoServicefirst.xcstringstool). Please runswift test --filter KumoServiceManagerTestson an Xcode-equipped machine.