Skip to content

Conversation

@hugoaguirre
Copy link
Contributor

@hugoaguirre hugoaguirre commented Jan 22, 2026

Added --stream flag to dev:test-model command

cd go
genkit dev:test-model googleai/gemini-3-flash-preview --stream -- go run samples/basic/main.go

Added reasoning validator:

cd js/testapps/basic-gemini
genkit dev:test-model --from-file=../../plugins/google-genai/tests/model-tests-tts.yaml  -- tsx src/index.ts

In model-tests-tts.yaml you can specify how to enable reasoning for your model.
For Gemini models:

- model: googleai/gemini-3-pro-preview
supports:
  - reasoning
 tests:
   - name: Reasoning conformance
     input:
       messages:
          - role: user
              content:
                - text: A banana farmer harvest 10 bananas but he eats 3 and sells 4. How many bananas are remaining?
        config:
          thinkingConfig:
            thinkingBudget: 1024
            includeThoughts: true

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hugoaguirre, 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 enhances the dev:test-model CLI command by introducing a --stream flag, which enables the testing of models that support streaming responses. The core test execution logic has been refactored to properly handle and aggregate streamed output, ensuring that the command can accurately validate the behavior of streaming-capable models.

Highlights

  • New CLI Option: A new --stream option has been added to the dev:test-model command, allowing users to test models using their streaming API capabilities.
  • Streaming Test Execution: The runTest and runTestSuite functions have been updated to accept a stream parameter, enabling conditional streaming behavior during model testing. This includes collecting streamed text chunks and updating the final response message with the aggregated content.
  • Type Definition Update: The TestCase type now includes an optional stream?: boolean property, allowing individual test cases to specify if they should be run in streaming mode.

🧠 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.

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 a --stream option to the dev:test-model command, enabling tests to be run against a model's streaming API. The implementation correctly adds the necessary CLI option, passes the flag through to the test execution logic, and handles the aggregation of streamed text chunks. My review focuses on ensuring the aggregated text is correctly applied to the response object for validation. I've identified a high-severity issue where the code makes an unsafe assumption about the structure of the model's response, which could lead to data corruption. A code suggestion is provided to fix this.

@hugoaguirre hugoaguirre requested a review from apascal07 January 22, 2026 22:56
@hugoaguirre hugoaguirre changed the title feat(cli): add stream to dev:test-model command feat(cli): add streaming and reasoning to dev:test-model cmd Jan 23, 2026
const isMediaOutput = testCase.validators.some((v) =>
v.startsWith('valid-media')
);
const shouldStream = stream && !isMediaOutput;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be an explicit flag on the test...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially opted for the global --stream flag as a way to quickly verify across all the existing core test cases without having to duplicate each one of them. I was thinking stream mode more like a toggle to the existing tests.

I see your point about explicit control. I'm okay to rework this with your suggestion.

If we are keeping the per-test flag, should I go and duplicate the core test cases for this?

@hugoaguirre hugoaguirre requested a review from pavelgj January 23, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants