Skip to content

DebugLoggingPlugin writes nothing for a failed run and keeps its state in memory #7890

Closed

Description

@adityasingh2400

🔴 Required Information

Describe the Bug:
DebugLoggingPlugin writes nothing for a run that fails, which is the run you most want to debug. The failed invocation's buffered entries, prompts included, also stay in memory for the life of the plugin.

The plugin buffers each invocation in _invocation_states, and writes and drops that state only in after_run_callback. The runner skips after_run_callback once a run raises (Runner._exec_with_plugin and workflow/_node_runner_utils.py) and calls on_run_error_callback instead, which this plugin doesn't implement. Every other plugin that keeps per-invocation state already handles it: BigQuery analytics, both ReflectAndRetry plugins, ModelConsultObservability and ForceEscalation.

Steps to Reproduce:

  1. Register DebugLoggingPlugin(output_path="adk_debug.yaml") on an App.
  2. Run an agent whose tool raises, e.g. ConnectionError("payment gateway timed out").

Expected Behavior:
adk_debug.yaml contains the failed invocation with its entries and the error, and the plugin's state for it is released.

Observed Behavior:

run failed: ConnectionError payment gateway timed out
debug file exists: False | bytes: 0
_invocation_states after the run: {'e-683b…': ['invocation_start', 'agent_start', 'llm_request', 'llm_response', 'event', 'tool_call', 'tool_error', 'event']}

Environment Details:

  • ADK Library Version (pip show google-adk): 2.13.0 (also on main at e9e8f61)
  • Desktop OS: macOS
  • Python Version (python -V): 3.11.16

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: any (a fake BaseLlm in the repro)

🟡 Optional Information

Minimal Reproduction Code:

def charge_card(amount: int) -> dict:
  """Charges a card."""
  raise ConnectionError("payment gateway timed out")

plugin = DebugLoggingPlugin(output_path="adk_debug.yaml")
app = App(
    name="app",
    root_agent=LlmAgent(name="a", model=model_that_calls_charge_card, tools=[charge_card]),
    plugins=[plugin],
)
runner = InMemoryRunner(app=app)
# run_async(...) raises ConnectionError; adk_debug.yaml is never written and
# plugin._invocation_states still holds the invocation.

How often has this issue occurred?:

  • Always (100%), for every run that raises

Activity

  1. self-assigned this
    on Nov 2, 2026
  2. added theissue type on Nov 2, 2026
  3. added
    core[Component] This issue is related to the core interface and implementation
    on Nov 2, 2026
  4. sanketpatil06 commented on Nov 4, 2026

    @sanketpatil06

    Hi @adityasingh2400, thank you for raising the issue and for the clear details and reproduction steps.
    We have reproduced the issue on the latest main branch.
    We also appreciate you raising PR #7891 to fix it. The PR will be reviewed by the team.
    Thank you for your patience and understanding.

  5. adityasingh2400 commented on Nov 10, 2026

    @adityasingh2400
    ContributorAuthor

    9e549ad, which landed on main on 11-10, fixes this. DebugLoggingPlugin now implements on_run_error_callback, so a failed run writes its YAML document, ending in an invocation_error entry with the error's type and message, and its state is removed from _invocation_states.

    On main, the cleanup test from #7891 passes. Its file test fails only on entry order: main ends the document with invocation_error instead of adding invocation_end after it. So nothing from this issue is left. I'm closing #7891 as superseded, and closing this issue as fixed by 9e549ad.

  6. github-actions commented on Nov 10, 2026

    @github-actions

    Are you satisfied with the resolution of your issue?
    Yes
    No

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

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementation

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions