Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Typing for Middleware is incorrect #2198

Open
heyitsaamir opened this issue Dec 18, 2024 · 0 comments · May be fixed by #2207
Open

Typing for Middleware is incorrect #2198

heyitsaamir opened this issue Dec 18, 2024 · 0 comments · May be fixed by #2207
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior.

Comments

@heyitsaamir
Copy link

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

4.16.2

Describe the bug

The typing for the middleware on_turn handler is:

def on_turn(self, context: TurnContext, logic: Callable[[TurnContext], Awaitable]):

Notice the arguments is a TurnContext?

However, it's called like:

async def call_next_middleware():
return await self.receive_activity_internal(
context, callback, next_middleware_index + 1
)
try:
return await next_middleware.on_turn(context, call_next_middleware)
.

Here call_next_middleware takes no arguments.

This results in:

TypeError: MiddlewareSet.receive_activity_internal.<locals>.call_next_middleware() takes 0 positional arguments but 1 was given
@heyitsaamir heyitsaamir added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Dec 18, 2024
@heyitsaamir heyitsaamir changed the title Typing for Middlware is incorrect Typing for Middleware is incorrect Dec 18, 2024
corinagum pushed a commit to microsoft/teams-agent-accelerator-libs-py that referenced this issue Dec 18, 2024
- Adds a middlware for memory_module. Now, whenever a message from a
user comes in, or message is sent from the agent out back to the user,
it's automatically captured by the supplied memory_module.

Discovered a number of bugs in botframework-python. Added them:
microsoft/botbuilder-python#2197
microsoft/botbuilder-python#2198
@tracyboehrer tracyboehrer removed the needs-triage The issue has just been created and it has not been reviewed by the team. label Jan 23, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants