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