Bug Report: Agent executor error - Message truncation failure (v1.20.5)

I am experiencing a recurring issue where the agent fails to execute due to a message truncation error. Below are the specific details and stack trace from the crash.

Environment & Metadata:

  • Date Occurred: March 9, 2026

  • Version: 1.20.5

  • Trajectory ID: `def09238-2fdd-4cee

Error Message: Error: agent executor error: could not convert a single message before hitting truncation

Stack Trace:

Plaintext

(1) attached stack trace
– stack trace:
| google3/third_party/jetski/cortex/cortex.(*CascadeManager).executeHelper.func1
| 	third_party/jetski/cortex/cascade_manager.go:2096
| […repeated from below…]
Wraps: (2) agent executor error
Wraps: (3) attached stack trace
– stack trace:
| google3/third_party/jetski/cortex/chatconverters/chatconverters.init
| 	third_party/jetski/cortex/chatconverters/trajectory_chat_converter.go:44
| runtime.doInit1
| 	third_party/go/gc/src/runtime/proc.go:8105
| runtime.doInit
| 	third_party/go/gc/src/runtime/proc.go:8072
| runtime.main
| 	third_party/go/gc/src/runtime/proc.go:258
| runtime.goexit
| 	third_party/go/gc/src/runtime/asm_amd64.s:1774
Wraps: (4) could not convert a single message before hitting truncation
Error types: (1) *withstack.w
1 Like

same version, same error. Also sent this as bug report via Antigravity. Happens only with 3.1 Gemini Pro.
Trajectory ID: a6629f48-eac9-4789-8c16-064706f01692
Error: agent executor error: could not convert a single message before hitting truncation
(1) attached stack trace
– stack trace:
| google3/third_party/jetski/cortex/cortex.(*CascadeManager).executeHelper.func1
| third_party/jetski/cortex/cascade_manager.go:2096
| google3/third_party/jetski/cortex/cortex.(*CascadeManager).executeHelper.func2
| third_party/jetski/cortex/cascade_manager.go:2144
Wraps: (2) agent executor error
Wraps: (3) attached stack trace
– stack trace:
| google3/third_party/jetski/cortex/chatconverters/chatconverters.(*TrajectoryChatConverter).GetNumTokensSinceLastCheckpoint
| third_party/jetski/cortex/chatconverters/trajectory_chat_converter.go:550
| google3/third_party/jetski/cortex/mixins/mixins.GetConversationalHooks.NewCheckpointHook.func7.1
| third_party/jetski/cortex/executors/posthooks/checkpoint_hook.go:43
| google3/third_party/jetski/cortex/executors/executors.(*CascadeWrapper).ViewTrajectory
| third_party/jetski/cortex/executors/cascade_wrapper.go:258
| google3/third_party/jetski/cortex/mixins/mixins.GetConversationalHooks.NewCheckpointHook.func7
| third_party/jetski/cortex/executors/posthooks/checkpoint_hook.go:33
| google3/third_party/gemini_coder/framework/executor/executor.(*Executor).executeLoop
| third_party/gemini_coder/framework/executor/executor.go:388
| google3/third_party/gemini_coder/framework/executor/executor.(*Executor).Execute
| third_party/gemini_coder/framework/executor/executor.go:277
| google3/third_party/jetski/cortex/cortex.(*CascadeManager).executeHelper.func1
| third_party/jetski/cortex/cascade_manager.go:2061
| google3/third_party/jetski/cortex/cortex.(*CascadeManager).executeHelper.func2
| third_party/jetski/cortex/cascade_manager.go:2144
Wraps: (4) attached stack trace
– stack trace:
| google3/third_party/jetski/cortex/chatconverters/chatconverters.(*TrajectoryChatConverter).TrajectoryToChatMessagesFromNCheckpointsAgo
| third_party/jetski/cortex/chatconverters/trajectory_chat_converter.go:1135
| google3/third_party/jetski/cortex/chatconverters/chatconverters.(*TrajectoryChatConverter).GetNumTokensSinceLastCheckpoint
| third_party/jetski/cortex/chatconverters/trajectory_chat_converter.go:548
| google3/third_party/jetski/cortex/mixins/mixins.GetConversationalHooks.NewCheckpointHook.func7.1
| third_party/jetski/cortex/executors/posthooks/checkpoint_hook.go:43
| google3/third_party/jetski/cortex/executors/executors.(*CascadeWrapper).ViewTrajectory
| third_party/jetski/cortex/executors/cascade_wrapper.go:258
| google3/third_party/jetski/cortex/mixins/mixins.GetConversationalHooks.NewCheckpointHook.func7
| third_party/jetski/cortex/executors/posthooks/checkpoint_hook.go:33
| google3/third_party/gemini_coder/framework/executor/executor.(*Executor).executeLoop
| third_party/gemini_coder/framework/executor/executor.go:388
| google3/third_party/gemini_coder/framework/executor/executor.(*Executor).Execute
| third_party/gemini_coder/framework/executor/executor.go:277
| google3/third_party/jetski/cortex/cortex.(*CascadeManager).executeHelper.func1
| third_party/jetski/cortex/cascade_manager.go:2061
| […repeated from below…]
Wraps: (5) attached stack trace
– stack trace:
| google3/third_party/jetski/cortex/chatconverters/chatconverters.init
| third_party/jetski/cortex/chatconverters/trajectory_chat_converter.go:44
| runtime.doInit1
| third_party/go/gc/src/runtime/proc.go:8105
| runtime.doInit
| third_party/go/gc/src/runtime/proc.go:8072
| runtime.main
| third_party/go/gc/src/runtime/proc.go:258
| runtime.goexit
| third_party/go/gc/src/runtime/asm_amd64.s:1774
Wraps: (6) could not convert a single message before hitting truncation
Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *withstack.withStack (4) *withstack.withStack (5) *withstack.withStack (6) *errutil.leafError

Hi @Siam_Musa @P_Kurusinski,

Welcome to the Forum,

Error: agent executor error: could not convert a single message before hitting truncation

This error means the AI agent’s context window is full, often due to excessive information from enabled tools or services. You can try the workarounds suggested here to prevent this issue.

Context full after first message. Understood.

Claude is okay, but Gemini gets this error even at the start of a new session.
And instead of thinking about the actual question, its thought process looks like this:

Refining Operational Protocols I’ve been meticulously refining my operational protocols. I’m actively avoiding the use of ‘cat’ for file creation or appending, opting for more secure and efficient methods. I’m prioritizing grep_search over grep within Bash commands, and steering clear of ‘ls’ and ‘cat’ for simple listing and viewing tasks. The goal is to optimize and reinforce security.

Listing Relevant Tools I’m now focusing on tool selection for specific tasks. I need to locate todo.md or plan.md. I’ve listed list_dir and find_by_name as potential options, remembering Windows file names are case-insensitive. Before execution, I intend to verify MEMORY.md’s current status, so I’ll utilize view_file on its recent lines.

There were no slash commands used here.

Odd how the thought process when I want Gemini to figure things out on it’s own looks like yours for the first step. Even when specifying a skill to reduce the context window still produces this error for Pro and Flash regardless. I am working on a small website, nothing too extreme, and far smaller than my other projects in Kiro and even AI Studio, but Antigravity has been unable to even do anything without Claude assistance for weeks.

same error after the latest update

Rollback to 1.19.6 and turn off auto updates for antigravity. Thank me later