Skip to content

feat(goals): /goal budget <N> — update turn budget on active goal in place - #37263

Closed
PolyphonyRequiem wants to merge 1 commit into
NousResearch:mainfrom
PolyphonyRequiem:feature/goal-budget-command
Closed

feat(goals): /goal budget <N> — update turn budget on active goal in place#37263
PolyphonyRequiem wants to merge 1 commit into
NousResearch:mainfrom
PolyphonyRequiem:feature/goal-budget-command

Conversation

@PolyphonyRequiem

Copy link
Copy Markdown
Contributor

Summary

Adds /goal budget <N> — a CLI affordance for bumping the turn budget of an in-flight goal without losing turns_used progress.

Motivation

Today, when an active /goal runs out of turn budget, your only in-CLI lever is /goal resume — which resets turns_used to 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 N works but requires a fresh session, which loses the in-flight conversation context entirely.

Behavior

Command Effect
/goal budget 50 Update the budget on the active goal in place. Preserves turns_used.
/goal budget 50 (when goal auto-paused via budget exhaustion) Flips status back to active automatically so the next message resumes the loop.
/goal budget 50 (when user explicitly /goal paused) Updates the ceiling but leaves the pause untouched — the user paused for a reason.
/goal budget 0 / /goal budget -3 / /goal budget abc ValueError, friendly CLI message.
/goal budget 50 (no goal set) "No goal set" message.

Changes

  • hermes_cli/goals.pyGoalManager.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

$ python -m pytest tests/hermes_cli/test_goals.py tests/cli/test_cli_goal_interrupt.py tests/gateway/test_goal_max_turns_config.py
============================== 64 passed in 1.30s ==============================

All 7 new tests pass; the 57 pre-existing goal/CLI/gateway-config tests still pass — no regressions.

Non-goals

  • Doesn't change the default budget or the goals.max_turns config knob — those still work as before.
  • Doesn't add a /goal resume --keep-budget variant; that's a separate ergonomic question.
  • Doesn't surface budget changes in the judge prompt — the judge already sees turns_used/max_turns at evaluation time.

…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).
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 2, 2026

@teknium1 teknium1 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.

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.py handler was extracted to hermes_cli/cli_commands_mixin.py:1998 by 0904bc7ea; 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 treat budget 50 as replacement goal text (gateway/slash_commands.py:2291-2294; tui_gateway/server.py:12160-12164).
  • hermes_cli/commands.py:114-115 does not advertise budget <N> in the shared /goal command 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. |

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.

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.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 13, 2026
@PolyphonyRequiem

Copy link
Copy Markdown
Contributor Author

Abandoned at the project owner's direction on 2026-07-17. No further review or follow-up requested.

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

Labels

area/install-update Installer, updater, packaging, wheels, doctor comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants