Skip to content

[Bug]: Open Responses API: server-tool results (e.g. execute_code stdout) are never emitted or persisted as function_call_output #16313

Description

@vaibhav-Singh9888

What happened?

When an agent runs a server-side tool (e.g. execute_code) through POST /api/agents/v1/responses, the tool's result is never emitted on the stream or persisted. The response output contains the function_call item (with arguments) but no matching function_call_output item, so an API consumer sees the call but not its output. (/chat/completions and normal chat surface the result fine.)

Expected
A function_call_output item carrying the tool's textual result, per the Open Responses spec.

Likely cause (code inspection)
The Responses tool-end callback (createResponsesToolEndCallback, api/server/controllers/agents/callbacks.js) early-returns when there's no output.artifact and never emits the tool's text result (output.content) via emitFunctionCallOutputItem. responses.js wires on_tool_end to that artifact-only handler; the on_tool_end in packages/api/src/agents/responses/service.ts that does call emitFunctionCallOutputItem is never wired into the Responses graph.

Version Information

current main (v0.8.8-rc4)

Steps to Reproduce

  1. Configure an agent with execute_code enabled.
  2. POST /api/agents/v1/responses {"model":"agent_xxx","input":"run python that prints 2+2","stream":false}.
  3. Inspect response.output: there is a function_call item but no corresponding function_call_output.

What browsers are you seeing the problem on?

No response

Relevant log output

NA

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions