Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions codex-rs/core/src/goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion codex-rs/core/src/session/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion codex-rs/state/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ pub use model::ThreadMetadataBuilder;
pub use model::ThreadsPage;
pub use runtime::GoalAccountingMode;
pub use runtime::GoalStore;
pub use runtime::GoalUpdate;
pub use runtime::RemoteControlEnrollmentRecord;
pub use runtime::RuntimeDbPath;
pub use runtime::ThreadFilterOptions;
pub use runtime::ThreadGoalAccountingOutcome;
pub use runtime::ThreadGoalUpdate;
pub use runtime::goals_db_filename;
pub use runtime::goals_db_path;
pub use runtime::logs_db_filename;
Expand Down
3 changes: 2 additions & 1 deletion codex-rs/state/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ mod threads;

pub use goals::GoalAccountingMode;
pub use goals::GoalStore;
pub use goals::GoalUpdate;
pub use goals::ThreadGoalAccountingMode;
pub use goals::ThreadGoalAccountingOutcome;
pub use goals::ThreadGoalUpdate;
pub use remote_control::RemoteControlEnrollmentRecord;
pub use threads::ThreadFilterOptions;

Expand Down
32 changes: 16 additions & 16 deletions codex-rs/state/src/runtime/goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl GoalStore {
}
}

pub struct ThreadGoalUpdate {
pub struct GoalUpdate {
pub objective: Option<String>,
pub status: Option<crate::ThreadGoalStatus>,
pub token_budget: Option<Option<i64>>,
Expand Down Expand Up @@ -170,9 +170,9 @@ RETURNING
pub async fn update_thread_goal(
&self,
thread_id: ThreadId,
update: ThreadGoalUpdate,
update: GoalUpdate,
) -> anyhow::Result<Option<crate::ThreadGoal>> {
let ThreadGoalUpdate {
let GoalUpdate {
objective,
status,
token_budget,
Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -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,
Expand All @@ -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)),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1225,7 +1225,7 @@ mod tests {
.thread_goals()
.update_thread_goal(
thread_id,
ThreadGoalUpdate {
GoalUpdate {
objective: None,
status: None,
token_budget: Some(Some(40)),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading