Skip to content

StructuredOutput gets in a loop #775

@jerbob92

Description

@jerbob92

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='<StructuredOutput>\n<parameter name="found_useful_information">false</parameter>\n<parameter name="answer">answertext</parameter>\n<parameter name="sources">[]</parameter>\n</StructuredOutput>')], 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 <StructuredOutput> type of text output. It somehow thinks that using <StructuredOutput> 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.

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