firebase / firebase/firebase-js-sdk
AI: Failed to parse stream (AI/parse-failed)
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### Operating System
macOS
### Environment (if applicable)
Chrome
### Firebase SDK Version
12
### Firebase SDK Product(s)
AI
### Project Tooling
Expo with Firebase web js.
### Detailed Problem Description
I am giving the model a prompt which is expected to generate a very long response. I have tried non-streaming and streaming mode and the failure occurs exactly after 3 minutes. Firebase transactions have 3 minute timeout but I am not using them. I have set the timeout to 20 minutes for the model.
In non-streaming mode the request failed with 502 error and in streaming mode I stop getting new Eventstream messages and a `FirebaseError: AI: Failed to parse stream (AI/parse-failed)`.
### Steps and code to reproduce issue
Prompt requesting long response.
Gemini 2.5 pro, thinking budget 32728, safety: block none, timeout: 1200 * 1e3
Contributor guide
Research direction
The report names no source files or tests; begin by locating the Firebase AI streaming implementation and its handling of EventStream messages and parse failures. Reproduce with Gemini 2.5 Pro, the stated thinking budget, and a prompt producing a very long response, then verify that streaming does not fail after three minutes and that the non-streaming request no longer returns 502.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100