Skip to content

fix: place reminder text after tool_result in message content#120

Open
leekaimao wants to merge 1 commit intoshareAI-lab:mainfrom
leekaimao:fix/todo-reminder-order
Open

fix: place reminder text after tool_result in message content#120
leekaimao wants to merge 1 commit intoshareAI-lab:mainfrom
leekaimao:fix/todo-reminder-order

Conversation

@leekaimao
Copy link

Summary

  • Fix bug where reminder text was inserted before tool_result blocks
  • Changed insert(0, ...) to append(...) to comply with Anthropic API requirement

Test plan

  • Run agents/s03_todo_write.py and let it run 3+ rounds without todo update
  • Verify no API error occurs

The reminder was incorrectly inserted at the beginning of the results
list, which violates Anthropic API's requirement that tool_result must
immediately follow tool_use. Changed insert(0, ...) to append(...) to
place the reminder after all tool_result blocks.

Fixes BadRequestError: tool_use ids were found without tool_result
blocks immediately after.
@vercel
Copy link

vercel bot commented Mar 23, 2026

@leekaimao is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant