Description
π Issue: Claude Sonnet 4.6 Breaking Change β Assistant Prefill Not Supported
Overview
While migrating from claude-sonnet-4-5 to claude-sonnet-4-6, Agno agents and teams fail with a 400 error related to assistant message prefilling.
This issue appears to stem from a breaking change introduced in Claude Sonnet 4.6, where assistant message prefilling is no longer supported.
π Reference (Official Migration Guide)
According to the official Anthropic migration guide:
https://platform.claude.com/docs/en/about-claude/models/migration-guide
"Prefilling assistant messages returns a 400 error on Sonnet 4.6. Use structured outputs, system prompt instructions, or output_config.format instead."
π Steps to Reproduce
- Create an Agno agent or team
- Configure the model as
claude-sonnet-4-6
- Execute the agent or team workflow
- Observe failure with a 400 invalid_request_error
π Analysis
Agno appears to construct conversations where the final message role is assistant (e.g., agent outputs or internal chaining).
This pattern was valid in Claude Sonnet 4.5 but is now rejected in 4.6.
Claude Sonnet 4.6 Constraints:
- Conversation must end with a
user message
- Assistant prefill is no longer supported
π Regression
This behavior worked correctly with:
Steps to Reproduce
- Create an Agno agent or team
- Configure the model as
claude-sonnet-4-6
- Execute the agent or team workflow
- Observe failure with a 400 invalid_request_error
Agent Configuration (if applicable)
No response
Expected Behavior
Agno agents and teams should work seamlessly with Claude Sonnet 4.6 without requiring manual restructuring of message roles.
Actual Behavior
Execution fails with:
invalid_request_error
- Message:
"This model does not support assistant message prefill. The conversation must end with a user message."
Screenshots or Logs (if applicable)
ERROR Claude API error (status 400): Error code: 400 - {
'type': 'error',
'error': {
'type': 'invalid_request_error',
'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'
}
}
ERROR Non-retryable model provider error: Error code: 400 - {
'type': 'error',
'error': {
'type': 'invalid_request_error',
'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'
}
}
ERROR Error in Team run: Error code: 400 - {
'type': 'error',
'error': {
'type': 'invalid_request_error',
'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'
}
}
Environment
- **Framework:** Agno
- **Model:** claude-sonnet-4-6
- **Provider:** Anthropic API
- **OS:** Linux
Possible Solutions (optional)
- Adapt Agnoβs message construction to ensure the final role is
user
- OR provide built-in compatibility handling for Claude 4.6 models
Additional Context
No response
Description
π Issue: Claude Sonnet 4.6 Breaking Change β Assistant Prefill Not Supported
Overview
While migrating from
claude-sonnet-4-5toclaude-sonnet-4-6, Agno agents and teams fail with a 400 error related to assistant message prefilling.This issue appears to stem from a breaking change introduced in Claude Sonnet 4.6, where assistant message prefilling is no longer supported.
π Reference (Official Migration Guide)
According to the official Anthropic migration guide:
https://platform.claude.com/docs/en/about-claude/models/migration-guide
π Steps to Reproduce
claude-sonnet-4-6π Analysis
Agno appears to construct conversations where the final message role is
assistant(e.g., agent outputs or internal chaining).This pattern was valid in Claude Sonnet 4.5 but is now rejected in 4.6.
Claude Sonnet 4.6 Constraints:
usermessageπ Regression
This behavior worked correctly with:
claude-sonnet-4-5Steps to Reproduce
claude-sonnet-4-6Agent Configuration (if applicable)
No response
Expected Behavior
Agno agents and teams should work seamlessly with Claude Sonnet 4.6 without requiring manual restructuring of message roles.
Actual Behavior
Execution fails with:
invalid_request_error"This model does not support assistant message prefill. The conversation must end with a user message."
Screenshots or Logs (if applicable)
ERROR Claude API error (status 400): Error code: 400 - {
'type': 'error',
'error': {
'type': 'invalid_request_error',
'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'
}
}
ERROR Non-retryable model provider error: Error code: 400 - {
'type': 'error',
'error': {
'type': 'invalid_request_error',
'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'
}
}
ERROR Error in Team run: Error code: 400 - {
'type': 'error',
'error': {
'type': 'invalid_request_error',
'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'
}
}
Environment
Possible Solutions (optional)
userAdditional Context
No response