Skip to content

feat: support codex custom tool type#101

Draft
haoshan98 wants to merge 5 commits into
vllm-project:mainfrom
EmbeddedLLM:codex-custom-tool
Draft

feat: support codex custom tool type#101
haoshan98 wants to merge 5 commits into
vllm-project:mainfrom
EmbeddedLLM:codex-custom-tool

Conversation

@haoshan98

@haoshan98 haoshan98 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Codex declares freeform tools such as apply_patch with type: "custom". Unlike function tools, these declarations can
include an opaque grammar, and their calls carry raw text in input rather than JSON in arguments. The typed Responses
path previously could not preserve that protocol through upstream inference, streaming, storage, and continuation.

  • Add typed request, response, and input models for custom tool declarations, custom_tool_call items, and custom_tool_call_output results while preserving unknown format fields.
  • Forward custom tool declarations to the upstream Responses endpoint without converting them to function tools.
  • Normalize and accumulate custom-tool streaming input events, return custom calls to the client for execution, and retain the call/output pair during stateful continuation.
  • Keep custom calls client-owned in the shared tool loop while gateway-owned MCP and web-search calls continue to execute
    through their registered handlers.
  • Persist terminal WebSocket responses before emitting completion so Codex can immediately continue a client-owned tool call without losing stored state when it closes the socket.
  • Handle Codex WebSocket generate: false startup prewarm requests locally, persist their prompt and tool context, and avoid unnecessary upstream inference.
  • Preserve and log structured upstream streaming failure details to make rejected tool requests diagnosable.
  • Add an isolated catalog/cache seed helper that writes both Codex catalog files so freeform apply_patch remains
    available after the ordinary model cache expires.
  • Document direct gateway, codex exec, and interactive Codex verification workflows.

Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com>
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.

1 participant