fix(code): stop replaying accepted /goal objective as a user turn - #4944
Closed
Mason Daugherty (mdrxy) wants to merge 5 commits into
Closed
fix(code): stop replaying accepted /goal objective as a user turn#4944Mason Daugherty (mdrxy) wants to merge 5 commits into
/goal objective as a user turn#4944Mason Daugherty (mdrxy) wants to merge 5 commits into
Conversation
Once a newly created goal's acceptance criteria are approved, the objective was re-submitted and re-rendered as a second `> <objective>` user message on top of the `/goal <objective>` command echo, so the same text appeared twice. Goal creation now continues through the same hidden control message used by amend/resume (`_continue_goal_work`), pointing the model at `get_goal` instead of replaying the objective. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
marked this pull request as ready for review
July 22, 2026 04:37
Member
Author
|
Superseded by #4980. The replacement preserves this PR’s fix for the duplicate objective/user turn, but implements the post-acceptance continuation together with the durable goal-state notice from #4412. This gives persistence, restoration, summarization, transcript filtering, and the Closing this PR in favor of #4980. |
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Jul 23, 2026
Supersedes #4412 Supersedes #4944 Accepted goals now transition into agent work through one coordinated internal protocol: a durable notice records the authoritative goal state, while a hidden continuation resumes work without replaying the objective as another user message. --- The previous PRs addressed two symptoms at the same transition. #4944 changed how work resumes after goal acceptance, while #4412 introduced persisted notices that tell the agent when goal tools are relevant. Landing them independently would create overlapping internal-message lifecycles with separate persistence, restoration, summarization, and transcript-filtering behavior. This replacement gives the two message types explicit roles: - The goal-state notice is the durable source of truth. - The continuation is a one-time trigger emitted only after that state is available. It also handles persistence failure without directing the agent to nonexistent saved state and keeps all internal goal-control messages out of user-visible and grader transcripts. Goal-specific filtering remains in `deepagents-code`; the replacement does not change the Deep Agents SDK.
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
Supersedes langchain-ai#4412 Supersedes langchain-ai#4944 Accepted goals now transition into agent work through one coordinated internal protocol: a durable notice records the authoritative goal state, while a hidden continuation resumes work without replaying the objective as another user message. --- The previous PRs addressed two symptoms at the same transition. langchain-ai#4944 changed how work resumes after goal acceptance, while langchain-ai#4412 introduced persisted notices that tell the agent when goal tools are relevant. Landing them independently would create overlapping internal-message lifecycles with separate persistence, restoration, summarization, and transcript-filtering behavior. This replacement gives the two message types explicit roles: - The goal-state notice is the durable source of truth. - The continuation is a one-time trigger emitted only after that state is available. It also handles persistence failure without directing the agent to nonexistent saved state and keeps all internal goal-control messages out of user-visible and grader transcripts. Goal-specific filtering remains in `deepagents-code`; the replacement does not change the Deep Agents SDK.
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.
When a newly created
/goal's acceptance criteria are approved, the objective is no longer echoed and re-submitted a second time.Previously, accepting the proposed criteria for a brand-new goal replayed the objective through
_handle_user_message, which mounted a second> <objective>user message and re-sent the text — even though the objective was already shown in the/goal <objective>command echo. The result was the same text appearing twice in the transcript.Goal creation now continues work the same way amendments and resumes already do, via the hidden
_continue_goal_workcontrol message that points the model atget_goal. Nothing objective-related is re-shown or re-submitted as a visible user turn, and the behavior stays consistent between a live session and a reloaded thread.Made by Open SWE