@@ -62,6 +62,15 @@ var (
62 errSmallModelNotFound = errors.New("small model not found in provider config")
62 errSmallModelNotFound = errors.New("small model not found in provider config")
65+// Copilot models that use the Responses API instead of Chat Completions.
66+var copilotResponsesModels = map[string]bool{
68+ "gpt-5.2-codex": true,
69+ "gpt-5.3-codex": true,
70+ "gpt-5.4-mini": true,
65type Coordinator interface {
74type Coordinator interface {
66 // INFO: (kujtim) this is not used yet we will use this when we have multiple agents
75 // INFO: (kujtim) this is not used yet we will use this when we have multiple agents
67 // SetMainAgent(string)
76 // SetMainAgent(string)
@@ -731,7 +740,12 @@ func (c *coordinator) buildOpenaiCompatProvider(baseURL, apiKey string, headers
731 // Set HTTP client based on provider and debug mode.
740 // Set HTTP client based on provider and debug mode.
732 var httpClient *http.Client
741 var httpClient *http.Client
733 if providerID == string(catwalk.InferenceProviderCopilot) {
742 if providerID == string(catwalk.InferenceProviderCopilot) {
734− opts = append(opts, openaicompat.WithUseResponsesAPI())
744+ openaicompat.WithUseResponsesAPI(),
745+ openaicompat.WithResponsesAPIFunc(func(modelID string) bool {
746+ return copilotResponsesModels[modelID]
735 httpClient = copilot.NewClient(isSubAgent, c.cfg.Config().Options.Debug)
749 httpClient = copilot.NewClient(isSubAgent, c.cfg.Config().Options.Debug)
736 } else if c.cfg.Config().Options.Debug {
750 } else if c.cfg.Config().Options.Debug {
737 httpClient = log.NewHTTPClient()
751 httpClient = log.NewHTTPClient()