Skip to content

Only install skills for clients detected on the system#4899

Open
samuv wants to merge 4 commits intomainfrom
skill-install-all-fix
Open

Only install skills for clients detected on the system#4899
samuv wants to merge 4 commits intomainfrom
skill-install-all-fix

Conversation

@samuv
Copy link
Copy Markdown
Contributor

@samuv samuv commented Apr 16, 2026

Summary

  • When thv skill install runs without --clients (or with --clients=all), skills were extracted to directories for every client with SupportsSkills: true in the static config (~20 clients), regardless of whether those clients are actually present on the system.
  • Add IsClientInstalled to ClientManager — uses the same os.Stat path check already present in GetClientStatus — and refactor GetClientStatus to call it.
  • Filter clientPathAdapter.ListSkillSupportingClients() to only return clients that pass IsClientInstalled, so the default install targets only the clients that exist on the machine.
  • Improve the error returned when no installed clients are detected to guide users toward --clients as an explicit override (also corrects the HTTP status from 500 to 400).

Type of change

  • Bug fix (non-breaking)

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)

Changes

File Change
pkg/client/discovery.go Add IsClientInstalled(clientType ClientApp) bool; refactor GetClientStatus to call it
pkg/client/discovery_test.go Add TestIsClientInstalled covering settings-file present, dir present, dir absent, and unregistered client
pkg/api/server.go Filter clientPathAdapter.ListSkillSupportingClients to installed clients only; log skipped clients at debug
pkg/skills/skillsvc/skillsvc.go Improve empty-clients error message and return 400 instead of 500

Does this introduce a user-facing change?

Yes — thv skill install <skill> no longer writes to directories for clients that aren't installed. Users with no detected clients get a clear error message suggesting --clients as an override. Explicit --clients=<name> continues to work regardless of detection.

@samuv samuv self-assigned this Apr 16, 2026
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Apr 16, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.25%. Comparing base (3c5ac7e) to head (9649782).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/server.go 0.00% 6 Missing ⚠️
pkg/skills/skillsvc/skillsvc.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4899      +/-   ##
==========================================
+ Coverage   69.21%   69.25%   +0.03%     
==========================================
  Files         533      533              
  Lines       55257    55266       +9     
==========================================
+ Hits        38246    38272      +26     
+ Misses      14068    14052      -16     
+ Partials     2943     2942       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant