Skip to content

Conversation

@mehtarac
Copy link
Owner

Description

This PR fixes mypy errors

Related Issues

Documentation PR

Type of Change

Bug fix
New feature
Breaking change
Documentation update
Other (please describe):

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

def active(self) -> bool:
"""True if agent loop started, False otherwise."""
return self._loop.active
return cast(bool, self._loop.active)
Copy link

Choose a reason for hiding this comment

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

There is an issue here. We seem to be using loop.active and loop._active. I think we might have a bug in that logic

Copy link
Owner Author

Choose a reason for hiding this comment

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

Could you point me to an instance of loop._active? I only see _loop.active

Copy link

Choose a reason for hiding this comment

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

nvm, i'm wrong. i was looking into bidi agent loop code, but i missed something.

Copy link

Choose a reason for hiding this comment

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

though this fix still feels a bit unnecessary to me, because _loop.active is a property defined as bool already. anyway, no blockers here

Copy link
Owner Author

Choose a reason for hiding this comment

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

yeah that fix is outdated. There was a discrepancy in errors when I was running mypy directly vs hatch run prepare. Removed the fix above

class _BidiTextOutput(BidiOutput):
"""Handle text output from bidi agent."""

async def start(self) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did mypy complain about this? We use a Protocol for BidiOutput with default implementations of start and stop and so explicitly adding start and stop here should not be necessary.

Copy link
Owner Author

Choose a reason for hiding this comment

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

yeah mypy was complaining about it

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should fix that. It doesn't have to block this PR, but the protocol can be setup not to require these methods.

@mehtarac mehtarac merged commit 4206077 into main Nov 19, 2025
3 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants