Skip to content

Harden Echo AI provider request and error handling - #1642

Closed
aapomm wants to merge 4 commits into
developfrom
echo/harden-provider-requests
Closed

Harden Echo AI provider request and error handling#1642
aapomm wants to merge 4 commits into
developfrom
echo/harden-provider-requests

Conversation

@aapomm

@aapomm aapomm commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves how the Dradis Echo AI provider integration handles requests and errors (relates to #1641).

  • Generic error messaging. InteractionJob previously broadcast the upstream provider's raw response/error to the browser. It now logs the detail server-side and shows the user a generic "Something went wrong." message.
  • Consistent Anthropic endpoint. Provider::Anthropic now treats address as a base URL and appends /messages, matching how the OpenAI and Gemini providers build their request URLs. delete_suffix('/messages') keeps existing providers (and full-URL entries) working.

Testing steps

  1. Configure a provider whose address points at an endpoint that returns an error (any non-2xx).
  2. Run a Dradis Echo interaction on a project.
  3. Expected: the browser shows a generic "Something went wrong." message; the full error appears in the server log.
  4. Confirm Anthropic requests resolve to .../v1/messages whether the address is set to the base URL or the full endpoint.

Other Information

Full dradis-echo suite passes (101 examples), rubocop clean.

I assign all rights, including copyright, to any future Dradis work by myself to Security Roots.

Check List

  • Added a CHANGELOG entry
  • Commit message has a detailed description of what changed and why.

aapomm added 4 commits July 6, 2026 20:56
Upstream error bodies were broadcast verbatim to the client, leaking internal service responses. Log the detail server-side and show a generic message instead.
build_uri used the address verbatim, giving full request-path control. Treat address as a base URL and append /messages, matching the other providers.
Base automatically changed from release-5.2.0 to develop July 8, 2026 18:55
@aapomm

aapomm commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1648

@aapomm aapomm closed this Aug 4, 2026
@aapomm
aapomm deleted the echo/harden-provider-requests branch August 4, 2026 10:03
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.

1 participant