fix: fail loudly when Copilot agent files are not created#3
Open
Lucas-Frazao wants to merge 1 commit into
Open
fix: fail loudly when Copilot agent files are not created#3Lucas-Frazao wants to merge 1 commit into
Lucas-Frazao wants to merge 1 commit into
Conversation
Previously, CopilotIntegration.setup() silently returned an empty list when command templates could not be located (e.g. due to install path resolution issues). This meant 'hsdd init' could report success while .github/agents/ was never created, leaving /hsdd.* commands invisible in Copilot Chat. Changes: - CopilotIntegration.setup() now raises FileNotFoundError when no command templates are found, with diagnostic paths in the message. - 'hsdd init' catches the error, reports it clearly, and exits non-zero. - 'hsdd init' also post-validates that .agent.md files actually exist on disk after setup() returns. - 'hsdd integrate' gets the same error handling. - 'hsdd check' now reads init-options.json and flags missing agents as an error (not a skip) when ai_assistant is 'copilot'. - Adds 9 tests covering the Copilot integration setup path. Fixes: silent Copilot integration failure during init
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.
Problem
hsdd initcould complete successfully while the.github/agents/directory was never created. This happened becauseCopilotIntegration.setup()silently returned an empty list when it couldn't locate command templates (e.g. due to install path resolution differences between dev/wheel installs, Windows path quirks, or venv isolation).The result: users run
hsdd init, see success, open VS Code, type/hsdd.constitution— and nothing shows up.Root Cause
_locate_commands_dir()checks two hardcoded paths:core_pack/commands/(wheel install)../../templates/commands/relative to__file__(dev install)If neither resolves — which can happen with editable installs, symlinked venvs, or certain Windows configurations —
list_command_templates()returns[], andsetup()returns[]without any warning.Changes
CopilotIntegration.setup()FileNotFoundErrorwhen no command templates are found, with diagnostic info showing which paths were searched.hsdd initFileNotFoundErrorfrom the integration, shows a clear error with remediation steps (hsdd integrate copilot), and exits non-zero..agent.mdfiles actually exist on disk aftersetup()returns (defense in depth).hsdd integrateinit.hsdd checkinit-options.jsonto determine the configured AI assistant.ai_assistantiscopilotbut.github/agents/is missing, flags it as an error (not a skip) with a remediation message.Tests
copilot-instructions.mdcreatedAll 55 tests pass.