[FEATURE] Port DebugLoggingPlugin from adk-python
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Java
- 星标
- 1.7k
- 派生
- 433
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 43
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/adk-java 的其他 Issue
-
GeminiUtil placeholder user turn ("Continue output. DO NOT look at this line ...") is flagged by prompt injection filters可能已有人在做 @hemasekhar-p 于 5 天前认领。 未关闭needs review
难度 2/5 1-3 小时 新手友好度 76/100
google/adk-java#1628 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[spring-ai] Streaming responses ending with CJK punctuation (。!?) are misclassified as partial and never persisted to the session可能已有人在做 @hirematha 于 8 天前认领。 未关闭needs review
难度 2/5 1-3 小时 新手友好度 84/100
google/adk-java#1608 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
runLive passes partial events to appendEvent and never aggregates text chunks, unlike ADK Python可能已有人在做 @hemasekhar-p 于 1 天前认领。 未关闭waiting on reporter
难度 4/5 3-5 天 新手友好度 45/100
google/adk-java#1648 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
FirestoreSessionService compares event timestamps as text, reordering or skipping same-second events可能已有人在做 @hemasekhar-p 于 1 天前认领。 未关闭waiting on reporter
难度 3/5 1-2 天 新手友好度 50/100
google/adk-java#1646 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
Flight SQL JDBC parses boolean properties case-sensitively, silently disabling TLS for useEncryption=TRUE可能已有人在做 @Arawoof06 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
apache/arrow-java#1357 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
apache/rocketmq-dashboard#6610 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MetricsHub/metricshub-community#1396 ·
维护者通常 1 天内回复
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
难度 2/5 1-3 小时 新手友好度 76/100
dependabot/dependabot-core#16547 ·
维护者通常 1 天内回复
-
Citationcount column sorts alphabetically instead of numerically可能已有人在做 @kpunia306 今天认领。 未关闭status: needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复