Skip to content

fix(agent): use last text step as AgentResult.Response#283

Merged
taciturnaxolotl merged 1 commit into
mainfrom
improve-last-message
Jun 16, 2026
Merged

fix(agent): use last text step as AgentResult.Response#283
taciturnaxolotl merged 1 commit into
mainfrom
improve-last-message

Conversation

@taciturnaxolotl

Copy link
Copy Markdown
Member

When the agent's final step was tool-only (no text content), AgentResult.Response copied that empty step, causing callers to see no output even though earlier steps produced text. finalResponse now walks backwards to find the most recent step with non-blank text. Also clarifies that Text() returns the first text block.

When the agent's final step was tool-only (no text content),
AgentResult.Response copied that empty step, causing callers to see
no output even though earlier steps produced text. finalResponse now
walks backwards to find the most recent step with non-blank text.
Also clarifies that Text() returns the first text block.
@taciturnaxolotl taciturnaxolotl merged commit 47c7123 into main Jun 16, 2026
11 checks passed
@taciturnaxolotl taciturnaxolotl deleted the improve-last-message branch June 16, 2026 17:24
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.

2 participants