Skip to content

feat(ai) Live Service Going Away notifications#9461

Merged
DellaBitta merged 7 commits intomainfrom
ddb-ai-goingaway
Jan 29, 2026
Merged

feat(ai) Live Service Going Away notifications#9461
DellaBitta merged 7 commits intomainfrom
ddb-ai-goingaway

Conversation

@DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Jan 21, 2026

Discussion

Support the handling of Going Away notifications in the Live Service. The service may send this event when the session is coming to a close due to timeout or nearing a token limit.

Testing

Unit tests added.
Manual testing.

API Changes

See internal API proposal.

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: 55cf871

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@firebase/ai Minor
firebase Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @DellaBitta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates 'Going Away' notifications into the AI SDK's Live Service. This enhancement provides a mechanism for the service to proactively alert clients about impending session terminations, improving user experience by allowing applications to gracefully handle session closures. The changes involve updating the API contract, implementing the new notification type within the LiveSession class, and ensuring comprehensive test coverage.

Highlights

  • New Feature: Going Away Notifications: Introduced support for GOING_AWAY_NOTICE in the Live Service, allowing the service to inform clients when a session is about to end due to timeout or token limits.
  • API Definition Update: The common/api-review/ai.api.md file has been updated to include the new LiveServerGoingAwayNotice interface and GOING_AWAY_NOTICE type in LiveResponseType.
  • LiveSession.receive() Enhancement: The LiveSession.receive() method now yields LiveServerGoingAwayNotice objects, expanding the types of messages clients can receive from the Live Service.
  • Testing Coverage: Unit tests have been added and integration tests updated to handle the new goingAwayNotice type, ensuring proper functionality and API adherence.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

Vertex AI Mock Responses Check ⚠️

A newer major version of the mock responses for Vertex AI unit tests is available. update_vertexai_responses.sh should be updated to clone the latest version of the responses: v16.0

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for GOING_AWAY_NOTICE notifications in the Live Service, which is a useful addition for handling session lifecycle events. The changes are well-implemented across the API definitions, implementation, and tests. My main feedback is to add the @beta tag to the new LiveServerGoingAwayNotice interface for consistency with the rest of the Live API, which is currently in beta. This will ensure correct API documentation generation.

@DellaBitta DellaBitta marked this pull request as ready for review January 27, 2026 19:54
@DellaBitta DellaBitta requested review from a team as code owners January 27, 2026 19:54
'firebase': minor
---

AI Logic: Extend the `LiveSession.recieve()` return types to include a `LiveServiceGoingAwayNotice`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spelling of receive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

* @param duration - The duration string to parse.
* @returns The duration in seconds.
*/
function parseDuration(duration: string | undefined): number {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew I remembered this from somewhere. Should we make this a shared util? https://github.com/firebase/firebase-js-sdk/blob/main/packages/app-check/src/client.ts#L92 Can do it in a future PR as we should discuss what the util returns if it fails to parse.

@DellaBitta DellaBitta requested a review from hsubox76 January 27, 2026 21:36
@DellaBitta DellaBitta merged commit 8123231 into main Jan 29, 2026
36 of 38 checks passed
@DellaBitta DellaBitta deleted the ddb-ai-goingaway branch January 29, 2026 21:06
@google-oss-bot google-oss-bot mentioned this pull request Feb 3, 2026
maneesht pushed a commit that referenced this pull request Feb 6, 2026
### Discussion

Support the handling of Going Away notifications in the Live Service. The service may send this event when the session is coming to a close due to timeout or nearing a token limit.

### Testing

Unit tests added.
Manual testing.

### API Changes

See internal [API proposal](https://goto.google.com/fal-firebase-api-live-api-goaway-message).
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.

4 participants