Fix compatibility issue with URL attachments wrong number of arguments#250
Merged
crmne merged 3 commits intocrmne:mainfrom Jul 16, 2025
Merged
Conversation
- Fix ArgumentError: wrong number of arguments (given 2, expected 0..1) that occurs when Marcel processes URI objects in Ruby 3.3+ - Use filename-based MIME detection for URLs instead of passing URI objects to Marcel - Add test that reproduces the issue and validates the fix - Maintains backward compatibility and improves performance by avoiding network calls
3 tasks
crmne
requested changes
Jun 24, 2025
Owner
crmne
left a comment
There was a problem hiding this comment.
Thank you for this!
I suggested a readability improvement.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #250 +/- ##
=======================================
Coverage 89.72% 89.72%
=======================================
Files 75 75
Lines 2812 2812
Branches 555 556 +1
=======================================
Hits 2523 2523
Misses 289 289 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
crmne
approved these changes
Jul 16, 2025
parruda
pushed a commit
to parruda/ruby_llm
that referenced
this pull request
Nov 18, 2025
crmne#250) - Fix ArgumentError: wrong number of arguments (given 2, expected 0..1) that occurs when Marcel processes URI objects - Use filename-based MIME detection for URLs instead of passing URI objects to Marcel - Add test that reproduces the issue and validates the fix - Maintains backward compatibility and improves performance by avoiding network calls <img width="1316" alt="Screenshot 2025-06-16 at 9 34 13 AM" src="https://github.com/user-attachments/assets/b0d29eeb-66aa-45b5-aed9-5c33adf0c0b7" /> ## What this does <!-- Clear description of what this PR does and why --> ## Type of change - [x] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation - [ ] Performance improvement ## Scope check - [x] I read the [Contributing Guide](https://github.com/crmne/ruby_llm/blob/main/CONTRIBUTING.md) - [x] This aligns with RubyLLM's focus on **LLM communication** - [x] This isn't application-specific logic that belongs in user code - [x] This benefits most users, not just my specific use case ## Quality check - [x] I ran `overcommit --install` and all hooks pass - [x] I tested my changes thoroughly - [ ] I updated documentation if needed - [x] I didn't modify auto-generated files manually (`models.json`, `aliases.json`) ## API changes - [ ] Breaking change - [ ] New public methods/classes - [ ] Changed method signatures - [x] No API changes ## Related issues Fixes crmne#247 --------- Co-authored-by: Carmine Paolino <carmine@paolino.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Type of change
Scope check
Quality check
overcommit --installand all hooks passmodels.json,aliases.json)API changes
Related issues
Fixes #247