AI Validation Fails with Open AI-Compatible endpoint
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
Research direction
Start by finding the backend handler that tests AI providers and the code that sends the OpenAI-compatible chat completion request; compare its request and redirect handling with the working cURL example in the issue. Reproduce the failure against an OpenAI-compatible endpoint that redirects, then confirm the provider test succeeds and its existing failure cases still behave correctly.
Written by the indexing model from the issue text.
Description
Describe the bug
I'm trying to use a cloud-based AI provider that is Open AI-compatible, but the test fails when I try to add it via the MailFlow settings panel. The provider I'm testing with is "The Grid" (https://thegrid.ai).
Observed behaviors:
- In the UI, I get the response: "Connection failed: AI provider test failed"
- Nothing shows in the backend or frontend Docker containers
- In the browser DevTools I get 502 Bad Gateway and the JSON response,
{"error":"AI provider test failed"}
This cUrl POST request from a CLI works fine:
curl -L -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_key_here" \
-d '{
"model": "text-standard",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 50
}' \
https://api.thegrid.ai/v1/chat/completions
... which yields a response like this:
{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Hello! 👋 How can I assist you today?","provider_specific_fields":{"name":null,"refusal":null},"reasoning_content":"The user says \"Hello!\" Likely a greeting. We should respond politely. Ask how can help.","role":"assistant"},"provider_specific_fields":{}}],"created":1787572938,"id":"chatcmpl-RMAk1dOyKsGC3w7pr5veLClx","model":"openai/gpt-oss-120b","object":"chat.completion","service_tier":"default","usage":{"completion_tokens":42,"estimated_cost":9.212000000000001e-6,"prompt_tokens":56,"total_tokens":98}}
Possibly-related information:
- If I do the above curl test from a CLI WITHOUT the
-L(adding this allows curl to follow redirects), I get an HTML response saying I'm being redirected -- so I SUSPECT whatever test MailFlow is doing may not be following redirects, and hence it is not getting a valid response, and is interpreting it as a failure.
- Dominant language
- JavaScript
- Stars
- 518
- Forks
- 50
- Avg merge
- 4d 45m
- Merged PRs (30d)
- 43
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from maathimself/mailflow
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
maathimself/mailflow#801 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
maathimself/mailflow#784 ·
Maintainers usually reply within 1 day
-
defaultShortcuts tests fail on macOSPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
maathimself/mailflow#783 ·
Maintainers usually reply within 1 day
-
Stored mail loses blockquote type=cite, so AI actions read Apple Mail and Thunderbird quoted historyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
maathimself/mailflow#782 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
maathimself/mailflow#799 ·
Maintainers usually reply within 1 day
All issues in maathimself/mailflow
Similar issues
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blixvip/solana-tx-parse#18 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blixvip/solana-rpc-bench#18 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100