Skip to content

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

Description

@rodrigueez

Client or integration

Codex App

Area

Provider adapter

Summary

OpenCodex 2.17.0 can leak an undeclared top-level apply_patch function call through the native OpenAI Responses passthrough path when using OpenCode Go. Codex App then displays aborted, while the target file is 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(...).

This is related to #1544, #1576, and #1623, but the relevant distinction is that this reproduction uses the openai-responses adapter path.

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. Observe that Codex App displays aborted.
  5. Check the file: it remains v1; no content or mtime change is observed.
  6. Run the equivalent patch through exec -> tools.apply_patch(...):
    • an intentionally incorrect expected line returns a real apply_patch verification failed error;
    • the correct v1 -> v3 patch succeeds.

The request-visible tool catalog contained exec, wait, and request_user_input, but no top-level apply_patch schema. The session nevertheless received a function_call named 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 the time of reproduction, the provider default was openai-chat, but this model had an explicit openai-responses adapter override.

Logs or error output

Observed Codex result:

aborted

Session observations:

  • top-level call was recorded as function_call(name=apply_patch);
  • no corresponding custom_tool_call_output was emitted;
  • the file was not modified;
  • OpenCode Go usage records were HTTP 200;
  • no upstream aborted, OpenCodex response.failed, approval denial, or sandbox denial was observed.

Screenshots and supporting files

No screenshots attached. 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"
      }
    }
  }
}

No credentials, tokens, account identifiers, or personal data are included.

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

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions