mirror of
https://github.com/openai/codex.git
synced 2026-05-02 18:37:01 +00:00
Add goal mode app-server API
This commit is contained in:
@@ -1465,6 +1465,9 @@ pub enum EventMsg {
|
||||
/// Updated session metadata (e.g., thread name changes).
|
||||
ThreadNameUpdated(ThreadNameUpdatedEvent),
|
||||
|
||||
/// Updated long-running goal metadata for the thread.
|
||||
ThreadGoalUpdated(ThreadGoalUpdatedEvent),
|
||||
|
||||
/// Incremental MCP startup progress updates.
|
||||
McpStartupUpdate(McpStartupUpdateEvent),
|
||||
|
||||
@@ -3512,6 +3515,40 @@ pub struct ThreadNameUpdatedEvent {
|
||||
pub thread_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "protocol/")]
|
||||
pub enum ThreadGoalStatus {
|
||||
Active,
|
||||
Paused,
|
||||
#[serde(alias = "budgetExceeded")]
|
||||
BudgetStopped,
|
||||
Complete,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "protocol/")]
|
||||
pub struct ThreadGoal {
|
||||
pub thread_id: ThreadId,
|
||||
pub objective: String,
|
||||
pub status: ThreadGoalStatus,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub token_budget: Option<i64>,
|
||||
pub tokens_used: i64,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "protocol/")]
|
||||
pub struct ThreadGoalUpdatedEvent {
|
||||
pub thread_id: ThreadId,
|
||||
pub goal: ThreadGoal,
|
||||
}
|
||||
|
||||
/// User's decision in response to an ExecApprovalRequest.
|
||||
#[derive(Debug, Default, Clone, Deserialize, Serialize, PartialEq, Eq, Display, JsonSchema, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
@@ -3614,6 +3651,7 @@ pub enum TurnAbortReason {
|
||||
Interrupted,
|
||||
Replaced,
|
||||
ReviewEnded,
|
||||
BudgetExceeded,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)]
|
||||
|
||||
Reference in New Issue
Block a user