mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-23 05:31:23 +00:00
revert: roll back /goal checklist + /subgoal feature stack (#23813)
* Revert "fix(goals): force judge to use tool calls instead of JSON-text replies (#23547)" This reverts commita63a2b7c78. * Revert "fix(goals): forward standing /goal state on auto-compression session rotation (#23530)" This reverts commit4a080b1d5a. * Revert "feat(goals): /goal checklist + /subgoal user controls (#23456)" This reverts commit404640a2b7.
This commit is contained in:
parent
1d4a4997b1
commit
3e7145e0bb
9 changed files with 113 additions and 2487 deletions
101
gateway/run.py
101
gateway/run.py
|
|
@ -6083,12 +6083,6 @@ class GatewayRunner:
|
|||
return await self._handle_goal_command(event)
|
||||
return "Agent is running — use /goal status / pause / clear mid-run, or /stop before setting a new goal."
|
||||
|
||||
# /subgoal is safe mid-run — it only modifies the active goal's
|
||||
# checklist, which the judge consults at turn boundaries. There
|
||||
# is no race with the running turn.
|
||||
if _cmd_def_inner and _cmd_def_inner.name == "subgoal":
|
||||
return await self._handle_subgoal_command(event)
|
||||
|
||||
# Session-level toggles that are safe to run mid-agent —
|
||||
# /yolo can unblock a pending approval prompt, /verbose cycles
|
||||
# the tool-progress display mode for the ongoing stream.
|
||||
|
|
@ -6467,9 +6461,6 @@ class GatewayRunner:
|
|||
if canonical == "goal":
|
||||
return await self._handle_goal_command(event)
|
||||
|
||||
if canonical == "subgoal":
|
||||
return await self._handle_subgoal_command(event)
|
||||
|
||||
if canonical == "voice":
|
||||
return await self._handle_voice_command(event)
|
||||
|
||||
|
|
@ -6654,18 +6645,10 @@ class GatewayRunner:
|
|||
except Exception:
|
||||
session_entry = None
|
||||
if session_entry is not None:
|
||||
# Pull the agent's full messages list from the result
|
||||
# so the judge can dump it for its read_file tool.
|
||||
_agent_messages: list = []
|
||||
if isinstance(_agent_result, dict):
|
||||
_msgs = _agent_result.get("messages")
|
||||
if isinstance(_msgs, list):
|
||||
_agent_messages = _msgs
|
||||
await self._post_turn_goal_continuation(
|
||||
session_entry=session_entry,
|
||||
source=source,
|
||||
final_response=_final_text,
|
||||
agent_messages=_agent_messages,
|
||||
)
|
||||
except Exception as _goal_exc:
|
||||
logger.debug("goal continuation hook failed: %s", _goal_exc)
|
||||
|
|
@ -9402,83 +9385,6 @@ class GatewayRunner:
|
|||
|
||||
return t("gateway.goal.set", budget=state.max_turns, goal=state.goal)
|
||||
|
||||
async def _handle_subgoal_command(self, event: "MessageEvent") -> str:
|
||||
"""Handle /subgoal for gateway platforms.
|
||||
|
||||
Forms (mirror of CLI):
|
||||
/subgoal show the checklist
|
||||
/subgoal <text> append a user item
|
||||
/subgoal complete <n> | done <n> mark item n completed
|
||||
/subgoal impossible <n> mark item n impossible
|
||||
/subgoal undo <n> revert item n to pending
|
||||
/subgoal remove <n> delete item n
|
||||
/subgoal clear wipe the checklist
|
||||
"""
|
||||
args = (event.get_command_args() or "").strip()
|
||||
|
||||
mgr, _session_entry = self._get_goal_manager_for_event(event)
|
||||
if mgr is None:
|
||||
return t("gateway.goal.unavailable")
|
||||
|
||||
if not mgr.has_goal():
|
||||
return "No active goal. Set one with /goal <text>."
|
||||
|
||||
if not args:
|
||||
return f"{mgr.status_line()}\n{mgr.render_checklist()}"
|
||||
|
||||
tokens = args.split(None, 1)
|
||||
verb = tokens[0].lower()
|
||||
rest = tokens[1].strip() if len(tokens) > 1 else ""
|
||||
|
||||
action_status_map = {
|
||||
"complete": "completed",
|
||||
"completed": "completed",
|
||||
"done": "completed",
|
||||
"impossible": "impossible",
|
||||
"imp": "impossible",
|
||||
"skip": "impossible",
|
||||
"undo": "pending",
|
||||
"pending": "pending",
|
||||
"reset": "pending",
|
||||
}
|
||||
if verb in action_status_map:
|
||||
if not rest:
|
||||
return f"Usage: /subgoal {verb} <n>"
|
||||
try:
|
||||
idx = int(rest.split()[0])
|
||||
except ValueError:
|
||||
return f"/subgoal {verb}: <n> must be an integer (1-based index)."
|
||||
try:
|
||||
item = mgr.mark_subgoal(idx, action_status_map[verb])
|
||||
except (IndexError, ValueError, RuntimeError) as exc:
|
||||
return f"/subgoal {verb}: {exc}"
|
||||
return f"✓ Item {idx} → {item.status}: {item.text}"
|
||||
|
||||
if verb == "remove":
|
||||
if not rest:
|
||||
return "Usage: /subgoal remove <n>"
|
||||
try:
|
||||
idx = int(rest.split()[0])
|
||||
except ValueError:
|
||||
return "/subgoal remove: <n> must be an integer (1-based index)."
|
||||
try:
|
||||
removed = mgr.remove_subgoal(idx)
|
||||
except (IndexError, RuntimeError) as exc:
|
||||
return f"/subgoal remove: {exc}"
|
||||
return f"✓ Removed item {idx}: {removed.text}"
|
||||
|
||||
if verb == "clear":
|
||||
mgr.clear_checklist()
|
||||
return "✓ Checklist cleared. The judge will re-decompose on the next turn."
|
||||
|
||||
# Otherwise — append `args` as a new user-authored checklist item.
|
||||
try:
|
||||
item = mgr.add_subgoal(args)
|
||||
except (ValueError, RuntimeError) as exc:
|
||||
return f"/subgoal: {exc}"
|
||||
idx = len(mgr.state.checklist) if mgr.state else 0
|
||||
return f"✓ Added subgoal {idx}: {item.text}"
|
||||
|
||||
async def _send_goal_status_notice(self, source: Any, message: str) -> None:
|
||||
"""Send a /goal judge status line back to the originating chat/thread."""
|
||||
adapter = self.adapters.get(source.platform)
|
||||
|
|
@ -9547,7 +9453,6 @@ class GatewayRunner:
|
|||
session_entry: Any,
|
||||
source: Any,
|
||||
final_response: str,
|
||||
agent_messages: Optional[list] = None,
|
||||
) -> None:
|
||||
"""Run the goal judge after a gateway turn and, if still active,
|
||||
enqueue a continuation prompt for the same session.
|
||||
|
|
@ -9575,11 +9480,7 @@ class GatewayRunner:
|
|||
if not mgr.is_active():
|
||||
return
|
||||
|
||||
decision = mgr.evaluate_after_turn(
|
||||
final_response or "",
|
||||
user_initiated=True,
|
||||
messages=agent_messages or [],
|
||||
)
|
||||
decision = mgr.evaluate_after_turn(final_response or "", user_initiated=True)
|
||||
msg = decision.get("message") or ""
|
||||
|
||||
# Defer the status line until after the adapter has delivered the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue