Hermes provider fails: `stdin` vs `-z PROMPT` + `--source` argument doesn't exist in top level + missing `binary="ollama"` method of running · Issue #656 · AISecurityLab/hackagent · GitHub
Skip to content

Hermes provider fails: stdin vs -z PROMPT + --source argument doesn't exist in top level + missing binary="ollama" method of running #656

Open

Description

@hassen8

Summary

  1. hermes: error: argument -z expected one argument right after the flag for the prompt, but the prompt was sent via stdininstead of as-z` value. which causes a failure to launch.
  2. default --source hackagent is injected where the tested binary does not accept --source at the top level, its an option for the hermes chat which is used to add a tag to the messages for tracking, but we do not use the chat argument for our purpose. So it exits with an error hermes: 'hackagent' is not a hermes command
  3. No binary="ollama" mode available, unlike claude.py:188/codex.py:260 (ollama launch claude|codex), hermes.py only shells native hermes, so local ollama models are unsupported to run in similar fashion to codex and claude code.

Tested Binary Version: v0.21.5

Combined fix: pass prompt as -z value (not stdin), only emit --source when explicitly configured, and add is_ollama branch mirroring Claude/Codex.

Expected Fix

# hackagent/router/providers/hermes.py:347
-        self.source = config.get("source", "hackagent")

# hackagent/router/providers/hermes.py:184
-            argv.extend(["--source", self.source])

# hackagent/router/providers/hermes.py:165 _build_argv -> add is_ollama parity with claude/codex
+        is_ollama = self.binary == "ollama"
+        if is_ollama:
+            # mirrors claude.py:188 / codex.py:260
+            argv = ["ollama", "launch", "hermes", "--model", self.model, "--yes", "--"]
+            # then fall through to -z handling below; prompt inserted as -z value
+            argv.extend(["-z"])
+        else:
+            argv = [self.binary, "-z"]
         if self.model and not is_ollama:
             argv.extend(["-m", self.model])
         # ... provider / ignore_user_config / safe_mode / source / extra_args as before

# hackagent/router/providers/hermes.py:188 _run -> insert prompt as -z value, not stdin
-        proc = subprocess.run(argv, input=prompt_text, capture_output=True, text=True, timeout=self.timeout, cwd=self.cwd)
+        base_argv = self._build_argv()  # [hermes, -z, <prompt>, -m model, ...] or [ollama, launch, hermes, ... --, -z, <prompt>, ...]
+        idx = base_argv.index("-z")
+        argv = base_argv[:idx+1] + [prompt_text] + base_argv[idx+1:]
+        # For ollama path the -m is already encoded as --model before --, do not duplicate
+        proc = subprocess.run(argv, capture_output=True, text=True, timeout=self.timeout, cwd=self.cwd)

Activity

  1. changed the title [-]Hermes provider fails: `stdin` vs `-z PROMPT` + `--source` argument doesn't exist in hermes + missing `binary="ollama"` method of running[/-] [+]Hermes provider fails: `stdin` vs `-z PROMPT` + `--source` argument doesn't exist in top level + missing `binary="ollama"` method of running[/+] on Sep 25, 2026
  2. franconicola commented on Oct 19, 2026

    @franconicola
    Member

    Still present on main (v0.15.0). The provider moved to hackagent/models/completions/ in the restructure. #658 fixes this against the old hackagent/router/providers/ layout, so that fix needs porting to the new location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions