Skip to content

Preserve OpenRouter error messages#1059

Draft
xmarquez wants to merge 1 commit into
tidyverse:mainfrom
xmarquez:codex/fix-openrouter-error-message
Draft

Preserve OpenRouter error messages#1059
xmarquez wants to merge 1 commit into
tidyverse:mainfrom
xmarquez:codex/fix-openrouter-error-message

Conversation

@xmarquez

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the provider-supplied message when OpenRouter returns an error object.
  • Add a snapshot test for this response-error path.

Root cause

check_openrouter_error() extracted error$message, but passed the literal string "message" to abort(). This masked the provider's actual error text.

Validation

  • Ran air format on the modified R files.
  • Loaded the package and verified that the resulting condition preserves the provider message.

@xmarquez

Copy link
Copy Markdown
Contributor Author

Hello @thisisnic - apologies if I needed to raise an issue first; this seemed like a very simple bug I ran into using openrouter for a project (provider error messages were not preserved). Let me know if I need to do anything differently.

@hadley

hadley commented Jul 14, 2026

Copy link
Copy Markdown
Member

Doh.

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.

2 participants