You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DebugLoggingPlugin writes nothing for a failed run and keeps its state in memory #7890
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:
Register DebugLoggingPlugin(output_path="adk_debug.yaml") on an App.
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:
defcharge_card(amount: int) ->dict:
"""Charges a card."""raiseConnectionError("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.
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.
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.
Activity
sanketpatil06 commentedon Nov 4, 2026
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.
adityasingh2400 commentedon Nov 10, 2026
9e549ad, which landed on main on 11-10, fixes this.
DebugLoggingPluginnow implementson_run_error_callback, so a failed run writes its YAML document, ending in aninvocation_errorentry 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_errorinstead of addinginvocation_endafter it. So nothing from this issue is left. I'm closing #7891 as superseded, and closing this issue as fixed by 9e549ad.github-actions commentedon Nov 10, 2026
Are you satisfied with the resolution of your issue?
Yes
No