Skip to content

Commit f08a048

Browse files
Responses: include assistant function_call items but omit reasoning passthrough
- Keep assistant function_call in input so paired tool outputs validate - Do not echo prior 'reasoning' items to avoid ordering constraints Co-authored-by: openhands <[email protected]>
1 parent 772ce28 commit f08a048

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

openhands-sdk/openhands/sdk/llm/message.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,11 @@ def to_responses_dict(self, *, vision_enabled: bool) -> list[dict[str, Any]]:
466466
# Do not echo back prior turn's reasoning item. The Responses API
467467
# does not require sending these back, and including them can cause
468468
# validation constraints (ordering requirements).
469-
# Do NOT emit assistant function_call items in input.
470-
# The server already has the assistant tool calls from its previous
471-
# output; the client should only send function_call_output items.
469+
# Emit assistant function_call items; the client will also send
470+
# the corresponding function_call_output items in the same request.
471+
if self.tool_calls:
472+
for tc in self.tool_calls:
473+
items.append(tc.to_responses_dict())
472474
return items
473475

474476
if self.role == "tool":

0 commit comments

Comments
 (0)