@@ -911,9 +911,11 @@ type AgentExecutionStatus struct {
911911 // failure_message contains the reason the agent run failed to operate.
912912 FailureMessage string `json:"failureMessage"`
913913 // failure_reason contains a structured reason code for the failure.
914- FailureReason AgentExecutionStatusFailureReason `json:"failureReason"`
915- InputTokensUsed string `json:"inputTokensUsed"`
916- Iterations string `json:"iterations"`
914+ FailureReason AgentExecutionStatusFailureReason `json:"failureReason"`
915+ // goal projects the current native Codex thread goal, if any.
916+ Goal AgentExecutionStatusGoal `json:"goal"`
917+ InputTokensUsed string `json:"inputTokensUsed"`
918+ Iterations string `json:"iterations"`
917919 // judgement is the judgement of the agent run produced by the judgement prompt.
918920 Judgement string `json:"judgement"`
919921 // mcp_integration_statuses contains the status of all MCP integrations used by
@@ -957,6 +959,7 @@ type agentExecutionStatusJSON struct {
957959 CurrentOperation apijson.Field
958960 FailureMessage apijson.Field
959961 FailureReason apijson.Field
962+ Goal apijson.Field
960963 InputTokensUsed apijson.Field
961964 Iterations apijson.Field
962965 Judgement apijson.Field
@@ -1076,6 +1079,55 @@ func (r AgentExecutionStatusFailureReason) IsKnown() bool {
10761079 return false
10771080}
10781081
1082+ // goal projects the current native Codex thread goal, if any.
1083+ type AgentExecutionStatusGoal struct {
1084+ // objective is the current goal text tracked by the native Codex thread-goal
1085+ // subsystem.
1086+ Objective string `json:"objective"`
1087+ // status is the lifecycle state of the current goal.
1088+ Status AgentExecutionStatusGoalStatus `json:"status"`
1089+ // updated_at is the most recent native goal update timestamp, when available.
1090+ UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
1091+ JSON agentExecutionStatusGoalJSON `json:"-"`
1092+ }
1093+
1094+ // agentExecutionStatusGoalJSON contains the JSON metadata for the struct
1095+ // [AgentExecutionStatusGoal]
1096+ type agentExecutionStatusGoalJSON struct {
1097+ Objective apijson.Field
1098+ Status apijson.Field
1099+ UpdatedAt apijson.Field
1100+ raw string
1101+ ExtraFields map [string ]apijson.Field
1102+ }
1103+
1104+ func (r * AgentExecutionStatusGoal ) UnmarshalJSON (data []byte ) (err error ) {
1105+ return apijson .UnmarshalRoot (data , r )
1106+ }
1107+
1108+ func (r agentExecutionStatusGoalJSON ) RawJSON () string {
1109+ return r .raw
1110+ }
1111+
1112+ // status is the lifecycle state of the current goal.
1113+ type AgentExecutionStatusGoalStatus string
1114+
1115+ const (
1116+ AgentExecutionStatusGoalStatusGoalStatusUnspecified AgentExecutionStatusGoalStatus = "GOAL_STATUS_UNSPECIFIED"
1117+ AgentExecutionStatusGoalStatusGoalStatusActive AgentExecutionStatusGoalStatus = "GOAL_STATUS_ACTIVE"
1118+ AgentExecutionStatusGoalStatusGoalStatusPaused AgentExecutionStatusGoalStatus = "GOAL_STATUS_PAUSED"
1119+ AgentExecutionStatusGoalStatusGoalStatusCompleted AgentExecutionStatusGoalStatus = "GOAL_STATUS_COMPLETED"
1120+ AgentExecutionStatusGoalStatusGoalStatusBudgetExhausted AgentExecutionStatusGoalStatus = "GOAL_STATUS_BUDGET_EXHAUSTED"
1121+ )
1122+
1123+ func (r AgentExecutionStatusGoalStatus ) IsKnown () bool {
1124+ switch r {
1125+ case AgentExecutionStatusGoalStatusGoalStatusUnspecified , AgentExecutionStatusGoalStatusGoalStatusActive , AgentExecutionStatusGoalStatusGoalStatusPaused , AgentExecutionStatusGoalStatusGoalStatusCompleted , AgentExecutionStatusGoalStatusGoalStatusBudgetExhausted :
1126+ return true
1127+ }
1128+ return false
1129+ }
1130+
10791131// MCPIntegrationStatus represents the status of a single MCP integration within an
10801132// agent execution context
10811133type AgentExecutionStatusMcpIntegrationStatus struct {
0 commit comments