Allow creating a new goal after completion - #26681
Conversation
29bacfa to
c7d48b9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7d48b9a0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| #[tokio::test] | ||
| async fn installed_goal_tools_reject_duplicate_goal_creation() -> anyhow::Result<()> { | ||
| async fn installed_goal_tools_only_replace_complete_goal() -> anyhow::Result<()> { |
There was a problem hiding this comment.
Add an end-to-end goal replacement test
Because this changes how the model-facing create_goal tool can advance after update_goal, it is agent logic. The added coverage here exercises the extension harness only; AGENTS.md “Test authoring guidance” requires such features to add an integration test under core/suite using test_codex, so the end-to-end prompt/tool flow can regress unnoticed.
Useful? React with 👍 / 👎.
c7d48b9 to
e334749
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e334749c06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert_eq!(json!("replacement goal"), result["goal"]["objective"]); | ||
| assert_eq!(json!("active"), result["goal"]["status"]); | ||
| assert_eq!(json!(0), result["goal"]["tokensUsed"]); |
There was a problem hiding this comment.
Compare the full replacement response
AGENTS.md Test assertions asks tests to compare whole objects rather than fields when possible. Here the new replacement assertion checks only three fields of the tool result, so regressions to tokenBudget, remainingTokens, timestamps, or extra response shape would still pass; compare the full response object as in the create-goal test above.
Useful? React with 👍 / 👎.
Why
Users have indicated that they want an agent to be able to create a new goal for itself after completing the previous goal. Currently, that's not possible because agents cannot overwrite an existing goal even if it's complete. This PR removes this limitation and allows
create_goalto overwrite an existing goal if it is in thecompletestate.What changed
create_goalnow replaces the existing goal only when its status iscomplete. The replacement is performed atomically in the goal store, creates a fresh active goal with reset usage, and continues to reject creation while any unfinished goal exists. App server clients see a singlethread/goal/updatedevent when the previous goal is replaced with the new one.The tool description and error message now reflect these semantics.
What didn't change
Agents are not allowed to create a new goal (overwrite their existing goal) if an existing goal is still active, blocked, paused, or in any other state other than "completed".