Skip to content

Conversation

@timonv
Copy link
Member

@timonv 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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 198 to 207
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(),

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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