From 5e2b4ffb82b4eb7478b06bff9ce7d5c03db60e62 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 20 Jan 2026 14:17:06 -0300 Subject: [PATCH] feat: support attachments Signed-off-by: Carlos Alexandro Becker --- cmd/copilot/main.go | 31 ++++++++++++++++++++++++ internal/providers/configs/copilot.json | 32 +++++++++++++++---------- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/cmd/copilot/main.go b/cmd/copilot/main.go index 21cd4cb56fe88f065d0f2d8c17b125c11688ff5f..9bf4443d306a3508d9b39347fd315f51618ad60a 100644 --- a/cmd/copilot/main.go +++ b/cmd/copilot/main.go @@ -157,6 +157,7 @@ func modelsToCatwalk(m []Model) []catwalk.Model { func modelToCatwalk(m Model) catwalk.Model { canReason, reasoningLevels, defaultReasoning := detectReasoningCapabilities(m) + supportsAttachments := detectAttachmentSupport(m) return catwalk.Model{ ID: m.ID, @@ -166,6 +167,7 @@ func modelToCatwalk(m Model) catwalk.Model { CanReason: canReason, ReasoningLevels: reasoningLevels, DefaultReasoningEffort: defaultReasoning, + SupportsImages: supportsAttachments, } } @@ -191,6 +193,35 @@ func detectReasoningCapabilities(m Model) (canReason bool, levels []string, defa return false, nil, "" } +func detectAttachmentSupport(m Model) bool { + // Claude models support attachments (vision/multimodal) + if strings.HasPrefix(m.ID, "claude-") { + return true + } + + // Gemini models support attachments (vision/multimodal) + if strings.HasPrefix(m.ID, "gemini-") { + return true + } + + // GPT-5 models support attachments (based on OpenRouter pattern) + if strings.HasPrefix(m.ID, "gpt-5") { + return true + } + + // Older GPT models do not support attachments + if strings.HasPrefix(m.ID, "gpt-4") || strings.HasPrefix(m.ID, "gpt-3.5") { + return false + } + + // Grok models - only grok-4 supports attachments + if m.ID == "grok-4" || strings.HasPrefix(m.ID, "grok-4-") { + return true + } + + return false +} + func copilotToken() string { if token := os.Getenv("COPILOT_TOKEN"); token != "" { return token diff --git a/internal/providers/configs/copilot.json b/internal/providers/configs/copilot.json index a239a907a431bbef71f7c39fdb7f399285db3c7f..f90ead1a14b1a5b27b6566f73e325f322672d6a2 100644 --- a/internal/providers/configs/copilot.json +++ b/internal/providers/configs/copilot.json @@ -16,7 +16,7 @@ "context_window": 144000, "default_max_tokens": 16000, "can_reason": true, - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -29,7 +29,7 @@ "context_window": 160000, "default_max_tokens": 16000, "can_reason": true, - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -42,7 +42,7 @@ "context_window": 216000, "default_max_tokens": 16000, "can_reason": true, - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -55,7 +55,7 @@ "context_window": 144000, "default_max_tokens": 16000, "can_reason": true, - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -68,7 +68,7 @@ "context_window": 128000, "default_max_tokens": 64000, "can_reason": true, - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -113,7 +113,7 @@ "high" ], "default_reasoning_effort": "medium", - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -132,7 +132,7 @@ "high" ], "default_reasoning_effort": "medium", - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -151,7 +151,7 @@ "high" ], "default_reasoning_effort": "medium", - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -170,7 +170,7 @@ "high" ], "default_reasoning_effort": "medium", - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -189,7 +189,7 @@ "high" ], "default_reasoning_effort": "medium", - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -208,7 +208,7 @@ "high" ], "default_reasoning_effort": "medium", - "supports_attachments": false, + "supports_attachments": true, "options": {} }, { @@ -220,8 +220,14 @@ "cost_per_1m_out_cached": 0, "context_window": 400000, "default_max_tokens": 128000, - "can_reason": false, - "supports_attachments": false, + "can_reason": true, + "reasoning_levels": [ + "low", + "medium", + "high" + ], + "default_reasoning_effort": "medium", + "supports_attachments": true, "options": {} }, {