From a53aa527af6f39d29fc94cd56fe91a9b060e7600 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Wed, 20 May 2026 10:57:01 +0100 Subject: [PATCH] feat: rename 3 --- .../thread_goal_processor.rs | 4 +-- codex-rs/core/src/goals.rs | 4 +-- codex-rs/core/src/session/tests.rs | 2 +- codex-rs/state/src/lib.rs | 2 +- codex-rs/state/src/runtime.rs | 2 +- codex-rs/state/src/runtime/goals.rs | 32 +++++++++---------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/codex-rs/app-server/src/request_processors/thread_goal_processor.rs b/codex-rs/app-server/src/request_processors/thread_goal_processor.rs index cf1e58345b..c18806ea03 100644 --- a/codex-rs/app-server/src/request_processors/thread_goal_processor.rs +++ b/codex-rs/app-server/src/request_processors/thread_goal_processor.rs @@ -161,7 +161,7 @@ impl ThreadGoalRequestProcessor { .thread_goals() .update_thread_goal( thread_id, - codex_state::ThreadGoalUpdate { + codex_state::GoalUpdate { objective: Some(objective.to_string()), status, token_budget: params.token_budget, @@ -206,7 +206,7 @@ impl ThreadGoalRequestProcessor { .thread_goals() .update_thread_goal( thread_id, - codex_state::ThreadGoalUpdate { + codex_state::GoalUpdate { objective: None, status, token_budget: params.token_budget, diff --git a/codex-rs/core/src/goals.rs b/codex-rs/core/src/goals.rs index 6843264e44..5248bbab72 100644 --- a/codex-rs/core/src/goals.rs +++ b/codex-rs/core/src/goals.rs @@ -476,7 +476,7 @@ impl Session { .thread_goals() .update_thread_goal( self.conversation_id, - codex_state::ThreadGoalUpdate { + codex_state::GoalUpdate { objective: Some(objective.to_string()), status: status.map(state_goal_status_from_protocol), token_budget, @@ -516,7 +516,7 @@ impl Session { .thread_goals() .update_thread_goal( self.conversation_id, - codex_state::ThreadGoalUpdate { + codex_state::GoalUpdate { objective: None, status, token_budget, diff --git a/codex-rs/core/src/session/tests.rs b/codex-rs/core/src/session/tests.rs index bfe3cfb3fe..175f022289 100644 --- a/codex-rs/core/src/session/tests.rs +++ b/codex-rs/core/src/session/tests.rs @@ -8620,7 +8620,7 @@ async fn external_goal_mutation_accounts_active_turn_before_status_change() -> a .thread_goals() .update_thread_goal( sess.conversation_id, - codex_state::ThreadGoalUpdate { + codex_state::GoalUpdate { objective: None, status: Some(codex_state::ThreadGoalStatus::Complete), token_budget: None, diff --git a/codex-rs/state/src/lib.rs b/codex-rs/state/src/lib.rs index 8746ff3a0d..c178d6ffd4 100644 --- a/codex-rs/state/src/lib.rs +++ b/codex-rs/state/src/lib.rs @@ -54,7 +54,7 @@ pub use runtime::RuntimeDbPath; pub use runtime::ThreadFilterOptions; pub use runtime::ThreadGoalAccountingMode; pub use runtime::ThreadGoalAccountingOutcome; -pub use runtime::ThreadGoalUpdate; +pub use runtime::GoalUpdate; pub use runtime::goals_db_filename; pub use runtime::goals_db_path; pub use runtime::logs_db_filename; diff --git a/codex-rs/state/src/runtime.rs b/codex-rs/state/src/runtime.rs index ac03f227da..08218cde0f 100644 --- a/codex-rs/state/src/runtime.rs +++ b/codex-rs/state/src/runtime.rs @@ -69,7 +69,7 @@ mod threads; pub use goals::GoalStore; pub use goals::ThreadGoalAccountingMode; pub use goals::ThreadGoalAccountingOutcome; -pub use goals::ThreadGoalUpdate; +pub use goals::GoalUpdate; pub use remote_control::RemoteControlEnrollmentRecord; pub use threads::ThreadFilterOptions; diff --git a/codex-rs/state/src/runtime/goals.rs b/codex-rs/state/src/runtime/goals.rs index bf5a7bd825..17655e72cf 100644 --- a/codex-rs/state/src/runtime/goals.rs +++ b/codex-rs/state/src/runtime/goals.rs @@ -13,7 +13,7 @@ impl GoalStore { } } -pub struct ThreadGoalUpdate { +pub struct GoalUpdate { pub objective: Option, pub status: Option, pub token_budget: Option>, @@ -170,9 +170,9 @@ RETURNING pub async fn update_thread_goal( &self, thread_id: ThreadId, - update: ThreadGoalUpdate, + update: GoalUpdate, ) -> anyhow::Result> { - let ThreadGoalUpdate { + let GoalUpdate { objective, status, token_budget, @@ -556,7 +556,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Paused), token_budget: Some(Some(200_000)), @@ -732,7 +732,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Complete), token_budget: None, @@ -756,7 +756,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Complete), token_budget: None, @@ -853,7 +853,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: Some("draft the report clearly".to_string()), status: Some(crate::ThreadGoalStatus::Paused), token_budget: Some(Some(200)), @@ -891,7 +891,7 @@ mod tests { let status_update = runtime.thread_goals().update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Paused), token_budget: None, @@ -900,7 +900,7 @@ mod tests { ); let budget_update = runtime.thread_goals().update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: None, token_budget: Some(Some(200_000)), @@ -954,7 +954,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Complete), token_budget: None, @@ -1165,7 +1165,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - crate::ThreadGoalUpdate { + crate::GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Paused), token_budget: None, @@ -1225,7 +1225,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: None, token_budget: Some(Some(40)), @@ -1272,7 +1272,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: Some("stay within budget, with clearer wording".to_string()), status: Some(crate::ThreadGoalStatus::Active), token_budget: None, @@ -1323,7 +1323,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Paused), token_budget: None, @@ -1373,7 +1373,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Blocked), token_budget: None, @@ -1463,7 +1463,7 @@ mod tests { .thread_goals() .update_thread_goal( thread_id, - ThreadGoalUpdate { + GoalUpdate { objective: None, status: Some(crate::ThreadGoalStatus::Paused), token_budget: None,