Skip to content

Hook AfterInvocationEvent should provide the AgentResult #635

@lekhnath

Description

@lekhnath

Problem Statement

For the hook event AfterInvocationEvent, the event instance only gives access to the agent and does not include any helpful information related to the current invocation of the agent. This is counterintuitive given the event name implies it occurs after invocation.

Proposed Solution

Include an AgentResult in the AfterInvocationEvent instance so that various actions can be performed based on the actual result of the agent’s invocation.

Use Case

Agent invocation logs can be enriched with the end result, including usage metrics, traces, and everything the AgentResult contains. This would significantly increase the power and usefulness of this hook event.

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-hooksFeatures or requests that might be implementable via hooksenhancementNew feature or requestready for contributionPull requests welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions