Runner drops callbackContextData written in onUserMessageCallback when it resumes an invocation
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Đọc runResumedAgent, resumeCore và runAgentWithUpdatedSession trong phần triển khai Runner. Theo dõi cách initialContext được tạo và truyền cho các callback, sau đó so sánh luồng tiếp tục với luồng gọi mới. Tái hiện với tính năng tiếp tục được bật và một plugin lưu dữ liệu trong onUserMessageCallback; hoàn tất khi các callback của agent được tiếp tục có thể thấy dữ liệu đó và hành vi tiếp tục hiện có được bao phủ bằng một bài kiểm thử hồi quy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Please make sure you read the contribution guide and file the issues in the right place.
Contribution guide.
🔴 Required Information
Describe the Bug
InvocationContext.callbackContextData() is "a map for storing temporary context data that can be shared
between different parts of the invocation", and InvocationContext.Builder passes the same instance to every
copy "so that Plugins can access the same data … across all types of callbacks."
A new invocation keeps that promise. runNewInvocation runs onUserMessageCallback on initialContext, and
runAgentWithUpdatedSession builds the agent's context with initialContext.toBuilder(), so the map is shared.
A resumed invocation does not. resumeCore runs onUserMessageCallback on its own initialContext, but
runResumedAgent is not given that context and builds the agent's from a second builder:
// runResumedAgent
InvocationContext rootContext =
newInvocationContextBuilder(session, rootAgent)
.invocationId(resolvedInvocationId)
.runConfig(runConfig)
.userContent(userContentFor(session, resolvedInvocationId, userContent))
.build();
newInvocationContextBuilder starts a new, empty callbackContextData, so whatever a plugin stored in
onUserMessageCallback is missing from beforeRunCallback and from every callback that runs with the agent.
The same builder also resets endInvocation: a plugin that ends the invocation in onUserMessageCallback stops
a new invocation, but a resumed one still calls the model. On every resume, onRunErrorCallback also runs on
initialContext, so it does not see what beforeRunCallback stored, even when no new message is sent.
Trigger: resumability enabled and an invocation paused (for example on a long-running tool) that is then
resumed, with or without a new message. New invocations are unaffected.
Steps to Reproduce
- A
RunnerwithResumabilityConfig.builder().resumable(true), anLlmAgentwith a long-running tool, and a
plugin whoseonUserMessageCallbackputs a value intoinvocationContext.callbackContextData()and whose
beforeAgentCallbackreads it back. - Send a message. The model calls the tool and the invocation pauses.
- Send the tool's function response, which resumes the invocation.
Expected Behavior
On the resumed turn, beforeAgentCallback reads the value that turn's onUserMessageCallback stored, as it
does on the first turn.
Observed Behavior
The first turn reads its value, and the resumed turn reads null (the plugin stores message-1, then
message-2). beforeAgentCallback reads, per turn:
[agent:message-1, agent:null]
The same happens when the resume is routed to a sub-agent instead of the root.
Environment Details
- ADK Library Version:
main@84bae34a(pom 1.13.0) - OS: not OS-specific
- TS Version: N/A (Java)
Model Information
N/A
🟡 Optional Information
Regression
No. Present since resuming an invocation was added (v1.11.0).
Willingness to contribute
Yes, a PR follows. runResumedAgent takes initialContext and builds the agent's context with
initialContext.toBuilder(), as runAgentWithUpdatedSession does:
InvocationContext rootContext =
initialContext.toBuilder()
.agent(rootAgent)
.userContent(...)
.build();
How often has this issue occurred?
Always (100%), on a resumed invocation.
- Ngôn ngữ chính
- Java
- Star
- 1.8k
- Fork
- 440
- Merge trung bình
- 3 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 95
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-java
-
InMemorySessionService.appendEvent recreates a deleted sessionCó thể đã có người làm @hirematha đã nhận 4 ngày trước. Đang mởneeds review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
google/adk-java#1697 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[spring-ai] Wrapping ChatModels without getOptions() override fail with ClassCastException when ADK tools are attachedCó thể đã có người làm @hirematha đã nhận hôm nay. Đang mở
google/adk-java#1731 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
AgentExecutor ignores the A2A contextId when creating a session, so multi-turn conversations start over every turnCó thể đã có người làm @hirematha đã nhận 2 ngày trước. Đang mởneeds review
google/adk-java#1718 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
McpToolset hangs silently for ~5 minutes per retry (3 retries) when stdio command is an npm shim ("npx") on WindowsCó thể đã có người làm @hemasekhar-p đã nhận 8 ngày trước. Đang mởneeds review
google/adk-java#1686 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
runLive passes partial events to appendEvent and never aggregates text chunks, unlike ADK PythonCó thể đã có người làm @hemasekhar-p đã nhận 18 ngày trước. Đang mởneeds review
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
google/adk-java#1648 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của google/adk-java
Issue tương tự
-
breaking change bug needs human review not ready priority medium size S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
martin-francois/symphony-trello#1193 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
status: waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
spring-projects/spring-framework#37614 ·
Maintainer thường phản hồi trong vòng 1 ngày