Skip to content

Claude sending refusal as stop reason when tool calls are rejected #151

@joeljohansson99

Description

@joeljohansson99

So both when rejecting a plan and when rejecting a tool call, Claude is sending refusal as the stop reason for the prompt turn. This is quite confusing as it says in the protocol that the reason is: The Agent refuses to continue. This is not actually the case.

I do not know what Claude was sending before, but this does not seem right. I think it should probably send a cancelled, if I had to choose. Perhaps you could even think about creating a new stop reason for cases like this.

This is also creating confusion in the Zed editor, see: zed-industries/zed#42152.

Also, Claude is sending weird user chunk messages after rejections, like this: [Request interrupted by user for tool use]. I guess we can ignore/filter them out, but it started at about the same time as the refusal stop reasons, so they might be connected.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions