@@ -6313,10 +6313,9 @@ type ResponseInputItemUnion struct {
63136313 Outputs []ResponseCodeInterpreterToolCallOutputUnion `json:"outputs"`
63146314 ServerLabel string `json:"server_label"`
63156315 // This field is from variant [ResponseInputItemMcpListTools].
6316- Tools []ResponseInputItemMcpListToolsTool `json:"tools"`
6317- Error string `json:"error"`
6318- // This field is from variant [ResponseInputItemMcpApprovalResponse].
6319- ApprovalRequestID string `json:"approval_request_id"`
6316+ Tools []ResponseInputItemMcpListToolsTool `json:"tools"`
6317+ Error string `json:"error"`
6318+ ApprovalRequestID string `json:"approval_request_id"`
63206319 // This field is from variant [ResponseInputItemMcpApprovalResponse].
63216320 Approve bool `json:"approve"`
63226321 // This field is from variant [ResponseInputItemMcpApprovalResponse].
@@ -7140,21 +7139,32 @@ type ResponseInputItemMcpCall struct {
71407139 ServerLabel string `json:"server_label,required"`
71417140 // The type of the item. Always `mcp_call`.
71427141 Type constant.McpCall `json:"type,required"`
7142+ // Unique identifier for the MCP tool call approval request. Include this value in
7143+ // a subsequent `mcp_approval_response` input to approve or reject the
7144+ // corresponding tool call.
7145+ ApprovalRequestID string `json:"approval_request_id,nullable"`
71437146 // The error from the tool call, if any.
71447147 Error string `json:"error,nullable"`
71457148 // The output from the tool call.
71467149 Output string `json:"output,nullable"`
7150+ // The status of the tool call. One of `in_progress`, `completed`, `incomplete`,
7151+ // `calling`, or `failed`.
7152+ //
7153+ // Any of "in_progress", "completed", "incomplete", "calling", "failed".
7154+ Status string `json:"status"`
71477155 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
71487156 JSON struct {
7149- ID respjson.Field
7150- Arguments respjson.Field
7151- Name respjson.Field
7152- ServerLabel respjson.Field
7153- Type respjson.Field
7154- Error respjson.Field
7155- Output respjson.Field
7156- ExtraFields map[string]respjson.Field
7157- raw string
7157+ ID respjson.Field
7158+ Arguments respjson.Field
7159+ Name respjson.Field
7160+ ServerLabel respjson.Field
7161+ Type respjson.Field
7162+ ApprovalRequestID respjson.Field
7163+ Error respjson.Field
7164+ Output respjson.Field
7165+ Status respjson.Field
7166+ ExtraFields map[string]respjson.Field
7167+ raw string
71587168 } `json:"-"`
71597169}
71607170
@@ -7521,14 +7531,6 @@ func (u ResponseInputItemUnionParam) GetTools() []ResponseInputItemMcpListToolsT
75217531 return nil
75227532}
75237533
7524- // Returns a pointer to the underlying variant's property, if present.
7525- func (u ResponseInputItemUnionParam) GetApprovalRequestID() *string {
7526- if vt := u.OfMcpApprovalResponse; vt != nil {
7527- return &vt.ApprovalRequestID
7528- }
7529- return nil
7530- }
7531-
75327534// Returns a pointer to the underlying variant's property, if present.
75337535func (u ResponseInputItemUnionParam) GetApprove() *bool {
75347536 if vt := u.OfMcpApprovalResponse; vt != nil {
@@ -7641,6 +7643,8 @@ func (u ResponseInputItemUnionParam) GetStatus() *string {
76417643 return (*string)(&vt.Status)
76427644 } else if vt := u.OfLocalShellCallOutput; vt != nil {
76437645 return (*string)(&vt.Status)
7646+ } else if vt := u.OfMcpCall; vt != nil {
7647+ return (*string)(&vt.Status)
76447648 }
76457649 return nil
76467650}
@@ -7757,6 +7761,16 @@ func (u ResponseInputItemUnionParam) GetError() *string {
77577761 return nil
77587762}
77597763
7764+ // Returns a pointer to the underlying variant's property, if present.
7765+ func (u ResponseInputItemUnionParam) GetApprovalRequestID() *string {
7766+ if vt := u.OfMcpApprovalResponse; vt != nil {
7767+ return (*string)(&vt.ApprovalRequestID)
7768+ } else if vt := u.OfMcpCall; vt != nil && vt.ApprovalRequestID.Valid() {
7769+ return &vt.ApprovalRequestID.Value
7770+ }
7771+ return nil
7772+ }
7773+
77607774// Returns a subunion which exports methods to access subproperties
77617775//
77627776// Or use AsAny() to get the underlying value
@@ -8424,10 +8438,19 @@ type ResponseInputItemMcpCallParam struct {
84248438 Name string `json:"name,required"`
84258439 // The label of the MCP server running the tool.
84268440 ServerLabel string `json:"server_label,required"`
8441+ // Unique identifier for the MCP tool call approval request. Include this value in
8442+ // a subsequent `mcp_approval_response` input to approve or reject the
8443+ // corresponding tool call.
8444+ ApprovalRequestID param.Opt[string] `json:"approval_request_id,omitzero"`
84278445 // The error from the tool call, if any.
84288446 Error param.Opt[string] `json:"error,omitzero"`
84298447 // The output from the tool call.
84308448 Output param.Opt[string] `json:"output,omitzero"`
8449+ // The status of the tool call. One of `in_progress`, `completed`, `incomplete`,
8450+ // `calling`, or `failed`.
8451+ //
8452+ // Any of "in_progress", "completed", "incomplete", "calling", "failed".
8453+ Status string `json:"status,omitzero"`
84318454 // The type of the item. Always `mcp_call`.
84328455 //
84338456 // This field can be elided, and will marshal its zero value as "mcp_call".
@@ -8443,6 +8466,12 @@ func (r *ResponseInputItemMcpCallParam) UnmarshalJSON(data []byte) error {
84438466 return apijson.UnmarshalRoot(data, r)
84448467}
84458468
8469+ func init() {
8470+ apijson.RegisterFieldValidator[ResponseInputItemMcpCallParam](
8471+ "status", "in_progress", "completed", "incomplete", "calling", "failed",
8472+ )
8473+ }
8474+
84468475// An internal identifier for an item to reference.
84478476//
84488477// The property ID is required.
@@ -8689,10 +8718,9 @@ type ResponseItemUnion struct {
86898718 Outputs []ResponseCodeInterpreterToolCallOutputUnion `json:"outputs"`
86908719 ServerLabel string `json:"server_label"`
86918720 // This field is from variant [ResponseItemMcpListTools].
8692- Tools []ResponseItemMcpListToolsTool `json:"tools"`
8693- Error string `json:"error"`
8694- // This field is from variant [ResponseItemMcpApprovalResponse].
8695- ApprovalRequestID string `json:"approval_request_id"`
8721+ Tools []ResponseItemMcpListToolsTool `json:"tools"`
8722+ Error string `json:"error"`
8723+ ApprovalRequestID string `json:"approval_request_id"`
86968724 // This field is from variant [ResponseItemMcpApprovalResponse].
86978725 Approve bool `json:"approve"`
86988726 // This field is from variant [ResponseItemMcpApprovalResponse].
@@ -9275,21 +9303,32 @@ type ResponseItemMcpCall struct {
92759303 ServerLabel string `json:"server_label,required"`
92769304 // The type of the item. Always `mcp_call`.
92779305 Type constant.McpCall `json:"type,required"`
9306+ // Unique identifier for the MCP tool call approval request. Include this value in
9307+ // a subsequent `mcp_approval_response` input to approve or reject the
9308+ // corresponding tool call.
9309+ ApprovalRequestID string `json:"approval_request_id,nullable"`
92789310 // The error from the tool call, if any.
92799311 Error string `json:"error,nullable"`
92809312 // The output from the tool call.
92819313 Output string `json:"output,nullable"`
9314+ // The status of the tool call. One of `in_progress`, `completed`, `incomplete`,
9315+ // `calling`, or `failed`.
9316+ //
9317+ // Any of "in_progress", "completed", "incomplete", "calling", "failed".
9318+ Status string `json:"status"`
92829319 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
92839320 JSON struct {
9284- ID respjson.Field
9285- Arguments respjson.Field
9286- Name respjson.Field
9287- ServerLabel respjson.Field
9288- Type respjson.Field
9289- Error respjson.Field
9290- Output respjson.Field
9291- ExtraFields map[string]respjson.Field
9292- raw string
9321+ ID respjson.Field
9322+ Arguments respjson.Field
9323+ Name respjson.Field
9324+ ServerLabel respjson.Field
9325+ Type respjson.Field
9326+ ApprovalRequestID respjson.Field
9327+ Error respjson.Field
9328+ Output respjson.Field
9329+ Status respjson.Field
9330+ ExtraFields map[string]respjson.Field
9331+ raw string
92939332 } `json:"-"`
92949333}
92959334
@@ -9574,7 +9613,9 @@ type ResponseOutputItemUnion struct {
95749613 // This field is from variant [ResponseCodeInterpreterToolCall].
95759614 Outputs []ResponseCodeInterpreterToolCallOutputUnion `json:"outputs"`
95769615 ServerLabel string `json:"server_label"`
9577- Error string `json:"error"`
9616+ // This field is from variant [ResponseOutputItemMcpCall].
9617+ ApprovalRequestID string `json:"approval_request_id"`
9618+ Error string `json:"error"`
95789619 // This field is from variant [ResponseOutputItemMcpCall].
95799620 Output string `json:"output"`
95809621 // This field is from variant [ResponseOutputItemMcpListTools].
@@ -9601,6 +9642,7 @@ type ResponseOutputItemUnion struct {
96019642 ContainerID respjson.Field
96029643 Outputs respjson.Field
96039644 ServerLabel respjson.Field
9645+ ApprovalRequestID respjson.Field
96049646 Error respjson.Field
96059647 Output respjson.Field
96069648 Tools respjson.Field
@@ -9953,21 +9995,32 @@ type ResponseOutputItemMcpCall struct {
99539995 ServerLabel string `json:"server_label,required"`
99549996 // The type of the item. Always `mcp_call`.
99559997 Type constant.McpCall `json:"type,required"`
9998+ // Unique identifier for the MCP tool call approval request. Include this value in
9999+ // a subsequent `mcp_approval_response` input to approve or reject the
10000+ // corresponding tool call.
10001+ ApprovalRequestID string `json:"approval_request_id,nullable"`
995610002 // The error from the tool call, if any.
995710003 Error string `json:"error,nullable"`
995810004 // The output from the tool call.
995910005 Output string `json:"output,nullable"`
10006+ // The status of the tool call. One of `in_progress`, `completed`, `incomplete`,
10007+ // `calling`, or `failed`.
10008+ //
10009+ // Any of "in_progress", "completed", "incomplete", "calling", "failed".
10010+ Status string `json:"status"`
996010011 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
996110012 JSON struct {
9962- ID respjson.Field
9963- Arguments respjson.Field
9964- Name respjson.Field
9965- ServerLabel respjson.Field
9966- Type respjson.Field
9967- Error respjson.Field
9968- Output respjson.Field
9969- ExtraFields map[string]respjson.Field
9970- raw string
10013+ ID respjson.Field
10014+ Arguments respjson.Field
10015+ Name respjson.Field
10016+ ServerLabel respjson.Field
10017+ Type respjson.Field
10018+ ApprovalRequestID respjson.Field
10019+ Error respjson.Field
10020+ Output respjson.Field
10021+ Status respjson.Field
10022+ ExtraFields map[string]respjson.Field
10023+ raw string
997110024 } `json:"-"`
997210025}
997310026
0 commit comments