Skip to content

Conversation

@jsibbison-square
Copy link
Contributor

@jsibbison-square jsibbison-square commented Jul 16, 2025

When streaming was introduced #2677 a bug was introduced around structured output. Every text streaming chunk has no tool calls and so the inner loop would check if final output had been recorded yet and send a warning directive to the agent rather than waiting till the end of the llm's response.

image

Added a test that would have caught this (tested against main).

@jsibbison-square jsibbison-square requested a review from jamadeo July 16, 2025 03:50
@jsibbison-square jsibbison-square marked this pull request as ready for review July 16, 2025 04:53
@jsibbison-square jsibbison-square changed the title Fixes structured output after streaming change to agent fix: Fixes structured output after streaming change to agent Jul 16, 2025
}

#[tokio::test]
async fn test_when_final_output_not_called_in_reply() -> Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test thanks @jsibbison-square

@jamadeo jamadeo merged commit eda8100 into main Jul 16, 2025
8 checks passed
@jamadeo jamadeo deleted the jsibbison-20250716-structured-output-fix branch July 16, 2025 10:46
lifeizhou-ap added a commit that referenced this pull request Jul 16, 2025
* main:
  fix: Fixes structured output after streaming change to agent (#3448)
s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 2025
kwsantiago pushed a commit to kwsantiago/goose that referenced this pull request Jul 19, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
atarantino pushed a commit to atarantino/goose that referenced this pull request Aug 5, 2025
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.

4 participants