Skip to content

fix(service): find bundled KumoService helper from CLI in Contents/Helpers - #9

Open
tom-cat-mao wants to merge 1 commit into
ProjectKumo:mainfrom
tom-cat-mao:fix/cli-service-helper-lookup
Open

tom-cat-mao wants to merge 1 commit into
ProjectKumo:mainfrom
tom-cat-mao:fix/cli-service-helper-lookup

Conversation

@tom-cat-mao

Copy link
Copy Markdown

Summary

  • Fix kumo service install failing with "KumoService executable was not found" when invoked through the bundled CLI (Kumo.app/Contents/Helpers/kumo), even though the app ships the helper at Kumo.app/Contents/MacOS/KumoService.
  • Add the missing lookup candidate: from the CLI executable's directory, resolve the sibling Contents/MacOS/KumoService. It sits after the Bundle.main-derived candidates and before the working-directory fallbacks, so a bundled helper outranks stray files; existing candidates and order are unchanged.
  • Extract the candidate list into a pure, testable 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 than MacOS/ to avoid colliding with the case-insensitive Contents/MacOS/Kumo GUI binary (documented in docs/interfaces/cli-agent-control.md). In the CLI process Bundle.main does not resolve to Kumo.app, so all bundle-derived candidates pointed inside Contents/Helpers/ and the helper's real location one directory over was never searched. GUI installs worked because Bundle.main = Kumo.app. This PR keeps the documented layout and only extends the lookup accordingly.

Verification

  • swift build --target KumoCoreKit passes.
  • Candidate resolution verified at runtime for both layouts: CLI-in-Helpers now finds Contents/MacOS/KumoService ahead of working-directory fallbacks; GUI resolution keeps Contents/MacOS/KumoService first.
  • The new tests follow the repo's XCTest conventions but could not be executed locally: this environment has Command Line Tools only (no XCTest framework, and resource compilation requires Xcode's xcstringstool). Please run swift test --filter KumoServiceManagerTests on an Xcode-equipped machine.

…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.
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