Fix generateInstructions to use only enabled toolsets#1898
Merged
SamMorrowDrums merged 3 commits intomainfrom Jan 26, 2026
Merged
Fix generateInstructions to use only enabled toolsets#1898SamMorrowDrums merged 3 commits intomainfrom
SamMorrowDrums merged 3 commits intomainfrom
Conversation
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
Contributor
There was a problem hiding this comment.
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 theenabledToolsetsconfiguration - Updated
generateInstructions()to useEnabledToolsets()instead ofAvailableToolsets() - Added regression test
TestGenerateInstructionsOnlyEnabledToolsetsto 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.
981bf4f to
e2adae1
Compare
Add toolsets-context and toolsets-issues,context configurations to improve test coverage for instruction generation with different toolset combinations.
mattdholloway
approved these changes
Jan 26, 2026
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
Fixes #1897
Previously,
generateInstructions()iterated overAvailableToolsets()which returns all toolsets that have tools defined, rather than only the enabled toolsets based onWithToolsets()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
EnabledToolsets()method toInventorythat returns only enabled toolset metadatagenerateInstructions()to useEnabledToolsets()instead ofAvailableToolsets()TestGenerateInstructionsOnlyEnabledToolsetsTesting