Skip to content

Conversation

@njbrake
Copy link
Contributor

@njbrake njbrake commented Jun 17, 2025

Description

This PR adds the missing task state helper methods to TaskUpdater.

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Follow the CONTRIBUTING Guide.
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
    • Important Prefixes for release-please:
      • fix: which represents bug fixes, and correlates to a SemVer patch.
      • feat: represents a new feature, and correlates to a SemVer minor.
      • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
  • Ensure the tests and linter pass (Run nox -s format from the repository root to format)
  • Appropriate docs were updated (if necessary)

Fixes #172 🦕

@njbrake njbrake requested a review from a team as a code owner June 17, 2025 19:56
@njbrake njbrake requested a review from chitra-venkatesh June 17, 2025 19:56
@holtskinner holtskinner requested review from mikeas1 and removed request for chitra-venkatesh June 17, 2025 20:14
@njbrake
Copy link
Contributor Author

njbrake commented Jun 17, 2025

@holtskinner before this gets merged, could we have a brief discussion or a check around my use of the final parameter, especially in the input_required and auth_required helper functions that I'm adding here?

I'm not confident if I'm using that parameter correctly, or whether I'm confused about its purpose in the streaming vs non-streaming vs push notification use cases. Thanks!

@mikeas1
Copy link
Contributor

mikeas1 commented Jun 18, 2025

final is used as an indicator that the agent is done producing messages, which some of the internal SDK workings use to ensure that ongoing streams are terminated. We've taken a relatively conservative approach to this, where we expect that the agent implementation is explicit about this signal, rather than inferring it from the TaskState. TaskUpdater adds another layer of support by encoding the expectation that reaching a terminal state (canceled, completed, failed) means no further updates are coming.

You could set final=True on input-required state, since, as the state indicates, agents will not have anything further to do until they receive that required input.

@njbrake
Copy link
Contributor Author

njbrake commented Jun 18, 2025

@mikeas1 thanks! In that case then, I think my changes should be good and align with your intentions. 👍🏼

@mikeas1 mikeas1 merged commit 2b3bf6d into a2aproject:main Jun 18, 2025
6 checks passed
holtskinner pushed a commit that referenced this pull request Jun 24, 2025
# Description

This PR adds the missing task state helper methods to TaskUpdater. 

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make
sure it goes smoothly:

- [x] Follow the [`CONTRIBUTING`
Guide](https://github.com/google-a2a/a2a-python/blob/main/CONTRIBUTING.md).
- [x] Make your Pull Request title in the
<https://www.conventionalcommits.org/> specification.
- Important Prefixes for
[release-please](https://github.com/googleapis/release-please):
- `fix:` which represents bug fixes, and correlates to a
[SemVer](https://semver.org/) patch.
- `feat:` represents a new feature, and correlates to a SemVer minor.
- `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking
change (indicated by the `!`) and will result in a SemVer major.
- [x] Ensure the tests and linter pass (Run `nox -s format` from the
repository root to format)
- [x] Appropriate docs were updated (if necessary)

Fixes #172 🦕
holtskinner pushed a commit that referenced this pull request Jun 30, 2025
# Description

This PR adds the missing task state helper methods to TaskUpdater. 

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make
sure it goes smoothly:

- [x] Follow the [`CONTRIBUTING`
Guide](https://github.com/google-a2a/a2a-python/blob/main/CONTRIBUTING.md).
- [x] Make your Pull Request title in the
<https://www.conventionalcommits.org/> specification.
- Important Prefixes for
[release-please](https://github.com/googleapis/release-please):
- `fix:` which represents bug fixes, and correlates to a
[SemVer](https://semver.org/) patch.
- `feat:` represents a new feature, and correlates to a SemVer minor.
- `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking
change (indicated by the `!`) and will result in a SemVer major.
- [x] Ensure the tests and linter pass (Run `nox -s format` from the
repository root to format)
- [x] Appropriate docs were updated (if necessary)

Fixes #172 🦕
holtskinner added a commit that referenced this pull request Jun 30, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.2.10](v0.2.8...v0.2.10)
(2025-06-30)


### ⚠ BREAKING CHANGES

* Update to A2A Spec Version
[0.2.5](https://github.com/a2aproject/A2A/releases/tag/v0.2.5)
([#197](#197))

### Features

* Add `append` and `last_chunk` to `add_artifact` method on
`TaskUpdater`
([#186](#186))
([8c6560f](8c6560f))
* add a2a routes to existing app
([#188](#188))
([32fecc7](32fecc7))
* Add middleware to the client SDK
([#171](#171))
([efaabd3](efaabd3))
* Add more task state management methods to TaskUpdater
([#208](#208))
([2b3bf6d](2b3bf6d))
* raise error for tasks in terminal states
([#215](#215))
([a0bf13b](a0bf13b))

### Bug Fixes

* `consume_all` doesn't catch `asyncio.TimeoutError` in python 3.10
([#216](#216))
([39307f1](39307f1))
* Append metadata and context id when processing TaskStatusUpdateE…
([#238](#238))
([e106020](e106020))
* Fix reference to `grpc.aio.ServicerContext`
([#237](#237))
([0c1987b](0c1987b))
* Fixes Short Circuit clause for context ID
([#236](#236))
([a5509e6](a5509e6))
* Resolve `APIKeySecurityScheme` parsing failed
([#226](#226))
([aa63b98](aa63b98))
* send notifications on message not streaming
([#219](#219))
([91539d6](91539d6)),
closes [#218](#218)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Holt Skinner <[email protected]>
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.

[Feat]: Removing TaskUpdater complete/failed/reject helper functions, or add more functions for the rest of the TaskStates

3 participants