Description
When using a custom inference provider (OpenAI-compatible Base URL), the AI Assistant fails with:
OpenAI request failed: HTTP 302
Browsers and many HTTP clients treat 302 as a normal temporary redirect. DBeaver’s AI client does not follow it for completion requests and surfaces it as an error, which is confusing and breaks common gateway / reverse-proxy setups.
Expected behavior
Either:
- Follow redirects for AI HTTP calls in a safe way (prefer preserving method/body, e.g. treat like
307, or follow 302/301 without converting POST → GET), or
- Keep current non-follow behavior, but show a clear error, e.g.:
Received HTTP 302 redirect to <Location>. Set API base URL to the final endpoint (redirects are not followed for POST).
Actual behavior
Any non-200 status is mapped to DBException, including 302, so a simple redirect looks like an OpenAI API failure.
Relevant code path (current devel):
MonitoredHttpClient.send() accepts only statusCode == 200, otherwise throws via errorMapper
AbstractHttpAIClient uses HttpClient.newHttpClient() (default redirect policy)
- Java
HttpClient with Redirect.NORMAL does not follow 301/302 for POST (completion requests are POST)
Why this matters for custom providers
Custom Base URLs often go through proxies/gateways that return 302 for things like:
http → https
- trailing slash / path normalization
- host canonicalization (
www / non-www)
- internal routing in corporate LLM gateways
Users then see a cryptic “OpenAI request failed” even though the service itself is fine once the final URL is used.
DBeaver Version
Community Edition Version 26.1.5.202608161900
Operating System
Debian 13
Database and driver
Not applicable
Steps to reproduce
- Configure AI Engine → OpenAI (or compatible)
- Set API base URL to an endpoint that answers completion POST with
302 + Location (e.g. HTTP URL that redirects to HTTPS, or a gateway that normalizes the path)
- Click Test connection or run AI completion
- Observe:
OpenAI request failed: HTTP 302
Additional context
No response
Description
When using a custom inference provider (OpenAI-compatible Base URL), the AI Assistant fails with:
Browsers and many HTTP clients treat
302as a normal temporary redirect. DBeaver’s AI client does not follow it for completion requests and surfaces it as an error, which is confusing and breaks common gateway / reverse-proxy setups.Expected behavior
Either:
307, or follow302/301without converting POST → GET), orReceived HTTP 302 redirect to <Location>. Set API base URL to the final endpoint (redirects are not followed for POST).Actual behavior
Any non-
200status is mapped toDBException, including302, so a simple redirect looks like an OpenAI API failure.Relevant code path (current
devel):MonitoredHttpClient.send()accepts onlystatusCode == 200, otherwise throws viaerrorMapperAbstractHttpAIClientusesHttpClient.newHttpClient()(default redirect policy)HttpClientwithRedirect.NORMALdoes not follow301/302for POST (completion requests are POST)Why this matters for custom providers
Custom Base URLs often go through proxies/gateways that return
302for things like:http→httpswww/ non-www)Users then see a cryptic “OpenAI request failed” even though the service itself is fine once the final URL is used.
DBeaver Version
Community Edition Version 26.1.5.202608161900
Operating System
Debian 13
Database and driver
Not applicable
Steps to reproduce
302+Location(e.g. HTTP URL that redirects to HTTPS, or a gateway that normalizes the path)OpenAI request failed: HTTP 302Additional context
No response