diff --git a/codex-rs/core/src/goals.rs b/codex-rs/core/src/goals.rs
index a4206730f9..4a11bc8bd6 100644
--- a/codex-rs/core/src/goals.rs
+++ b/codex-rs/core/src/goals.rs
@@ -43,6 +43,8 @@ use codex_rollout::state_db::reconcile_rollout;
use codex_thread_store::LocalThreadStore;
use futures::future::BoxFuture;
use std::sync::Arc;
+use std::sync::atomic::AtomicBool;
+use std::sync::atomic::Ordering;
use std::time::Duration;
use std::time::Instant;
use tokio::sync::Mutex;
@@ -116,6 +118,7 @@ pub struct ExternalGoalSet {
/// Callers report the session event they observed; this module owns the policy
/// for how that event changes goal runtime state.
pub(crate) enum GoalRuntimeEvent<'a> {
+ TurnAttemptStarted,
TurnStarted {
turn_context: &'a TurnContext,
token_usage: TokenUsage,
@@ -147,15 +150,10 @@ pub(crate) enum GoalRuntimeEvent<'a> {
ThreadResumed,
}
-#[derive(Clone, Copy)]
-enum TerminalGoalErrorStatus {
- Paused,
- UsageLimited,
-}
-
pub(crate) struct GoalRuntimeState {
pub(crate) state_db: Mutex