Skip to content

Build Codex and Hermes commands from their own interfaces - #80

Merged
Alexgodoroja merged 1 commit into
mainfrom
codex-hermes-verified-flags
Sep 9, 2026
Merged

Build Codex and Hermes commands from their own interfaces#80
Alexgodoroja merged 1 commit into
mainfrom
codex-hermes-verified-flags

Conversation

@Alexgodoroja

Copy link
Copy Markdown
Collaborator

What this changes

The new-session form carried a warning on GPT Codex and Hermes Agent: "These flags come from the published interface for … rather than from its own help output, so check the command below before starting."

The warning was accurate. codex --full-auto is not a flag in current Codex:

$ codex --full-auto --help
error: unexpected argument '--full-auto' found

So the one non-default option the form offered for Codex built a command that could only fail on the machine it was sent to, after the round trip through POST /api/commands and the agent poll.

Rather than keep the warning, I installed both tools, read their real interfaces, and rebuilt the two kinds so there is nothing left to warn about. Codex and Hermes now sit at the same bar as Claude Code and OpenClaw.

Verified against

tool version install
codex 0.153.4 npm i -g @openai/codex
hermes 0.19.0 uv tool install hermes-agent

Every option offered by the two builders parses against the installed binary. All 17 command shapes the builders can produce were generated from the shipped build() functions and run against the real CLIs: 17/17 accepted.

Codex

Dropped --full-auto. Added, all read from codex --help and codex resume --help:

  • resume by id, or --last
  • --sandboxread-only / workspace-write / danger-full-access
  • --ask-for-approvalon-request / never
  • --search

Options follow resume <id>, which is where the subcommand accepts them, so one order works for a fresh and a resumed run.

Hermes

Replaced the free-text argument box with real controls: a subcommand picker, --resume, --continue, --model, --worktree, --yolo.

Two ordering rules the parser imposes are encoded and tested:

  1. Every option belongs to the top-level parser, so all of them precede the subcommand. hermes sessions --yolo is error: unrecognized arguments: --yolo; hermes --yolo sessions is fine.
  2. A bare --continue takes an optional value, so it is greedy — in hermes --continue sessions the subcommand is read as the session name to resume. It is emitted last, and only when no subcommand and no explicit session could be eaten by it.

Discovery

Unchanged, and already correct: codex and hermes were present in cmd/shell/harness.go, in KNOWN_HARNESSES in app/server/app.ts, and in DETECTED_HARNESSES in app/src/lib/harnesses.ts. Confirmed end to end on a machine with all four installed — installedHarnesses() returns [claude-code codex hermes openclaw], and the "not found on this machine" note still renders for a machine that reports without them.

Tests

session-kinds.test.ts covers both builders: resume precedence, empty selects meaning "no flag", option ordering, and the --continue guard. The catalogue test that asserted which kinds were built from a published interface is replaced by one asserting no builder can emit --full-auto.

  • npm run check (root) — pass
  • npm test in app/ — 616 passed, 3 skipped
  • npm run typecheck, oxlint — clean, no new warnings
  • go test -race ./..., go vet ./..., gofmt -l — clean
  • npm run build:web — builds

The modal was also driven in a browser to confirm the live command preview matches the builders and the warning is gone.

Note: npm run build in app/ fails at check-bundle for want of VITE_FIREBASE_*. That reproduces on main on a machine with no .env.local and is unrelated to this change.

The launcher marked the GPT Codex and Hermes Agent flag sets as taken from
a published interface rather than read from the tool, and warned about it
in the form. The warning was right: codex 0.153.4 answers `--full-auto`
with "unexpected argument", so a full-auto Codex session started from the
browser could only fail on the machine it was sent to.

Both tools were installed and their interfaces read, and every option
offered here now parses against the real binary:

- Codex resumes by id or `--last`, and exposes `--sandbox`,
  `--ask-for-approval` and `--search`. Options follow `resume <id>`,
  which is where the subcommand accepts them.
- Hermes takes a subcommand, `--resume`, `--continue`, `--model`,
  `--worktree` and `--yolo`, replacing a free-text argument box.

Two ordering rules the parsers impose are now encoded and tested. Hermes
options belong to the top-level parser, so they precede the subcommand:
`hermes sessions --yolo` is an error. And a bare `--continue` takes an
optional value, so it swallows whatever follows; it is emitted last, and
only when no subcommand and no explicit session could be eaten by it.

With nothing left that was guessed, the warning goes too.

Discovery is unchanged: the ids were already in the CLI's detection
table, the accounts service's accepted set, and the browser's catalogue.
@Alexgodoroja
Alexgodoroja force-pushed the codex-hermes-verified-flags branch from c70dc6b to 89476d7 Compare September 9, 2026 03:18
@Alexgodoroja
Alexgodoroja merged commit 78ff98d into main Sep 9, 2026
16 checks passed
@Alexgodoroja
Alexgodoroja deleted the codex-hermes-verified-flags branch September 9, 2026 03:26
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.

1 participant