Skip to content

[FEATURE] Async agent hooksΒ #1017

@osdemah

Description

@osdemah

Problem Statement

Currently only blocking functions are supported for agent hooks. This blocks the asyncio event loop and degrades performance for use-cases requiring IO (such as LLM calls in the hooks) for handling of hooks.

Proposed Solution

Support async handlers for hook callbacks. e.g.:

async def my_handler(event: MessageAddedEvent):
    ...
registry.add_callback(MessageAddedEvent, my_handler)

Use Case

IO heavy operations in the callback handlers

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions