Skip to content

[Bug]: OpenCode Go native Responses path leaks undeclared apply_patch and shows aborted #1700

Description

@rodrigueez

Client or integration

Codex App

Area

Provider adapter

Summary

OpenCodex 2.17.0 leaks an undeclared top-level apply_patch function call through the native OpenAI Responses passthrough path when using OpenCode Go. Codex App displays aborted, while the target file remains unchanged.

Expected behavior: an undeclared routed tool should fail closed with an explicit compatibility error before reaching the Codex executor. The supported editing path should remain exec -> tools.apply_patch(...).

Reproduction

  1. Start OpenCodex on port 10100.
  2. Use exec -> tools.apply_patch(...) to create a temporary file containing v1.
  3. Invoke top-level apply_patch with a patch changing v1 to v2.
  4. Codex App displays aborted.
  5. The file remains v1; content and mtime are unchanged.
  6. Run the equivalent patch through exec -> tools.apply_patch(...):
    • an incorrect expected line returns a real apply_patch verification failed error;
    • the correct v1 -> v3 patch succeeds.

The request-visible catalog contains exec, wait, and request_user_input, but no top-level apply_patch schema. The session nevertheless receives function_call(name=apply_patch).

Version

OpenCodex 2.17.0

Operating system

macOS 27.0, Apple Silicon

Provider and model

Provider: opencode-go

Model: deepseek-v4-flash

At reproduction time, the provider default was openai-chat, while this model had an explicit openai-responses adapter override.

Logs or error output

  • Codex result: aborted
  • No corresponding custom_tool_call_output was emitted.
  • OpenCode Go usage record was HTTP 200.
  • No upstream aborted, OpenCodex response.failed, approval denial, or sandbox denial was observed.

Screenshots and supporting files

No screenshots. Reproduction artifacts were written only under /tmp.

Redacted configuration

{
  "providers": {
    "opencode-go": {
      "adapter": "openai-chat",
      "baseUrl": "https://opencode.ai/zen/go/v1",
      "modelAdapters": {
        "deepseek-v4-flash": "openai-responses"
      }
    }
  }
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions