hermes-agent/hermes_cli
teknium1 f9ad7400e3 fix(goals): raise judge max_tokens 200 → 4096, make configurable
The freeform /goal judge was capped at max_tokens=200, which reliably
truncated the JSON verdict on reasoning-heavy models (deepseek-v4-pro,
qwq, etc.) — the model burns tokens on hidden reasoning before emitting
visible content, and the first /goal turn's prompt is larger than later
turns, blowing past 200. Symptom: agent.log shows
`judge reply was not JSON: '{"done": true, "reason": "The agent successfully'`
followed by repeated `judge returned empty response` lines, then the
goal pauses with a misleading 'judge model isn't returning the required
JSON verdict' message.

Diagnosed live by @helix4u — empirically verified that raising the
budget on an unmodified worktree makes the failures go away on the
exact configs users were hitting on Nous Plus subscription paths.

Changes:
- DEFAULT_JUDGE_MAX_TOKENS = 4096 (up from 200)
- New auxiliary.goal_judge.max_tokens config knob for tuning in
  specifically constrained setups
- _goal_judge_max_tokens() resolves the value with fail-open semantics
  (non-int / non-positive / load failure → default). load_config() is
  mtime-cached so per-turn lookup is cheap.

Scoped narrowly to the verified root cause — does not introduce a
submit_verdict tool-call schema (see #26162 / #23671 for that direction;
they can land separately if we want them).

Tests: tests/hermes_cli/test_goals.py + tests/cli/test_cli_goal_interrupt.py
+ tests/gateway/test_goal_verdict_send.py — 62/62 passing.

E2E verified: config override honored (8192), missing/garbage/zero
values fall back to 4096, no-auxiliary-section falls back to 4096.

Co-authored-by: helix4u <4317663+helix4u@users.noreply.github.com>

Credits:
- @helix4u (Gille) — diagnosed the max_tokens=200 truncation via live
  testing on an unmodified worktree, drafted the original fix shape
  in #26162.
- @AhmetArif0 — flagged the freeform judge fragility in #23671 from
  the tool-call angle.
- @0xharryriddle (HarryRiddle.eth) — reported the issue from a Nous
  Plus subscription setup in #23876 with full debug reports.

Closes #23876
Supersedes #26162, #23671, #23881
2026-05-14 23:44:06 -07:00
..
proxy fix(proxy): suppress false-positive windows-footgun on guarded add_signal_handler 2026-05-14 15:57:59 -07:00
__init__.py
…
_parser.py
…
_subprocess_compat.py
…
auth.py perf(tools): cache get_nous_auth_status() and load_env() to fix slow `hermes tools` menus (#25341) 2026-05-13 18:40:14 -07:00
auth_commands.py fix(minimax): harden OAuth dashboard and runtime 2026-05-11 22:15:16 -07:00
azure_detect.py
…
backup.py
…
banner.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
browser_connect.py
…
callbacks.py
…
checkpoints.py
…
claw.py
…
cli_output.py
…
clipboard.py fix(clipboard): only read PNG signature bytes, not entire file 2026-05-13 22:54:21 -07:00
codex_models.py
…
codex_runtime_plugin_migration.py feat(codex-runtime): skip unavailable plugins during migration (#25437) 2026-05-13 22:20:27 -07:00
codex_runtime_switch.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
colors.py
…
commands.py feat(goals): /subgoal — user-added criteria appended to active /goal (#25449) 2026-05-13 22:55:09 -07:00
completion.py test(cli): strengthen zsh completion regression coverage 2026-05-13 09:34:15 -07:00
config.py chore: remove Atropos RL environments and tinker-atropos integration (#26106) 2026-05-15 10:36:38 +05:30
copilot_auth.py
…
cron.py
…
curator.py
…
curses_ui.py
…
debug.py
…
default_soul.py
…
dingtalk_auth.py
…
doctor.py chore: remove Atropos RL environments and tinker-atropos integration (#26106) 2026-05-15 10:36:38 +05:30
dump.py
…
env_loader.py
…
fallback_cmd.py
…
gateway.py fix(gateway): reduce systemd restart delay 2026-05-12 17:11:25 -07:00
gateway_windows.py
…
goals.py fix(goals): raise judge max_tokens 200 → 4096, make configurable 2026-05-14 23:44:06 -07:00
hooks.py
…
inventory.py refactor(inventory): extract shared ConfigContext + build_models_payload 2026-05-13 22:31:11 -07:00
kanban.py
…
kanban_db.py
…
kanban_diagnostics.py
…
kanban_specify.py feat(nous): unified client=hermes-client-v<version> tag on every Portal request (#24779) 2026-05-12 20:49:20 -07:00
logs.py
…
main.py feat: add ACP registry metadata for Zed 2026-05-14 20:26:02 -07:00
mcp_config.py
…
memory_setup.py fix: restrict .env file permissions to 0600 2026-05-14 07:59:38 -07:00
model_catalog.py
…
model_normalize.py
…
model_switch.py
…
models.py docs: update NovitaAI provider positioning (#25532) 2026-05-14 01:31:12 -07:00
nous_subscription.py
…
oneshot.py
…
pairing.py
…
platforms.py
…
plugins.py feat(plugins): add ctx.register_web_search_provider() facade 2026-05-13 22:31:28 -07:00
plugins_cmd.py
…
profile_distribution.py
…
profiles.py refactor(profiles): remove dead generate_bash_completion / generate_zsh_completion 2026-05-13 09:34:15 -07:00
providers.py feat: add NovitaAI as LLM provider 2026-05-13 23:51:15 -07:00
pt_input_extras.py
…
pty_bridge.py
…
relaunch.py
…
runtime_provider.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
security_advisories.py feat(security): supply-chain advisory checker + lazy-install framework + tiered install fallback (#24220) 2026-05-12 01:02:25 -07:00
setup.py chore: remove Atropos RL environments and tinker-atropos integration (#26106) 2026-05-15 10:36:38 +05:30
skills_config.py
…
skills_hub.py
…
skin_engine.py fix(cli): kill resize scrollback duplication + light-mode visibility 2026-05-14 23:23:32 -07:00
slack_cli.py
…
status.py chore: remove Atropos RL environments and tinker-atropos integration (#26106) 2026-05-15 10:36:38 +05:30
stdio.py
…
timeouts.py
…
tips.py
…
tools_config.py chore: remove Atropos RL environments and tinker-atropos integration (#26106) 2026-05-15 10:36:38 +05:30
uninstall.py
…
vercel_auth.py
…
voice.py
…
web_server.py refactor(inventory): extract shared ConfigContext + build_models_payload 2026-05-13 22:31:11 -07:00
webhook.py
…