-
Notifications
You must be signed in to change notification settings - Fork 12.4k
goals: keep pause transitions explicit #23088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+35
−78
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9c6d288
goals: stop pausing implicitly on interrupts (#22884)
etraut-openai e567c5b
Merge remote-tracking branch 'origin/main' into etraut/goal-unload-guard
etraut-openai d3bd811
goals: cover shutdown without active turn (#22884)
etraut-openai be67c8b
Merge remote-tracking branch 'origin/main' into etraut/goal-unload-guard
etraut-openai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8243,7 +8243,7 @@ async fn abort_empty_active_turn_preserves_pending_input() { | |
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn interrupt_accounts_active_goal_before_pausing() -> anyhow::Result<()> { | ||
| async fn interrupt_accounts_active_goal_without_pausing() -> anyhow::Result<()> { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a regression for the no-active-turn/unload path to?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. Done. |
||
| let (sess, tc, _rx, _codex_home) = make_goal_session_and_context_with_rx().await; | ||
| sess.set_thread_goal( | ||
| tc.as_ref(), | ||
|
|
@@ -8273,7 +8273,7 @@ async fn interrupt_accounts_active_goal_before_pausing() -> anyhow::Result<()> { | |
| .await? | ||
| .expect("goal should remain persisted after interrupt"); | ||
| assert_eq!( | ||
| codex_protocol::protocol::ThreadGoalStatus::Paused, | ||
| codex_protocol::protocol::ThreadGoalStatus::Active, | ||
| goal.status | ||
| ); | ||
| assert_eq!(70, goal.tokens_used); | ||
|
|
@@ -8283,6 +8283,34 @@ async fn interrupt_accounts_active_goal_before_pausing() -> anyhow::Result<()> { | |
| Ok(()) | ||
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn shutdown_without_active_turn_keeps_active_goal_active() -> anyhow::Result<()> { | ||
| let (sess, tc, _rx, _codex_home) = make_goal_session_and_context_with_rx().await; | ||
| sess.set_thread_goal( | ||
| tc.as_ref(), | ||
| SetGoalRequest { | ||
| objective: Some("Keep improving the benchmark".to_string()), | ||
| status: None, | ||
| token_budget: None, | ||
| }, | ||
| ) | ||
| .await?; | ||
|
|
||
| assert!(sess.active_turn.lock().await.is_none()); | ||
| assert!(handlers::shutdown(&sess, "shutdown".to_string()).await); | ||
|
|
||
| let goal = sess | ||
| .get_thread_goal() | ||
| .await? | ||
| .expect("goal should remain persisted after shutdown"); | ||
| assert_eq!( | ||
| codex_protocol::protocol::ThreadGoalStatus::Active, | ||
| goal.status | ||
| ); | ||
|
|
||
| Ok(()) | ||
| } | ||
|
|
||
| #[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
| async fn active_goal_continuation_runs_again_after_no_tool_turn() -> anyhow::Result<()> { | ||
| let server = start_mock_server().await; | ||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.