Skip to content

Conversation

@vrurg
Copy link
Contributor

@vrurg vrurg commented Aug 3, 2025

Make the provider not only play well with canonical URLs but also implement the ground for safer URL management in the future.

Fixes #655.

@vrurg
Copy link
Contributor Author

vrurg commented Aug 3, 2025

I have accidentally spotted a fix for the same problem in the openai provider. But I believe the approach proposed here is cleaner because it would intercept badly formed URLs while the agent is being built, not when an HTTP request gets submitted. This would significantly reduce debugging times in particular for both RIG users and developers because accidentally malformed post paths would also be nailed down early and clearly.

@vrurg
Copy link
Contributor Author

vrurg commented Aug 3, 2025

Unfortunately, I cannot extend this PR to other providers due to lack of time. It looks like it can be copy/pasted into the openai code though.

@joshua-mo-143
Copy link
Contributor

What version of Rust are you using? You might need to update to get the fmt test to pass

Copy link
Contributor

@joshua-mo-143 joshua-mo-143 left a comment

Choose a reason for hiding this comment

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

lgtm once it passes CI

Make the provider not only play well with canonical URLs but also
implement the ground for safer URL management in the future.

Fixes 0xPlaygrounds#655.
@vrurg vrurg force-pushed the provider_ollama_url branch from 2cdf29a to d3997bd Compare August 4, 2025 14:13
@vrurg
Copy link
Contributor Author

vrurg commented Aug 4, 2025

It would be great to have a .rustfmt.toml in the root of the project. I accidentally left my own fmt config in ~/src/rust where I keep all Rust-related projects and this is what caused problems with formatting. Having local project config would prevent such accidents in the future.

Anyway, must be OK now.

@joshua-mo-143 joshua-mo-143 merged commit e3add1f into 0xPlaygrounds:main Aug 4, 2025
5 checks passed
@github-actions github-actions bot mentioned this pull request Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Ollama provider is unfriendly to "/"-terminated URLs

2 participants