-
Notifications
You must be signed in to change notification settings - Fork 50
chore(integrations/openai): Update async-openai to 0.31 #978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
timonv
commented
Dec 7, 2025
- Bump version
- Draft
- Reduce allocs
- Reduce allocs
- wip
- Fix tests
- Clippy + fmt
- Improve tests
- Add more tests
- Minimal feature flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ChatMessage::ToolOutput(tool_call, tool_output) => { | ||
| let mut payload = serde_json::Map::new(); | ||
| payload.insert( | ||
| "type".into(), | ||
| serde_json::Value::String("function_call_output".into()), | ||
| ); | ||
| payload.insert( | ||
| "call_id".into(), | ||
| serde_json::Value::String(tool_call.id().to_owned()), | ||
| ); | ||
|
|
||
| let output_value = match tool_output { | ||
| ToolOutput::FeedbackRequired(value) => { | ||
| value.clone().unwrap_or(serde_json::Value::Null) | ||
| } | ||
| let output = match tool_output { | ||
| ToolOutput::FeedbackRequired(value) | ||
| | ToolOutput::Stop(value) | ||
| | ToolOutput::AgentFailed(value) => FunctionCallOutput::Text( | ||
| value | ||
| .as_ref() | ||
| .and_then(|v| v.as_str()) | ||
| .unwrap_or_default() | ||
| .to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve structured tool outputs for Responses API
When translating chat tool outputs to Responses API items, FeedbackRequired, Stop, and AgentFailed variants now downcast their payloads via as_str().unwrap_or_default(), so any non‑string JSON (e.g., a map returned by ToolOutput::stop_with_args(json!({"foo":"bar"}))) is silently turned into an empty string before sending. In the previous implementation these variants forwarded the full serde_json::Value, so the model could see the structured payload; with the new code, structured tool outputs vanish, producing blank tool responses and losing the information that callers provided.
Useful? React with 👍 / 👎.