Something went wrong. Try again.
sloproxy
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930package helps
import ( "fmt"
"github.com/tidwall/gjson" "github.com/tidwall/sjson")
// SanitizeCodexResponseInputNamespaces removes namespaces from tool-call// history items that the Codex Responses endpoint rejects.func SanitizeCodexResponseInputNamespaces(body []byte) []byte { items := gjson.GetBytes(body, "input") if !items.IsArray() { return body }
for index, item := range items.Array() { itemType := item.Get("type").String() if itemType != "function_call" && itemType != "custom_tool_call" { continue } updated, errDelete := sjson.DeleteBytes(body, fmt.Sprintf("input.%d.namespace", index)) if errDelete == nil { body = updated } } return body}