Bug Description
On a subsequent turn of a long-running conversation, Forge sends a request to https://api.anthropic.com/v1/messages that Anthropic rejects with 400 Bad Request:
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages.17: The final block in an assistant message cannot be `thinking`."
},
}
Once this state is reached the conversation is dead — every retry hits the same 400 because the invalid message is now persisted in the context DB and replayed on every request.
Steps to Reproduce
Sadly, this depends on bad luck to reproduce, you need execute_chat_turn to return a ChatCompletionMessageFull with:
content = ""
tool_calls.is_empty() == true
reasoning_details = Some([{ text: Some, signature: Some }])
Which persist an invalid message into the conversation context
Expected Behavior
The request to Anthropic must never have an assistant message whose final block is thinking.
Actual Behavior
The reasoning-only message is serialized as [Thinking { … }].
Anthropic rejects the full request with a 400, citing messages.N: The final block in an assistant message cannot be 'thinking'.
Because the bad message is already persisted in the conversation DB, every retry reproduces the same 400.
Forge Version
2.11.3
Operating System & Version
Win11
AI Provider
Anthropic
Model
opus-4-7
Installation Method
Other
Configuration
Bug Description
On a subsequent turn of a long-running conversation, Forge sends a request to
https://api.anthropic.com/v1/messagesthat Anthropic rejects with400 Bad Request:Once this state is reached the conversation is dead — every retry hits the same 400 because the invalid message is now persisted in the context DB and replayed on every request.
Steps to Reproduce
Sadly, this depends on bad luck to reproduce, you need
execute_chat_turnto return aChatCompletionMessageFullwith:content = ""tool_calls.is_empty() == truereasoning_details = Some([{ text: Some, signature: Some }])Which persist an invalid message into the conversation context
Expected Behavior
The request to Anthropic must never have an assistant message whose final block is
thinking.Actual Behavior
The reasoning-only message is serialized as
[Thinking { … }].Anthropic rejects the full request with a 400, citing
messages.N: The final block in an assistant message cannot be 'thinking'.Because the bad message is already persisted in the conversation DB, every retry reproduces the same 400.
Forge Version
2.11.3
Operating System & Version
Win11
AI Provider
Anthropic
Model
opus-4-7
Installation Method
Other
Configuration