[FEATURE] Port DebugLoggingPlugin from adk-python
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Please make sure you read the contribution guide and file the issues in the right place.
Contribution guide.
🔴 Required Information
Is your feature request related to a specific problem?
When an agent misbehaves, adk-java has no way to produce a record of what happened that you can read
afterwards, diff against another run, or attach to a bug report. What was sent to the model and what
came back, each tool call and its result, the events the runner yielded - all of it goes out as log
lines, mixed in with everything else the process is printing. Nothing gathers one invocation into one
place.
adk-python closed that gap by shipping DebugLoggingPlugin, which writes one YAML document per
invocation to a file. adk-java has no equivalent.
Describe the Solution You'd Like
DebugLoggingPlugin in com.google.adk.plugins.debuglogging, registered on a Runner like any
other plugin, behaving as adk-python's does:
- record the user message, every LLM request and response, every tool call, result and error, every
event the runner yields, and — optionally — a snapshot of session state as the invocation ends; - write one YAML document per invocation, appended to a file, so a session's invocations
accumulate in one readable artifact that can be attached to a bug report; - curate rather than dump, as upstream does: tool declarations recorded as names only, inline
data as its mime type with the bytes omitted, grounding metadata as a boolean, requested auth
configs as a count; - switch the session-state snapshot and full system instructions on or off per instance.
No existing class changes and no existing API changes. All twelve callbacks it needs are already
declared on Plugin, and every one of them is observe-only here: eleven return Maybe.empty(), and
afterRunCallback returns a Completable that only writes the file. None of them returns a value
that alters the run.
Impact on your work
When an agent does something unexpected, there is nothing to save and nothing to hand to someone
else. Not blocking, and there is no timeline — this is a parity gap, not an outage.
Willingness to contribute
Yes. A PR follows immediately after this issue: one new public plugin class plus supporting types in
a plugins.debuglogging subpackage, with tests. No existing file is modified, and no new dependency
is added — jackson-dataformat-yaml is already a compile-scope dependency of core.
🟡 Recommended Information
Describe Alternatives You've Considered
LoggingPlugin, which adk-java already has. It logs prose lines to slf4j while the run happens,
truncating what it prints. That is useful for watching a run go by, but what it produces cannot be
re-read as data, diffed between two runs, or attached to an issue. Complementary, not a replacement —
the same hooks, a different output.
ADK's tracing/telemetry. Spans answer "where did the time go" and are read in a tracing backend.
A debug trace answers "what was said, in order", is read in a text editor, and needs no backend.
ReplayPlugin and the recordings package in google-adk-dev. Closer in spirit, but it reads
recordings rather than writing them, and it targets deterministic playback rather than a document a
person reads. It also ships in a different artifact from core.
Write the plugin in application code. It works — the behavior above was built using public API
only. But it is a few hundred lines of serialization curation per application, it drifts from
upstream separately in each copy, and the parts that matter most (what to omit) are exactly the
parts each copy will get wrong differently.
Proposed API / Implementation
Registration needs no new API:
Runner runner =
new InMemoryRunner(
agent, "my-app", ImmutableList.of(new DebugLoggingPlugin(Path.of("adk_debug.yaml"))));
All twelve hooks upstream overrides are already declared on Plugin, with compatible shapes -
for example, the two that carry the model exchange, and the one that does the writing:
default Maybe<LlmResponse> beforeModelCallback(
CallbackContext callbackContext, LlmRequest.Builder llmRequest)
default Maybe<LlmResponse> afterModelCallback(
CallbackContext callbackContext, LlmResponse llmResponse)
// returns Completable, so the file write need not block the caller
default Completable afterRunCallback(InvocationContext invocationContext)
The class is written and tested; the PR carries it.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 433
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 52
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/adk-java
-
GeminiUtil placeholder user turn ("Continue output. DO NOT look at this line ...") is flagged by prompt injection filtersPossibly taken @hemasekhar-p claimed this 6 days ago. Openneeds review
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google/adk-java#1628 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
[spring-ai] Streaming responses ending with CJK punctuation (。!?) are misclassified as partial and never persisted to the sessionPossibly taken @hirematha claimed this 9 days ago. Openneeds review
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
google/adk-java#1608 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
VertexAiSessionService: Event.id differs between the streamed event and getSession (id is not sent to Vertex and the appendEvent response is empty)Possibly taken @hemasekhar-p claimed this 1 day ago. Openwaiting on reporter
Difficulty 4/5 3-5 days Newbie friendliness 45/100
google/adk-java#1651 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
runLive passes partial events to appendEvent and never aggregates text chunks, unlike ADK PythonPossibly taken @hemasekhar-p claimed this 2 days ago. Openneeds review
Difficulty 4/5 3-5 days Newbie friendliness 45/100
google/adk-java#1648 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
FirestoreSessionService compares event timestamps as text, reordering or skipping same-second eventsPossibly taken @hemasekhar-p claimed this 2 days ago. Openneeds review
Difficulty 3/5 1-2 days Newbie friendliness 50/100
google/adk-java#1646 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
NationalSecurityAgency/ghidra#9884 ·
Maintainers usually reply within 2 days
-
Status: Pending Review Type: Feature Request
Difficulty 1/5 Under an hour Newbie friendliness 82/100
OpenRefine/OpenRefine#8019 ·
Maintainers usually reply within 1 day
-
`timer` rule rejects dates the engine acceptsPossibly taken @MFA-G claimed this today. Openbug ready
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
camunda/bpmnlint-plugin-camunda-compat#281 · 3 comments ·
Maintainers usually reply within 1 day
-
status: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100