Tool calls requested using add_tool_call() are not persisted in .to_dict()
bugtools
Spotted this problem while trying to write some custom serialization logic.
If a model plugin calls `.add_tool_call()` but does not also emit corresponding `StreamEvent()` objects and that response is then serialized using the new `.to_dict()` methods the tool calls will NOT be captured in that serialization.
This leads to errors later on when the conversation is continued but it turns out there are tool responses with no recorded corresponding tool calls.
Here's how Codex described the issue after we ran into it: https://gist.github.com/simonw/3f483cfa4655044885dba8ab0629a6a3
2 条评论