Skip to content

fix(integrations): hermes honors SPECKIT_INTEGRATION_HERMES_EXTRA_ARGS#3346

Merged
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:fix/hermes-extra-args-env
Jul 6, 2026
Merged

fix(integrations): hermes honors SPECKIT_INTEGRATION_HERMES_EXTRA_ARGS#3346
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:fix/hermes-extra-args-env

Conversation

@jawwad-ali

Copy link
Copy Markdown
Contributor

Description

HermesIntegration.build_exec_args routes argv[0] through _resolve_executable() (so the _EXECUTABLE override works) but never calls _apply_extra_args_env_var():

args = [self._resolve_executable(), "chat", "-Q"]
if model:
    args.extend(["-m", model])
...

So SPECKIT_INTEGRATION_HERMES_EXTRA_ARGS is silently dropped — the same class of bug fixed for cursor-agent in #3265. Sibling CLI-dispatch integrations (codex, devin, opencode) all call the hook.

Fix

Insert self._apply_extra_args_env_var(args) after the base chat -Q command and before Spec Kit's canonical -m/--json/-s/-q flags, mirroring opencode's placement — so operator-supplied flags can't displace or clobber the canonical ones.

Testing

New TestHermesBuildExecArgs (hermes had zero build_exec_args coverage):

  • default argv shape pinned;
  • test_build_exec_args_honors_extra_args: with the env var set, --temperature 0.2 appears before --json/-s (asserts both membership and insertion order). Fails before (tokens absent — verified by source-stash), passes after;
  • executable-override test.

uvx ruff check clean.

AI Disclosure

  • I did use AI assistance (describe below)

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.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 base chat -Q tokens and before canonical Spec Kit flags.
  • Add new TestHermesBuildExecArgs coverage 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

@mnriem mnriem merged commit 587b185 into github:main Jul 6, 2026
12 checks passed
@mnriem

mnriem commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants