@@ -1722,11 +1722,17 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
1723 switch {
1723 switch {
1724 case key.Matches(msg, m.keyMap.Editor.AddImage):
1724 case key.Matches(msg, m.keyMap.Editor.AddImage):
1725+ if !m.currentModelSupportsImages() {
1725 if cmd := m.openFilesDialog(); cmd != nil {
1728 if cmd := m.openFilesDialog(); cmd != nil {
1726 cmds = append(cmds, cmd)
1729 cmds = append(cmds, cmd)
1729 case key.Matches(msg, m.keyMap.Editor.PasteImage):
1732 case key.Matches(msg, m.keyMap.Editor.PasteImage):
1733+ if !m.currentModelSupportsImages() {
1730 cmds = append(cmds, m.pasteImageFromClipboard)
1736 cmds = append(cmds, m.pasteImageFromClipboard)
1732 case key.Matches(msg, m.keyMap.Editor.SendMessage):
1738 case key.Matches(msg, m.keyMap.Editor.SendMessage):
@@ -2259,15 +2265,15 @@ func (m *UI) FullHelp() [][]key.Binding {
2260 switch m.focus {
2266 switch m.focus {
2261 case uiFocusEditor:
2267 case uiFocusEditor:
2262− binds = append(binds,
2263− []key.Binding{
2268+ editorBinds := []key.Binding{
2264− k.Editor.Newline,
2269+ k.Editor.Newline,
2265− k.Editor.AddImage,
2270+ k.Editor.MentionFile,
2271+ k.Editor.OpenEditor,
2273+ if m.currentModelSupportsImages() {
2266− k.Editor.PasteImage,
2274+ editorBinds = append(editorBinds, k.Editor.AddImage, k.Editor.PasteImage)
2267− k.Editor.MentionFile,
2268− k.Editor.OpenEditor,
2270− )
2276+ binds = append(binds, editorBinds)
2271 if hasAttachments {
2277 if hasAttachments {
2272 binds = append(binds,
2278 binds = append(binds,
2273 []key.Binding{
2279 []key.Binding{
@@ -2309,14 +2315,16 @@ func (m *UI) FullHelp() [][]key.Binding {
2309 k.Models,
2315 k.Models,
2310 k.Sessions,
2316 k.Sessions,
2315− k.Editor.PasteImage,
2316− k.Editor.MentionFile,
2317− k.Editor.OpenEditor,
2319+ editorBinds := []key.Binding{
2321+ k.Editor.MentionFile,
2322+ k.Editor.OpenEditor,
2324+ if m.currentModelSupportsImages() {
2325+ editorBinds = append(editorBinds, k.Editor.AddImage, k.Editor.PasteImage)
2327+ binds = append(binds, editorBinds)
2320 if hasAttachments {
2328 if hasAttachments {
2321 binds = append(binds,
2329 binds = append(binds,
2322 []key.Binding{
2330 []key.Binding{
@@ -2339,6 +2347,19 @@ func (m *UI) FullHelp() [][]key.Binding {
2339 return binds
2347 return binds
2350+func (m *UI) currentModelSupportsImages() bool {
2351+ cfg := m.com.Config()
2355+ agentCfg, ok := cfg.Agents[config.AgentCoder]
2359+ model := cfg.GetModelByType(agentCfg.Model)
2360+ return model != nil && model.SupportsImages
2342// toggleCompactMode toggles compact mode between uiChat and uiChatCompact states.
2363// toggleCompactMode toggles compact mode between uiChat and uiChatCompact states.
2343func (m *UI) toggleCompactMode() tea.Cmd {
2364func (m *UI) toggleCompactMode() tea.Cmd {
2344 m.forceCompactMode = !m.forceCompactMode
2365 m.forceCompactMode = !m.forceCompactMode