Skip to content

fix(agent): recover after image-input-unsupported failures#2525

Merged
afjcjsbx merged 4 commits intosipeed:mainfrom
afjcjsbx:fix/vision-unsupported-media-stuck
Apr 15, 2026
Merged

fix(agent): recover after image-input-unsupported failures#2525
afjcjsbx merged 4 commits intosipeed:mainfrom
afjcjsbx:fix/vision-unsupported-media-stuck

Conversation

@afjcjsbx
Copy link
Copy Markdown
Collaborator

📝 Description

This PR fixes a failure mode where sending an image to a non-vision model (e.g., OpenRouter models without image support) causes the session to get “stuck”: subsequent text-only messages keep failing because the previous image remains in the persisted session history.

When the provider returns a “vision/image input not supported” error, PicoClaw now strips media attachments from the session history and retries the LLM call once without media, allowing the conversation to continue.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

📚 Technical Context (Skip for Docs)

  • Reference URL: N/A
  • Reasoning: Some providers/models do not support multimodal image_url inputs and return errors like “No endpoints found that support image input”. Because the image is stored in the session history, later turns keep sending it and keep failing. Stripping media from persisted history on this specific error prevents repeated failures and keeps the session usable.

🧪 Test Environment

  • Hardware:
  • OS: macOS
  • Model/Provider:
  • Channels:

📸 Evidence (Optional)

Click to view Logs/Screenshots

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@afjcjsbx afjcjsbx requested review from alexhoshina and yinwm April 14, 2026 20:17
Copy link
Copy Markdown
Collaborator

@alexhoshina alexhoshina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@afjcjsbx afjcjsbx merged commit bb14a5c into sipeed:main Apr 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants