Skip to content

test: test history and TASK_STATE_INPUT_REQUIRED in test_end_to_end.py#745

Merged
ishymko merged 2 commits into1.0-devfrom
ishymko/improve-end-to-end
Feb 27, 2026
Merged

test: test history and TASK_STATE_INPUT_REQUIRED in test_end_to_end.py#745
ishymko merged 2 commits into1.0-devfrom
ishymko/improve-end-to-end

Conversation

@ishymko
Copy link
Copy Markdown
Member

@ishymko ishymko commented Feb 27, 2026

Add task.history assertions and test TASK_STATE_INPUT_REQUIRED.

Note: tests use get_task API call in non-blocking tests for assertions as task returned from Client and maintained by ClientTaskManager can't be trusted and handles history in a different way compared to the server (see #734).

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 significantly improves the robustness of the integration test suite by adding detailed assertions for task history at various stages of task execution. It also introduces a critical new test case to ensure the correct handling and resumption of tasks that require user input, enhancing the reliability of the agent's state management.

Highlights

  • Enhanced Task History Assertions: Added comprehensive assertions for task.history across multiple end-to-end tests, including test_end_to_end_send_message_blocking, test_end_to_end_send_message_non_blocking, test_end_to_end_send_message_streaming, test_end_to_end_get_task, and test_end_to_end_list_tasks.
  • New TASK_STATE_INPUT_REQUIRED Test Case: Introduced a new end-to-end test, test_end_to_end_input_required, to validate the behavior of tasks that transition into the TASK_STATE_INPUT_REQUIRED state and subsequently resume upon receiving user input.
  • Dummy Agent Logic Update: Modified the DummyAgent to conditionally request user input based on the received message, allowing for testing of the TASK_STATE_INPUT_REQUIRED flow.
Changelog
  • tests/integration/test_end_to_end.py
    • Modified DummyAgent.execute to incorporate user input handling and conditional state transitions, including TASK_STATE_INPUT_REQUIRED.
    • Added task.history assertions to test_end_to_end_send_message_blocking.
    • Added task.history assertions to test_end_to_end_send_message_non_blocking.
    • Refactored event unpacking in test_end_to_end_send_message_streaming to align with new task object access.
    • Added task.history assertions to test_end_to_end_send_message_streaming.
    • Added task.history assertions to test_end_to_end_get_task.
    • Added task.history assertions to test_end_to_end_list_tasks.
    • Introduced test_end_to_end_input_required to verify the TASK_STATE_INPUT_REQUIRED state and its resumption.
Activity
  • No human activity has occurred on this pull request yet.
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
Copy Markdown
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 adds tests for task history and the TASK_STATE_INPUT_REQUIRED state. The changes to the MockAgentExecutor are appropriate for enabling these tests. However, many of the new assertions related to task.history seem to be incorrect. They consistently misrepresent the expected length and content of the task history, especially regarding the inclusion of user messages and the cumulative nature of history across multiple interactions. I've added specific comments pointing out these discrepancies in the tests.

Comment thread tests/integration/test_end_to_end.py Outdated
Comment thread tests/integration/test_end_to_end.py Outdated
Comment thread tests/integration/test_end_to_end.py Outdated
Comment thread tests/integration/test_end_to_end.py Outdated
Comment thread tests/integration/test_end_to_end.py Outdated
Comment thread tests/integration/test_end_to_end.py Outdated
Comment thread tests/integration/test_end_to_end.py Outdated
@ishymko ishymko force-pushed the ishymko/improve-end-to-end branch from 958486e to 0a889c5 Compare February 27, 2026 12:09
@ishymko ishymko force-pushed the ishymko/improve-end-to-end branch from 0a889c5 to 74ce553 Compare February 27, 2026 12:16
@ishymko ishymko marked this pull request as ready for review February 27, 2026 12:16
@ishymko ishymko requested a review from a team as a code owner February 27, 2026 12:16
@ishymko ishymko merged commit 7998a26 into 1.0-dev Feb 27, 2026
9 checks passed
@ishymko ishymko deleted the ishymko/improve-end-to-end branch February 27, 2026 12:55
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.

2 participants