Skip to content

Fix opencode max-steps assistant prefill for Anthropic#26

Open
Mucka wants to merge 1 commit into
dotCipher:mainfrom
Mucka:fix/max-steps-assistant-prefill
Open

Fix opencode max-steps assistant prefill for Anthropic#26
Mucka wants to merge 1 commit into
dotCipher:mainfrom
Mucka:fix/max-steps-assistant-prefill

Conversation

@Mucka

@Mucka Mucka commented Jul 16, 2026

Copy link
Copy Markdown

Fixes Anthropic request failures when opencode appends its max-steps instruction as an assistant prefill.

When an opencode agent reaches its configured steps limit, opencode appends a final assistant-role message beginning with:

CRITICAL - MAXIMUM STEPS REACHED

Anthropic rejects that shape for some Claude models with:

This model does not support assistant message prefill. The conversation must end with a user message.

The bridge already strips the older synthetic Continue with your tasks. assistant prefill. This change extends that handling for opencode's max-steps prefill by converting it into a final user message instead of dropping it. That keeps the intended "tools are disabled, summarize text-only" instruction while satisfying Anthropic's requirement that the conversation ends with a user message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant