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
I'm using Kimi K2 Thinking from bedrock and get the following error in plan mode: undefined: The content field in the Message object at messages.3 is empty. Add a ContentBlock object to the content field and try again.
I can confirm the same error with AWS Bedrock with Minimax M2 (after a while), Kimi K2 (after a while), but the Claude Sonnet and Opus 4.5 and AWS Nova Pro works just fine.
I can confirm the same error with AWS Bedrock with Minimax M2 (after a while), Kimi K2 (after a while), but the Claude Sonnet and Opus 4.5 and AWS Nova Pro works just fine.
I tried Minimax M2 from AWS Bedrock and it worked fine, but I will try it on a long running task. I'm using opencode version 1.1.42
▼ 21:52:47 [DEBUG] message_part_updated
{
data = {
_directory = "/Users/admin/work/lua/opencode.nvim",
part = {
id = "prt_c5331af40001C45ZG6iO3Atuv4",
messageID = "msg_c5331a388001LciZI4AcrQA9nK",
sessionID = "ses_3accfab03ffeUoFBVUj3SfoIEL",
text = " ## Analysis\n\nNow I understand the issue! The user cannot enter normal mode while using the widget for selecting models. Let me analyze the keymaps in the `create_sea... <|tool_calls_section_begin|> <|tool_call_begin|> functions.grep:6 <|tool_call_argument_begin|> {"pattern": "startinsert", "path": "/Users/admin/work/lua/opencode.nvim", "include": "*.lua"} <|tool_call_end|> <|tool_calls_section_end|>
time = {
["end"] = 1770922367158,
start = 1770922291008
},
type = "reasoning"
}
}
}
I am seeing this with some regularity using bedrock. Two different error messages:
undefined: There is nothing available to cache. Please remove the invalid cache point and try again.
...
undefined: The content field in the Message object at messages.99 is empty. Add a ContentBlock object to the content field and try again.
I haven't figured out a good workaround. Forking the session doesn't seem to fix it consistently.
I've been looking into this and there are a couple of things that need to be fixed, related with how Bedrock handles tool calls with the ConverseAPI. I still need to do some tests but I should have a PR later today or tomorrow. @rekram1-node I might check with you on discord to see what you think about this
Opened a fix for this: #14586. Extends the empty content filtering in normalizeMessages() to cover @ai-sdk/amazon-bedrock. I noticed this happened on Anthropic models on bedrock too. One-line change + tests.
@Tom-Ryder your pr is only partly addressing the issue here. idk if you tested your changes by getting Kimi 2 to make a tool call, but with them, a chat with Kimi 2 Thinking still stops after a tool call.
As I mentioned before, the root cause is how Amazon Bedrock ConverseAPI handles tool calls and how Kimi 2 Thinking sends them.
@NachoFLizaur Yeah, I am aware of the tool call issues on the Bedrock side, and they have fixes in flight for them. This PR specifically targets the empty content filtering that also breaks Claude models on Bedrock (both the "content field is empty" and "nothing available to cache" errors). Should be complementary to a broader Bedrock tool call fix.
I ran into this on v1.2.11 with Kimi K2.5 and K2 Thinking on Bedrock. PR #14586 fixes the empty-string content case, but there's a second path that still produces empty content after that fix.
The interleaved reasoning filter at transform.ts:136-169 runs after the empty content guard at lines 52-72. When a model has interleaved: { field: "reasoning_content" }, it strips reasoning parts from content and moves them to providerOptions. If an assistant message has only reasoning parts (no text or tool-call), filteredContent becomes []. The empty content guard already ran at that point, so nothing catches this.
I applied PR #14586's change locally and confirmed the bug still reproduces:
constmsgs=[{role: "user",content: "hello"},{role: "assistant",content: [{type: "reasoning",text: "Let me think about this..."},],},{role: "user",content: "go on"},]asany[]constresult=ProviderTransform.message(msgs,kimiK2_5BedrockModel,{})// result[1].content === [] still empty even with #14586 applied
The empty content guard at line 62 keeps these parts because their text is not empty. They have real content. Then the interleaved filter at line 144 strips them anyway. A post-filter check in the interleaved block, or moving the empty content guard to run after all transforms, would catch this.
Also, once this hits, switching to Claude Opus in the same session doesn't help. The empty message is stuck in the history and breaks every model until you start a new session.
Good catch. I've added a post-filter check in the interleaved block. Assistant messages where filteredContent.length === 0 after stripping reasoning parts are now dropped rather than passed to Bedrock as content: []. PR updated.
Worth noting: for Kimi K2.5 and K2 Thinking on Bedrock specifically, models.dev currently returns interleaved: true (plain boolean) for those models, not the object form {field: "reasoning_content"}. The interleaved block only fires for the object form, so the real-world errors with Kimi were, I think, coming from the empty-string path. The object-form interleaved path currently affects zai.glm-4.7 on Bedrock. Either way the PR now covers both.
Edit: For my case, it only happens when it tries to compact.
As a workaround, I change the model, run /compact command and change back to bedrock models. Works for now.
Reacted by Tom Ryder, Juan Pablo (JP) and mapuya19
Confirming this is still reproducible for Bedrock-only Claude workflows. Also supporting PR #14586 as the concrete fix path for the empty-content validation failure.
Activity
github-actions commentedon Jan 29, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Jan 29, 2026
can u do
opencode export > session.json(run it in your terminal) and send me the file?Ilia-TheNetworkFirm commentedon Jan 30, 2026
I have the same problem with AWS Bedrock. It just stops working, no errors. This is the last message from the session
{ "info": { "id": "msg_c0e43e070001hTCBgH6Zrlvy5d", "sessionID": "ses_3f1bc2d5bffe8l5qIdzMHGrHwi", "role": "assistant", "time": { "created": 1769765855344, "completed": 1769765856801 }, "parentID": "msg_c0e43d2a9001pMXmtXI2LMRfhw", "modelID": "moonshot.kimi-k2-thinking", "providerID": "amazon-bedrock", "mode": "build", "agent": "build", "path": { "cwd": "/app/redacted", "root": "/app/redacted" }, "cost": 0.0097642, "tokens": { "input": 16032, "output": 58, "reasoning": 0, "cache": { "read": 0, "write": 0 } }, "finish": "stop" }, "parts": [ { "id": "prt_c0e43e493001pVJ767CY6ZbyDX", "sessionID": "ses_3f1bc2d5bffe8l5qIdzMHGrHwi", "messageID": "msg_c0e43e070001hTCBgH6Zrlvy5d", "type": "step-start", "snapshot": "1b7f4a67e65f4eed88bad8209cdba3c06dbcd0af" }, { "id": "prt_c0e43e494001gSwAL8wgyxEHpO", "sessionID": "ses_3f1bc2d5bffe8l5qIdzMHGrHwi", "messageID": "msg_c0e43e070001hTCBgH6Zrlvy5d", "type": "reasoning", "text": " Now let me check the api POST handler: <|tool_calls_section_begin|> <|tool_call_begin|> tooluse_Vbs57l9NT6-Lu5tgQRwYjA{\"filePath\": \"/app/redacted/apps/api\"} <|tool_call_end|> <|tool_calls_section_end|>", "time": { "start": 1769765856404, "end": 1769765856722 } }, { "id": "prt_c0e43e5d3001w6VIfnEZTNfCZ7", "sessionID": "ses_3f1bc2d5bffe8l5qIdzMHGrHwi", "messageID": "msg_c0e43e070001hTCBgH6Zrlvy5d", "type": "step-finish", "reason": "stop", "snapshot": "1b7f4a67e65f4eed88bad8209cdba3c06dbcd0af", "cost": 0.0097642, "tokens": { "input": 16032, "output": 58, "reasoning": 0, "cache": { "read": 0, "write": 0 } } } ] }aries1980 commentedon Jan 30, 2026
I can confirm the same error with AWS Bedrock with Minimax M2 (after a while), Kimi K2 (after a while), but the Claude Sonnet and Opus 4.5 and AWS Nova Pro works just fine.
FarrukhCyber commentedon Jan 30, 2026
I tried Minimax M2 from AWS Bedrock and it worked fine, but I will try it on a long running task. I'm using opencode version
1.1.42wwnbb commentedon Feb 12, 2026
have the same issue with kimi 2.5 on chutes:
JayThomason commentedon Feb 20, 2026
I am seeing this with some regularity using bedrock. Two different error messages:
I haven't figured out a good workaround. Forking the session doesn't seem to fix it consistently.
rekram1-node commentedon Feb 20, 2026
Yeah I think Ik why this happens.
bbartels commentedon Feb 20, 2026
Running into this as well
angelDrivana commentedon Feb 21, 2026
Any updates on this? fix?
NachoFLizaur commentedon Feb 21, 2026
I've been looking into this and there are a couple of things that need to be fixed, related with how Bedrock handles tool calls with the ConverseAPI. I still need to do some tests but I should have a PR later today or tomorrow. @rekram1-node I might check with you on discord to see what you think about this
Tom-Ryder commentedon Feb 21, 2026
Opened a fix for this: #14586. Extends the empty content filtering in normalizeMessages() to cover @ai-sdk/amazon-bedrock. I noticed this happened on Anthropic models on bedrock too. One-line change + tests.
NachoFLizaur commentedon Feb 21, 2026
@Tom-Ryder your pr is only partly addressing the issue here. idk if you tested your changes by getting Kimi 2 to make a tool call, but with them, a chat with Kimi 2 Thinking still stops after a tool call.
As I mentioned before, the root cause is how Amazon Bedrock ConverseAPI handles tool calls and how Kimi 2 Thinking sends them.
Tom-Ryder commentedon Feb 21, 2026
@NachoFLizaur Yeah, I am aware of the tool call issues on the Bedrock side, and they have fixes in flight for them. This PR specifically targets the empty content filtering that also breaks Claude models on Bedrock (both the "content field is empty" and "nothing available to cache" errors). Should be complementary to a broader Bedrock tool call fix.
NachoFLizaur commentedon Feb 21, 2026
Fair enough, you are right! Might be worth opening the discussion on how to tackle the tool calls in a separate issue for the future.
Thanks!
jpvelasco commentedon Feb 25, 2026
I ran into this on v1.2.11 with Kimi K2.5 and K2 Thinking on Bedrock. PR #14586 fixes the empty-string content case, but there's a second path that still produces empty content after that fix.
The interleaved reasoning filter at
transform.ts:136-169runs after the empty content guard at lines 52-72. When a model hasinterleaved: { field: "reasoning_content" }, it strips reasoning parts fromcontentand moves them toproviderOptions. If an assistant message has only reasoning parts (no text or tool-call),filteredContentbecomes[]. The empty content guard already ran at that point, so nothing catches this.I applied PR #14586's change locally and confirmed the bug still reproduces:
The empty content guard at line 62 keeps these parts because their text is not empty. They have real content. Then the interleaved filter at line 144 strips them anyway. A post-filter check in the interleaved block, or moving the empty content guard to run after all transforms, would catch this.
Also, once this hits, switching to Claude Opus in the same session doesn't help. The empty message is stuck in the history and breaks every model until you start a new session.
Tom-Ryder commentedon Feb 25, 2026
Good catch. I've added a post-filter check in the interleaved block. Assistant messages where filteredContent.length === 0 after stripping reasoning parts are now dropped rather than passed to Bedrock as content: []. PR updated.
Worth noting: for Kimi K2.5 and K2 Thinking on Bedrock specifically, models.dev currently returns interleaved: true (plain boolean) for those models, not the object form {field: "reasoning_content"}. The interleaved block only fires for the object form, so the real-world errors with Kimi were, I think, coming from the empty-string path. The object-form interleaved path currently affects zai.glm-4.7 on Bedrock. Either way the PR now covers both.
marcosvrs commentedon Mar 4, 2026
This is happening not only for Kimi, but as well for Claude (reproducible with sonnet 4.5 and opus 4.6)
Edit: For my case, it only happens when it tries to compact.
As a workaround, I change the model, run
/compactcommand and change back to bedrock models. Works for now.marcosvrs commentedon Mar 8, 2026
Confirming this is still reproducible for Bedrock-only Claude workflows. Also supporting PR #14586 as the concrete fix path for the empty-content validation failure.