fix(integrations): hermes honors SPECKIT_INTEGRATION_HERMES_EXTRA_ARGS#3346
Merged
Conversation
HermesIntegration.build_exec_args routed argv[0] through _resolve_executable() but never called _apply_extra_args_env_var(), so the documented per-integration extra-args env hook was silently dropped for hermes — the same class of bug fixed for cursor-agent in github#3265. Insert the hook after the base 'chat -Q' command and before Spec Kit's canonical -m/--json/-s/-q flags (mirrors opencode), so operator args can't displace or clobber the canonical flags. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a parity bug in the Hermes CLI-dispatch integration where SPECKIT_INTEGRATION_HERMES_EXTRA_ARGS was previously ignored, by applying the shared extra-args env hook in HermesIntegration.build_exec_args. It also adds focused regression tests to pin both presence and insertion order of the injected flags.
Changes:
- Apply
self._apply_extra_args_env_var(args)in Hermes CLI dispatch after the basechat -Qtokens and before canonical Spec Kit flags. - Add new
TestHermesBuildExecArgscoverage for default argv shape, extra-args injection (including order), and executable override.
Show a summary per file
| File | Description |
|---|---|
| src/specify_cli/integrations/hermes/init.py | Inserts the extra-args env-var hook into Hermes build_exec_args at the correct position to prevent operator flags from clobbering canonical flags. |
| tests/integrations/test_integration_hermes.py | Adds regression tests covering Hermes build_exec_args default argv, extra-args injection order, and executable override. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
Collaborator
|
Thank you! |
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.
Description
HermesIntegration.build_exec_argsroutes argv[0] through_resolve_executable()(so the_EXECUTABLEoverride works) but never calls_apply_extra_args_env_var():So
SPECKIT_INTEGRATION_HERMES_EXTRA_ARGSis silently dropped — the same class of bug fixed forcursor-agentin #3265. Sibling CLI-dispatch integrations (codex,devin,opencode) all call the hook.Fix
Insert
self._apply_extra_args_env_var(args)after the basechat -Qcommand and before Spec Kit's canonical-m/--json/-s/-qflags, mirroringopencode's placement — so operator-supplied flags can't displace or clobber the canonical ones.Testing
New
TestHermesBuildExecArgs(hermes had zerobuild_exec_argscoverage):test_build_exec_args_honors_extra_args: with the env var set,--temperature 0.2appears before--json/-s(asserts both membership and insertion order). Fails before (tokens absent — verified by source-stash), passes after;uvx ruff checkclean.AI Disclosure
Found and fixed with Claude Code (Claude Fable 5) under my direction. AI flagged hermes as another integration skipping the extra-args hook; I confirmed it, pinned insertion order in the test (per the #3265 review), verified fail-before/pass-after, and reviewed the diff.