Add cli_executable property to IntegrationBase for agents whose executable differs from their key#3748
Open
dhruv-15-03 wants to merge 1 commit into
Open
Conversation
…table differs from their key Closes github#2558. - Add cli_executable property and is_cli_available() method to IntegrationBase. cli_executable delegates to the existing _resolve_executable() hook (key, or SPECKIT_INTEGRATION_<KEY>_EXECUTABLE override); is_cli_available() defaults to shutil.which(cli_executable). - Refactor check_tool() in _utils.py to delegate to get_integration(tool).is_cli_available() when the tool is a registered integration, removing the hardcoded claude/kiro-cli/rovodev special cases. Falls back to a plain shutil.which(tool) for unregistered tools (git, code, etc). - Override is_cli_available() in ClaudeIntegration (checks local install paths before falling back to PATH) and KiroCliIntegration (accepts both kiro-cli and legacy kiro binary names). RovoDev needs no change: its existing _resolve_executable() override already returns �cli, so cli_executable picks it up automatically. - Scope note: the two workflow-step CLI-dispatch sites (workflows/steps/command, workflows/steps/prompt) are intentionally left unchanged in this PR. They already handle differing executables via an existing impl.key / exec_args[0] fallback, and tests/test_workflows.py has 15+ test cases patching shutil.which at those specific module paths; migrating them to is_cli_available() is deferred to a fast-follow to avoid unrelated test churn here. - Document the new override mechanism in AGENTS.md, with the pitfall fully explained (RovoDev's key=rovodev vs executable=acli). - Add TestCliExecutableDetection to tests/integrations/test_base.py covering default resolution, env-var override, and is_cli_available() true/false paths. All 9 existing tests/test_check_tool.py cases and 160+ integration tests pass unmodified. Assisted-by: GitHub Copilot (model: claude-sonnet-5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
Adds a
cli_executableproperty +is_cli_available()method toIntegrationBaseso integrations whose runtime executable differs from theirkey(e.g. RovoDev:key=rovodev, executableacli) have a documented, non-hacky extension point, instead of requiring hardcoded special cases incheck_tool().Closes #2558.
Changes
integrations/base.py: newcli_executableproperty (delegates to the existing_resolve_executable()hook - honorsself.keyand theSPECKIT_INTEGRATION_<KEY>_EXECUTABLEenv override) andis_cli_available()method (default:shutil.which(self.cli_executable) is not None)._utils.py:check_tool()now delegates toget_integration(tool).is_cli_available()(lazy import to avoid a circular dependency) when the tool is a registered integration, removing the hardcodedclaude/kiro-cli/rovodevbranches. Falls back to plainshutil.which(tool)for unregistered tools (git,code, etc).CLAUDE_LOCAL_PATH/CLAUDE_NPM_LOCAL_PATHconstants stay in_utils.pyfor backward compatibility with existing test patches.ClaudeIntegration: overridesis_cli_available()to check the two known local install paths first, falling back tosuper().is_cli_available()(PATH check).KiroCliIntegration: overridesis_cli_available()to accept bothkiro-cliand the legacykirobinary name.RovodevIntegration: no code change needed - its existing_resolve_executable()override (returnsacli) is picked up automatically by the newcli_executableproperty.AGENTS.md: documents the new override mechanism (with the RovoDev example) and updatesCommon PitfallsAdd John Lam as contributor and release badge #1 to point at this escape hatch instead of implying every CLI integration needskey == executable.TestCliExecutableDetectionintests/integrations/test_base.py(default resolution, env-var override,is_cli_available()true/false, and usingcli_executablerather thankeyfor detection - mirroring RovoDev). All 9 existingtests/test_check_tool.pycases pass unmodified against the refactoredcheck_tool().Deliberate scope decision
The two workflow-step CLI-dispatch sites (
workflows/steps/command/__init__.py,workflows/steps/prompt/__init__.py) are intentionally left unchanged. They already resolve differing executables correctly via an existingimpl.key->exec_args[0]fallback, andtests/test_workflows.pyhas 15+ cases patchingshutil.whichat those specific module paths. Migrating them tois_cli_available()would require rewriting most of those patches for no behavioral gain (they already work), so I have deferred that to a fast-follow rather than risk regressions in the workflow engine's test suite as part of this change. Happy to do that migration in a follow-up PR if maintainers would prefer it bundled.Testing
pytest tests/test_check_tool.py tests/integrations/- 160 passed, 1 skippedruff checkclean on all changed files.AI disclosure
This PR was authored autonomously by an AI coding agent (GitHub Copilot, Claude Sonnet 5) operating under my supervision via the dhruv-15-03 account, per this repo's disclosure guidelines in AGENTS.md.