feat(goals): /goal budget <N> — update turn budget on active goal in place - #37263
feat(goals): /goal budget <N> — update turn budget on active goal in place#37263PolyphonyRequiem wants to merge 1 commit into
Conversation
…place
Adds a CLI affordance for bumping the turn budget of an in-flight goal
without having to /goal resume (which resets turns_used to 0 and loses
progress on a long-running budget).
Use case: hit the budget mid-task, decide the goal is bigger than
estimated, want more runway without restarting the counter.
New surface
-----------
- hermes_cli.goals.GoalManager.set_budget(n) — pure mutator on
the persisted GoalState. Preserves turns_used. Raises ValueError on
invalid input. Returns None if no goal is set.
- /goal budget <N> CLI subcommand wired in cli.py:_handle_goal_command.
Behavior notes
--------------
- turns_used is preserved (not reset), unlike /goal resume.
- If the goal was auto-paused because the previous budget was exhausted
('paused_reason' starts with 'turn budget exhausted') and the new
budget gives breathing room (turns_used < n), the goal flips back to
active automatically so the next user message resumes the loop. A
user-initiated /goal pause is preserved untouched — only the
exhausted-budget auto-pause is recovered from.
- Persists across sessions like all other goal state.
Tests
-----
7 new GoalManager tests cover: in-place bump, auto-resume from
exhausted state, user-pause preservation, invalid input rejection
(<= 0, non-numeric), no-op when no goal set, cross-manager persistence.
All 64 goal-related tests pass (existing 57 + 7 new).
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused state-preserving goal control. The underlying need still exists: GoalManager.resume() resets turns_used on current main (hermes_cli/goals.py:1185-1198), while exhaustion pauses at hermes_cli/goals.py:1529-1542.
Problems
- The changed
cli.pyhandler was extracted tohermes_cli/cli_commands_mixin.py:1998by0904bc7ea; GitHub currently marks this PR conflicting, so the branch cannot be applied unchanged. - The new docs row says
/goal budget <N>works across CLI and gateway platforms, but current gateway and TUI dispatchers would treatbudget 50as replacement goal text (gateway/slash_commands.py:2291-2294;tui_gateway/server.py:12160-12164). hermes_cli/commands.py:114-115does not advertisebudget <N>in the shared/goalcommand hint.
Suggested changes
- Port the CLI branch to
hermes_cli/cli_commands_mixin.py, update the registry hint, and add the corresponding dispatch tests. - Either mirror the command in gateway/TUI (including the running-agent control gate) or narrow the documentation claim to the classic CLI.
Automated hermes-sweeper review.
| | `/goal` or `/goal status` | Show the current goal, its status, and turns used. | | ||
| | `/goal pause` | Stop the auto-continuation loop without clearing the goal. | | ||
| | `/goal resume` | Resume the loop (resets the turn counter back to zero). | | ||
| | `/goal budget <N>` | Update the turn budget on the active goal in place. Does NOT reset `turns_used` — useful for extending a long-running goal without losing progress. If the goal was auto-paused because the previous budget was exhausted, raising the budget above `turns_used` flips it back to active automatically. | |
There was a problem hiding this comment.
This row is followed by a statement that goal commands work identically on every gateway platform, but this PR only adds CLI parsing. Current gateway and TUI dispatchers would fall through and set budget 50 as a new goal (gateway/slash_commands.py:2291-2294, tui_gateway/server.py:12160-12164). Please either wire the command through those surfaces or scope this documentation to the classic CLI.
|
Abandoned at the project owner's direction on 2026-07-17. No further review or follow-up requested. |
Summary
Adds
/goal budget <N>— a CLI affordance for bumping the turn budget of an in-flight goal without losingturns_usedprogress.Motivation
Today, when an active
/goalruns out of turn budget, your only in-CLI lever is/goal resume— which resetsturns_usedto 0. For a long-running goal where the agent has correctly burned 20 turns and just needs more runway (not a do-over), that's the wrong shape.hermes config set goals.max_turns Nworks but requires a fresh session, which loses the in-flight conversation context entirely.Behavior
/goal budget 50turns_used./goal budget 50(when goal auto-paused via budget exhaustion)activeautomatically so the next message resumes the loop./goal budget 50(when user explicitly/goal paused)/goal budget 0//goal budget -3//goal budget abcValueError, friendly CLI message./goal budget 50(no goal set)Changes
hermes_cli/goals.py—GoalManager.set_budget(n)mutator (+33 LOC).cli.py— wire/goal budget <N>into_handle_goal_command(+22 LOC).tests/hermes_cli/test_goals.py— 7 new tests (+76 LOC).website/docs/user-guide/features/goals.md— table row.Test plan
All 7 new tests pass; the 57 pre-existing goal/CLI/gateway-config tests still pass — no regressions.
Non-goals
goals.max_turnsconfig knob — those still work as before./goal resume --keep-budgetvariant; that's a separate ergonomic question.turns_used/max_turnsat evaluation time.