Skip to content

bug: turn ending with content-filter finish reason stops silently #31744

@kkdawkins

Description

@kkdawkins

Description

When a provider ends a turn with a content filter (e.g. Anthropic stop_reason: refusal, which the protocol layer maps to the content-filter finish reason), the assistant message records the finish reason but no error is attached. If the turn produced no visible output (only empty reasoning + finish), the session goes idle with nothing rendered — it looks like opencode just stopped responding.

Hit this 3 times in one session on an ordinary code-review task with an Anthropic model. Related but distinct from #30411 (that one is empty turns under context pressure; this is specifically the content-filter finish path).

Plugins

none

OpenCode version

1.17.3

Steps to reproduce

  1. Run a prompt where the provider's safety classifier fires (Anthropic returns stop_reason: refusal)
  2. The turn ends with finish reason content-filter and no text/tool parts
  3. Session goes idle with no error box, no notification, nothing visible

Operating System

macOS

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions