Skip to content

Conversation

@SamMorrowDrums
Copy link
Collaborator

Summary

Fixes #1897

Previously, generateInstructions() iterated over AvailableToolsets() which returns all toolsets that have tools defined, rather than only the enabled toolsets based on WithToolsets() configuration.

This caused instructions for all toolsets to be included regardless of which toolsets were actually enabled, leading to bloated instructions (e.g., 5886 chars vs 1226 chars when only 'repos' toolset is enabled).

Changes

  • Add EnabledToolsets() method to Inventory that returns only enabled toolset metadata
  • Update generateInstructions() to use EnabledToolsets() instead of AvailableToolsets()
  • Add regression test TestGenerateInstructionsOnlyEnabledToolsets

Testing

  • All existing tests pass
  • New regression test verifies that instructions only include enabled toolsets

Previously, generateInstructions() iterated over AvailableToolsets() which
returns all toolsets that have tools defined, rather than only the enabled
toolsets based on WithToolsets() configuration.

This caused instructions for all toolsets to be included regardless of which
toolsets were actually enabled, leading to bloated instructions (e.g., 5886
chars vs 1226 chars when only 'repos' toolset is enabled).

Changes:
- Add EnabledToolsets() method to return only enabled toolset metadata
- Update generateInstructions() to use EnabledToolsets()
- Add regression test for the fix

Fixes #1897
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner January 26, 2026 17:02
Copilot AI review requested due to automatic review settings January 26, 2026 17:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #1897 where generateInstructions() was including instructions from all available toolsets instead of only the enabled toolsets, leading to bloated instructions (5886 chars vs 1226 chars when only 'repos' toolset is enabled).

Changes:

  • Added EnabledToolsets() method to filter available toolsets by the enabledToolsets configuration
  • Updated generateInstructions() to use EnabledToolsets() instead of AvailableToolsets()
  • Added regression test TestGenerateInstructionsOnlyEnabledToolsets to verify the fix

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/inventory/registry.go Added EnabledToolsets() method that filters toolsets based on enabled configuration
pkg/inventory/instructions.go Changed to use EnabledToolsets() instead of AvailableToolsets()
pkg/inventory/instructions_test.go Added regression test and made existing test helper explicit about enabling all toolsets

Updates to v2.2.0 which includes server instructions diff support for
detecting issues like #1897.
@SamMorrowDrums SamMorrowDrums force-pushed the fix-instructions-enabled-toolsets branch from 981bf4f to e2adae1 Compare January 26, 2026 17:06
Add toolsets-context and toolsets-issues,context configurations to
improve test coverage for instruction generation with different
toolset combinations.
@SamMorrowDrums SamMorrowDrums merged commit b1a2b74 into main Jan 26, 2026
15 of 16 checks passed
@SamMorrowDrums SamMorrowDrums deleted the fix-instructions-enabled-toolsets branch January 26, 2026 17:27
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.

generateInstructions uses AvailableToolsets instead of EnabledToolsetIDs

5 participants