You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Vertex AI drops executed code from history #1728
Describe the Bug:
When storing and retrieving session history using the Vertex AI backend (session/vertexai), the aiplatformToGenaiContent and createAiplatformpbContent mappers silently drop ExecutableCode, CodeExecutionResult, and FileData parts. There's a TODO in both functions about exactly this: // TODO add logic for other types of parts
What that looks like in practice:
If an agent utilizes Gemini's Code Execution tool to run Python code, the session history successfully saves the model's text thought but completely loses the code block it executed and the execution result it received. On the next conversation turn, when the context is retrieved from Vertex AI and fed back to the model, the model hallucinates or repeats itself endlessly because it lacks the execution context it expects.
Steps to Reproduce:
Create a VertexAiClient session service.
Run an agent with the Code Execution tool enabled that outputs ExecutableCode.
Check the saved Vertex AI session event or read it back; the part will be missing.
Expected Behavior: ExecutableCode, CodeExecutionResult, and FileData parts are preserved in Vertex AI session history (mirroring standard adk-go behavior).
Observed Behavior:
The parts are dropped, causing context corruption on subsequent turns.
Environment Details:
ADK Library Version: main
OS: (Your OS)
Go Version: 1.27.1
Model Information: Gemini (Code Execution)
Activity
fix(vertexai): preserve ExecutableCode and CodeExecutionResult in ses…