Runner drops callbackContextData written in onUserMessageCallback when it resumes an invocation
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 78/100
Piste de recherche
Lisez runResumedAgent, resumeCore et runAgentWithUpdatedSession dans l’implémentation de Runner. Suivez la manière dont initialContext est construit et transmis aux callbacks, puis comparez le parcours de reprise au parcours d’une nouvelle invocation. Reproduisez le problème avec la reprise activée et un plugin qui stocke des données dans onUserMessageCallback ; le travail sera terminé lorsque les callbacks de l’agent repris verront ces données et qu’un test de régression couvrira le comportement de reprise existant.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 1.8k
- Forks
- 442
- Merge moyen
- 3 j 13 h
- PR mergées (30 j)
- 95
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de google/adk-java
-
InMemorySessionService.appendEvent recreates a deleted sessionPeut-être pris @hirematha l’a pris il y a 7 jours. Ouverteneeds review
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
google/adk-java#1697 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
[spring-ai] Wrapping ChatModels without getOptions() override fail with ClassCastException when ADK tools are attachedPeut-être pris @hirematha l’a pris il y a 3 jours. Ouverte
google/adk-java#1731 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
AgentExecutor ignores the A2A contextId when creating a session, so multi-turn conversations start over every turnPeut-être pris @hirematha l’a pris il y a 5 jours. Ouverteneeds review
google/adk-java#1718 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
McpToolset hangs silently for ~5 minutes per retry (3 retries) when stdio command is an npm shim ("npx") on WindowsPeut-être pris @hemasekhar-p l’a pris il y a 11 jours. Ouverteneeds review
google/adk-java#1686 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
runLive passes partial events to appendEvent and never aggregates text chunks, unlike ADK PythonPeut-être pris @hemasekhar-p l’a pris il y a 21 jours. Ouverteneeds review
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
google/adk-java#1648 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de google/adk-java
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
liberation-data/drivine4j#547 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
BindingServiceProperties.bindings regressed to a non-thread-safe TreeMap in GH-3158: concurrent first use of binding names corrupts itPeut-être pris @AkashB23 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
spring-cloud/spring-cloud-stream#3321 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] 资源包列表 与 模组/数据包/世界 列表排列顺序不一致Peut-être pris @fishdry1000 l’a pris il y a 4 jours. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
ai-driven-fuzzing bug claude Minor
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
linagora/twake-calendar-side-service#1333 ·
Les mainteneurs répondent en général sous 1 jour