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
"AI_APICallError: Text content blocks must contain non-whitespace text" on /compact #1681
I am running the Claude Pro Max model with Opencode. Whenever I try to run /compact , I get the error:
AI_APICallError: system: text content blocks must contain non-whitespace text
And this ruins the formatting of the opencode terminal so I have to restart the command prompt. Eventually this makes opencode unusable because the auto-compact doesn't seem to work either.
I think the error originates from node_modules/@ai-sdk/provider/dist/index.js:62:5 .
At least, that is the minimal error I can see in the messed up opencode terminal.
changed the title [-]Text content blocks must contain non-whitespace text[/-][+]"AI_APICallError: Text content blocks must contain non-whitespace text" on /compact[/+]on Aug 9, 2025
Hello, I've got que same problem. Build with GLM 4.6 = > 0K
when Plan Mode with Ko => AI_APICallError: messages: text content blocks must contain non-whitespace text
undo or quit and launch opencode => AI_APICallError: messages: text content blocks must contain non-whitespace text
Swap to Build mode => OK !
Swap to plan mode => KO ! AI_APICallError: messages: text content blocks must contain non-whitespace text
Swap to GLM in plan mode (instead of Claude Sonnet) ===> OK ! => make a plan => Build with GLM => Plan mode => talk with glm ok => swapto claude AI_APICallError: messages: text content blocks must contain non-whitespace text
It seems like the model Claude is fall ! But if you start a new session with Claude it is OK !
You go back to the falled session => KO : AI_APICallError: messages: text content blocks must contain non-whitespace text
I sent you in X ! the first It blocked me , but the second I can :-) You can open private vunlerability in github to send private issue. Hope this will help.
I have configured the Haiku 4.5 model in default build. I am making my plan with a mixture of GLM 4.6 and Sonnet 4.5.
As soon as I switch back to build and launch the go for modifications, I get the error ‘messages: text content blocks must contain non-whitespace text’.
I only have this problem with Haiku 4.5.
Does anyone else have this problem? Thank you for your help.
Activity
[-]Text content blocks must contain non-whitespace text[/-][+]"AI_APICallError: Text content blocks must contain non-whitespace text" on /compact[/+]IshanArya commentedon Aug 14, 2025
Hi, @thdxr any idea why this might be happening so I can look into it? I really like Opencode but this bug makes it really hard to use.
I tried reinstalling Opencode and the issue persisted.
rekram1-node commentedon Aug 29, 2025
What model was this?
DxTa commentedon Oct 5, 2025
I got similar issue with Opus 4.1 via claude code subscription
rekram1-node commentedon Oct 5, 2025
can u share session?
RaphGod commentedon Oct 12, 2025
Hello, I've got que same problem. Build with GLM 4.6 = > 0K
when Plan Mode with Ko => AI_APICallError: messages: text content blocks must contain non-whitespace text
undo or quit and launch opencode => AI_APICallError: messages: text content blocks must contain non-whitespace text
Swap to Build mode => OK !
Swap to plan mode => KO ! AI_APICallError: messages: text content blocks must contain non-whitespace text
Swap to GLM in plan mode (instead of Claude Sonnet) ===> OK ! => make a plan => Build with GLM => Plan mode => talk with glm ok => swapto claude AI_APICallError: messages: text content blocks must contain non-whitespace text
It seems like the model Claude is fall ! But if you start a new session with Claude it is OK !
You go back to the falled session => KO : AI_APICallError: messages: text content blocks must contain non-whitespace text
The problem is in the session wich is corrupted.
RaphGod commentedon Oct 12, 2025
i can share session but not in public, tell me how I can send you
rekram1-node commentedon Oct 12, 2025
@RaphGod you can dm on discord or x if that works
RaphGod commentedon Oct 12, 2025
I sent you in X ! the first It blocked me , but the second I can :-) You can open private vunlerability in github to send private issue. Hope this will help.
IshanArya commentedon Oct 15, 2025
Hi I was using sonnet 4.1 before. However, with sonnet 4.5, when I call
/compact, the terminal gets stuck on:rekram1-node commentedon Oct 16, 2025
fix: d8a15e7
reise69 commentedon Oct 24, 2025
Hello,
I have configured the Haiku 4.5 model in default build. I am making my plan with a mixture of GLM 4.6 and Sonnet 4.5.
As soon as I switch back to build and launch the go for modifications, I get the error ‘messages: text content blocks must contain non-whitespace text’.
I only have this problem with Haiku 4.5.
Does anyone else have this problem? Thank you for your help.
rekram1-node commentedon Oct 24, 2025
@reise69 i know what caused your issue ill fix soon
IshanArya commentedon Oct 28, 2025
Awesome,
/compactis working now, thank you!777akot commentedon Jan 29, 2026
/undo until your message with whitespaces
feat(app): improve rename dialogs (anomalyco#1681)