anthropics / anthropics/claude-agent-sdk-python

StructuredOutput gets in a loop

未关闭
#775 0 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
8.1k
派生
1.3k
平均合并
2 天 31 分钟
30 天内合并 PR
1

描述

Sometimes I have that `StructuredOutput` gets in a loop where it keeps trying to correct itself. It basically goes like this:

```
AssistantMessage(content=[TextBlock(text='\nfalse\nanswertext\n[]\n')], model='claude-sonnet-4-6'....
```

```
UserMessage(content=[TextBlock(text='Stop hook feedback:\nYou MUST call the StructuredOutput tool to complete this request. Call this tool now.')], uuid='191538a1-0dd7-415c-a728-50165282a087', parent_tool_use_id=None, tool_use_result=None)
```

And then it just keeps repeating the same pattern, it never calls the StructuredOutput tool, it just keeps on trying this odd `` type of text output. It somehow thinks that using `` is the same thing as calling it?

It also gets stuck inside this loop for WAY too long (basically until it hit the max budget), this should be restricted somehow.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。