Repository navigation
Let agents end a chat's /goal themselves (goal_clear) - #266
Merged
Merged
Conversation
When the human drops or replaces a /goal, the agent ends it with the new goal_clear tool instead of handing them a task to type /goal clear. The goal's check stops holding the turn up, and after the turn Godmode runs /goal clear in the Claude session (a local command, no model call) and notes it in the chat with the agent's reason. The goal is read from the session's latest goal_status, also for GLM runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When the human drops a
/goal(for example "end the goal, the site stays live passively"), the goal's Stop hook keeps blocking every turn until its condition is met. The agent could not end it, so it had to give the human a task to type/goal clear.What
goal_clear({ reason })for chat runs. It reads the chat's goal from Claude Code's session file: the latestgoal_statusdecides, the same rule Claude Code uses when it resumes a session. It also works for GLM runs, which keep their own config folder./goal clearin the Claude session. This is a local Claude Code command with no model call (about 1 s, checked against CLI 2.1.312).Tests
test/goal-clear.test.ts(5 tests): how the session's goal status is read; the full run with the fake Claude (the run ends at the check without waiting out the continuation, the clear invocation, the notice, the session is kept); a call made during a forced continuation; a chat with no goal; a run that is no longer active.