Runner drops callbackContextData written in onUserMessageCallback when it resumes an invocation
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee runResumedAgent, resumeCore y runAgentWithUpdatedSession en la implementación de Runner. Sigue cómo se construye initialContext y se pasa a los callbacks; después, compara la ruta de reanudación con la ruta de una nueva invocación. Reproduce el problema con la capacidad de reanudación habilitada y un plugin que almacene datos en onUserMessageCallback; el trabajo estará terminado cuando los callbacks del agente reanudado vean esos datos y una prueba de regresión cubra el comportamiento de reanudación existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 1.8k
- Forks
- 440
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 92
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/adk-java
-
InMemorySessionService.appendEvent recreates a deleted sessionPosiblemente ocupada @hirematha la tomó hace 4 días. Abiertoneeds review
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
google/adk-java#1697 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
AgentExecutor ignores the A2A contextId when creating a session, so multi-turn conversations start over every turnPosiblemente ocupada @hirematha la tomó hace 2 días. Abiertoneeds review
google/adk-java#1718 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
McpToolset hangs silently for ~5 minutes per retry (3 retries) when stdio command is an npm shim ("npx") on WindowsPosiblemente ocupada @hemasekhar-p la tomó hace 7 días. Abiertoneeds review
google/adk-java#1686 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
runLive passes partial events to appendEvent and never aggregates text chunks, unlike ADK PythonPosiblemente ocupada @hemasekhar-p la tomó hace 17 días. Abiertoneeds review
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
google/adk-java#1648 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
FirestoreSessionService compares event timestamps as text, reordering or skipping same-second eventsPosiblemente ocupada @hemasekhar-p la tomó hace 17 días. Abiertoneeds review
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
google/adk-java#1646 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/adk-java
Issues similares
-
pending:code-area pending:issue-category to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area:core bug priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aomarai/minecraft-mcp#247 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
antonyrag/ragleap-core#1062 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
projectnessie/nessie#13256 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Vakore/ZappierGames#232 ·