Skip to content

fix(openai): only reuse previous_response_id when pending tool calls are completed#5094

Merged
longcw merged 1 commit intomainfrom
longc/oai-responses-pending-tools
Mar 13, 2026
Merged

fix(openai): only reuse previous_response_id when pending tool calls are completed#5094
longcw merged 1 commit intomainfrom
longc/oai-responses-pending-tools

Conversation

@longcw
Copy link
Contributor

@longcw longcw commented Mar 12, 2026

fix #5092

@chenghao-mou chenghao-mou requested a review from a team March 12, 2026 07:41
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

completed_tool_calls = {
item.call_id for item in items if item.type == "function_call_output"
}
return all(call_id in completed_tool_calls for call_id in self._pending_tool_calls)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to remove completed ones from the set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pending_tool_calls is bound with response_id, so perhaps keep it and reset when response_id changed.

@longcw longcw merged commit f72c576 into main Mar 13, 2026
19 of 20 checks passed
@longcw longcw deleted the longc/oai-responses-pending-tools branch March 13, 2026 01:40
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.

openai.responses.LLM breaks when user interrupts during active tool call (400: No tool output found)

2 participants