Skip to content

Conversation

@causehacker
Copy link

Summary

Rearchitects Fast QA's test execution to use SSE streaming, fixing 504 Gateway Timeout errors on Vercel's free tier.

Changes

New: /api/execute-test (SSE streaming)

  • Executes a single test case against Mino and streams events back to the client in real-time
  • Edge Runtime with text/event-stream response - keeps connection alive, no timeout
  • Events: test_start, streaming_url, step_progress, test_complete, test_error
  • API key stays server-side (client never sees MINO_API_KEY)

Updated: useTestExecution hook

  • Consumes SSE streams instead of blocking JSON responses
  • Client-side parallelism (3 concurrent tests by default)
  • Real-time step-by-step progress updates in the UI
  • Same external API - no component changes needed

Bug fixes

  • gpt-5-nano → gpt-4.1-nano: Reasoning models return empty content field, breaking AI SDK's generateText
  • generate-report type error: extractedData wasn't being parsed correctly
  • Frontend data key mismatch: API returns testCases but frontend expected tests

Deprecated

  • /api/execute-tests (plural) marked deprecated - blocks until all tests complete, causing 504s on Vercel free tier (30s edge limit)

Problem

The original /api/execute-tests endpoint runs all tests server-side, consuming Mino's SSE stream internally. Mino browser automation typically takes 30-90s per test, exceeding Vercel's free tier edge timeout (30s).

Solution

Move SSE consumption to the client by streaming Mino events through the edge function. Edge functions can stream responses indefinitely as long as data flows, sidestepping the execution timeout.

- Add /api/execute-test endpoint with SSE streaming to avoid Vercel timeout issues
- Client-side parallelism (3 concurrent) with real-time step progress
- Fix gpt-5-nano (reasoning model) returning empty content - switch to gpt-4.1-nano
- Fix type error in generate-report route (extractedData parsing)
- Fix frontend data key mismatch (testCases vs tests)
- Mark old /api/execute-tests as deprecated

The original /api/execute-tests blocks until all tests complete, causing
504 Gateway Timeout on Vercel free tier (30s edge limit). The new
/api/execute-test (singular) streams Mino SSE events to the client,
keeping the connection alive and providing real-time progress updates.
@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@causehacker
Copy link
Author

We were deploying Fast QA on Vercel's free tier and ran into 504 timeouts - Mino automation typically takes 30-90s which exceeds the 30s edge function limit.

Rearchitected test execution to stream Mino's SSE events through the edge function to the client, which keeps the connection alive and has the nice side effect of giving users real-time step progress. Also fixed a few bugs we hit along the way (gpt-5-nano returns empty content on reasoning models, type error in report generation, and a testCases vs tests key mismatch in the frontend).

Ran a bunch of tests and all came back healthy, hope this helps!

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