Skip to content

plugin: give plugins the error that runner.Run yielded #1883

Open

Description

@wojtas000

AfterRunCallback is func(agent.InvocationContext) (plugin.go#L189), so a plugin cannot tell whether runner.Run yielded an error to its caller. The runner hands a root agent's error straight to the caller and keeps running the agent if the caller goes on reading (runner.go#L720-L731). No plugin callback runs for that error.

A plugin that reports how a run ended has to infer it from agent and model callbacks. The BigQuery Agent Analytics plugin does this in #1787, where it writes INVOCATION_COMPLETED or INVOCATION_ERROR. Some runs reach the plugin through exactly the same callbacks whether or not the caller got an error:

  • A custom agent that drops its child's error and answers itself, compared with one that forwards the error to a caller that keeps reading. The plugin can't tell these apart, so it has to report one of them wrongly.
  • A custom root agent whose Run yields an error and returns, with the caller reading to the end. AfterAgentCallback runs either way (agent.go#L199-L215).
  • An agent-level AfterModelCallback that rejects a model response. ADK yields that error without any further plugin callback (base_flow.go#L1046-L1050).

adk-python plugins get the error directly in on_run_error_callback (bigquery_agent_analytics_plugin.py#L9955-L9960).

A fix should let a plugin know, by the end of a run, whether runner.Run yielded an error to its caller and which one, for every runner entry point (Run, RunLive, and the node path).

Activity

  1. dhakad22klx commented on Oct 17, 2026

    @dhakad22klx
    Contributor

    Hi @wojtas000, i am working on this. Please assign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions