opencode-openai-codex-auth plugin breaks tool calling for standard OpenAI API models #3069

Closed
opened 2026-02-16 17:38:27 -05:00 by yindo · 3 comments
Owner

Originally created by @Mumbolian on GitHub (Nov 23, 2025).

Bug Description

The `opencode-openai-codex-auth` plugin causes tool calling to fail with error "No tool call found for function call output with call_id..." when using standard OpenAI API models (like `gpt-5-mini`, `gpt-4o`). The WebFetch tool and other tools that require function calling fail consistently, while the model can respond to regular text prompts normally.

When the plugin is disabled, all tools including WebFetch work perfectly with standard OpenAI API models using an API key.

Steps to Reproduce

  1. Install and configure the `opencode-openai-codex-auth` plugin in `~/.config/opencode/opencode.json`:
    ```json
    {
    "$schema": "https://opencode.ai/config.json",
    "plugin": [
    "opencode-openai-codex-auth"
    ],
    "provider": {
    "openai": {
    "options": {
    "apiKey": "{env:OPENAI_API_KEY}"
    },
    "models": {
    "gpt-5.1-codex-medium": {
    "name": "GPT 5.1 Codex Medium (OAuth)",
    "limit": { "context": 272000, "output": 128000 },
    "options": {
    "reasoningEffort": "medium",
    "reasoningSummary": "auto",
    "textVerbosity": "medium",
    "include": ["reasoning.encrypted_content"],
    "store": false
    }
    }
    }
    }
    }
    }
    ```

  2. Authenticate both with OAuth (`opencode auth login` → OpenAI OAuth) and set `OPENAI_API_KEY` environment variable

  3. Start OpenCode and select a standard API model: `openai/gpt-5-mini`

  4. Attempt to use WebFetch or any other tool that requires function calling:

    • Example: "search the web for today's date"
    • OpenCode will attempt to call WebFetch

Expected Behavior

  • WebFetch should successfully fetch the URL and return results
  • Other tools requiring function calling should work normally
  • Both OAuth models (gpt-5.1-codex-*) and standard API models (gpt-5-mini, gpt-4o) should work simultaneously

Actual Behavior

```
% WebFetch https://worldtimeapi.org/api/ip
No tool call found for function call output with call_id call_9fOpAzbpODFsB2zOVqJES8NF.
```

  • Tool calls fail with "No tool call found" error
  • The model responds to regular text prompts normally (confirming API access works)
  • The error suggests OpenCode is waiting for a tool call result that never arrives
  • OAuth models work fine with tool calling
  • When plugin is disabled, standard API models work perfectly with all tools

Environment

  • opencode version: 1.0.105
  • Plugin version: opencode-openai-codex-auth (configured via plugin array, version unknown)
  • Operating System: macOS 26.1 (Build 25B78)
  • Node.js version: v25.2.1
  • Shell: zsh (Ghostty terminal)

Logs

The error appears immediately after tool invocation:
```
INFO service=provider providerID=openai found
INFO service=provider modelID=gpt-5-mini found
INFO service=session.prompt type=start part
% WebFetch https://worldtimeapi.org/api/ip
No tool call found for function call output with call_id call_9fOpAzbpODFsB2zOVqJES8NF.
```

(Note: Plugin-specific logs not available as `ENABLE_PLUGIN_REQUEST_LOGGING=1` was not enabled during reproduction)

Compliance Checklist

Please confirm:

  • I'm using this plugin for personal development only
  • I have an active ChatGPT Plus/Pro subscription
  • This issue is not related to attempting commercial use or TOS violations
  • I've reviewed the FAQ and Troubleshooting sections

Additional Context

Root Cause Analysis

This appears related to Issue #4255 which describes how OpenAI-compatible APIs return empty `tool_calls: []` arrays even when no tools are called. The plugin likely:

  1. Applies OAuth-specific configuration globally to all OpenAI models (not just OAuth models)
  2. Causes OpenAI API responses to include empty `tool_calls` arrays
  3. OpenCode sees the `tool_calls` field and waits for tool execution
  4. Never proceeds to process the actual content
  5. Results in "No tool call found" error

Workaround

Temporary fix: Disable the plugin and use standard OpenAI API with API key only:

```json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}"
}
}
}
}
```

This allows all tools including WebFetch to work perfectly with standard API models, but removes access to OAuth models.

Attempted Solutions

  • Cleared OpenCode cache (`rm -rf ~/.cache/opencode`)
  • Re-authenticated with both OAuth and API key
  • Tried adding `"strictTools": false` to model options (no effect)
  • Removed global provider `options` block to prevent OAuth params applying to all models (no effect)
  • Disabling plugin completelyFIXED THE ISSUE

Expected Plugin Behavior

The plugin should:

  • Only apply OAuth-specific options to OAuth models (models with OAuth-specific config)
  • Not interfere with standard OpenAI API models that use API keys
  • Allow both OAuth and standard API models to coexist and use tools correctly
Originally created by @Mumbolian on GitHub (Nov 23, 2025). ## **Bug Description** The \`opencode-openai-codex-auth\` plugin causes tool calling to fail with error "No tool call found for function call output with call_id..." when using standard OpenAI API models (like \`gpt-5-mini\`, \`gpt-4o\`). The WebFetch tool and other tools that require function calling fail consistently, while the model can respond to regular text prompts normally. When the plugin is disabled, all tools including WebFetch work perfectly with standard OpenAI API models using an API key. ## **Steps to Reproduce** 1. Install and configure the \`opencode-openai-codex-auth\` plugin in \`~/.config/opencode/opencode.json\`: \`\`\`json { "$schema": "https://opencode.ai/config.json", "plugin": [ "opencode-openai-codex-auth" ], "provider": { "openai": { "options": { "apiKey": "{env:OPENAI_API_KEY}" }, "models": { "gpt-5.1-codex-medium": { "name": "GPT 5.1 Codex Medium (OAuth)", "limit": { "context": 272000, "output": 128000 }, "options": { "reasoningEffort": "medium", "reasoningSummary": "auto", "textVerbosity": "medium", "include": ["reasoning.encrypted_content"], "store": false } } } } } } \`\`\` 2. Authenticate both with OAuth (\`opencode auth login\` → OpenAI OAuth) and set \`OPENAI_API_KEY\` environment variable 3. Start OpenCode and select a standard API model: \`openai/gpt-5-mini\` 4. Attempt to use WebFetch or any other tool that requires function calling: - Example: "search the web for today's date" - OpenCode will attempt to call WebFetch ## **Expected Behavior** - WebFetch should successfully fetch the URL and return results - Other tools requiring function calling should work normally - Both OAuth models (gpt-5.1-codex-*) and standard API models (gpt-5-mini, gpt-4o) should work simultaneously ## **Actual Behavior** \`\`\` % WebFetch https://worldtimeapi.org/api/ip No tool call found for function call output with call_id call_9fOpAzbpODFsB2zOVqJES8NF. \`\`\` - Tool calls fail with "No tool call found" error - The model responds to regular text prompts normally (confirming API access works) - The error suggests OpenCode is waiting for a tool call result that never arrives - OAuth models work fine with tool calling - **When plugin is disabled**, standard API models work perfectly with all tools ## **Environment** - **opencode version**: 1.0.105 - **Plugin version**: opencode-openai-codex-auth (configured via plugin array, version unknown) - **Operating System**: macOS 26.1 (Build 25B78) - **Node.js version**: v25.2.1 - **Shell**: zsh (Ghostty terminal) ## **Logs** The error appears immediately after tool invocation: \`\`\` INFO service=provider providerID=openai found ✅ INFO service=provider modelID=gpt-5-mini found ✅ INFO service=session.prompt type=start part ✅ % WebFetch https://worldtimeapi.org/api/ip No tool call found for function call output with call_id call_9fOpAzbpODFsB2zOVqJES8NF. \`\`\` _(Note: Plugin-specific logs not available as \`ENABLE_PLUGIN_REQUEST_LOGGING=1\` was not enabled during reproduction)_ ## **Compliance Checklist** Please confirm: - [x] I'm using this plugin for personal development only - [x] I have an active ChatGPT Plus/Pro subscription - [x] This issue is not related to attempting commercial use or TOS violations - [x] I've reviewed the FAQ and Troubleshooting sections ## **Additional Context** ### Root Cause Analysis This appears related to [Issue #4255](https://github.com/sst/opencode/issues/4255) which describes how OpenAI-compatible APIs return empty \`tool_calls: []\` arrays even when no tools are called. The plugin likely: 1. Applies OAuth-specific configuration globally to all OpenAI models (not just OAuth models) 2. Causes OpenAI API responses to include empty \`tool_calls\` arrays 3. OpenCode sees the \`tool_calls\` field and waits for tool execution 4. Never proceeds to process the actual content 5. Results in "No tool call found" error ### Workaround **Temporary fix**: Disable the plugin and use standard OpenAI API with API key only: \`\`\`json { "$schema": "https://opencode.ai/config.json", "provider": { "openai": { "options": { "apiKey": "{env:OPENAI_API_KEY}" } } } } \`\`\` This allows all tools including WebFetch to work perfectly with standard API models, but removes access to OAuth models. ### Attempted Solutions - ✅ Cleared OpenCode cache (\`rm -rf ~/.cache/opencode\`) - ✅ Re-authenticated with both OAuth and API key - ✅ Tried adding \`"strictTools": false\` to model options (no effect) - ✅ Removed global provider \`options\` block to prevent OAuth params applying to all models (no effect) - ✅ **Disabling plugin completely** → **FIXED THE ISSUE** ### Expected Plugin Behavior The plugin should: - Only apply OAuth-specific options to OAuth models (models with OAuth-specific config) - Not interfere with standard OpenAI API models that use API keys - Allow both OAuth and standard API models to coexist and use tools correctly
yindo added the opentui label 2026-02-16 17:38:27 -05:00
yindo closed this issue 2026-02-16 17:38:27 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 23, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4255: Empty tool_calls array handling causes OpenCode to hang indefinitely - the root cause analysis in this issue directly describes the same problem where OpenAI-compatible APIs return empty tool_calls: [] arrays that interfere with proper tool execution. The fix needed to handle empty tool_calls arrays would likely resolve both issues.

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Nov 23, 2025): This issue might be a duplicate of existing issues. Please check: - #4255: Empty tool_calls array handling causes OpenCode to hang indefinitely - the root cause analysis in this issue directly describes the same problem where OpenAI-compatible APIs return empty `tool_calls: []` arrays that interfere with proper tool execution. The fix needed to handle empty tool_calls arrays would likely resolve both issues. Feel free to ignore if this doesn't address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

@Mumbolian isnt tbis the wrong repo? We dont maintain that plugin

@rekram1-node commented on GitHub (Nov 23, 2025): @Mumbolian isnt tbis the wrong repo? We dont maintain that plugin
Author
Owner

@Mumbolian commented on GitHub (Nov 23, 2025):

@Mumbolian isnt tbis the wrong repo? We dont maintain that plugin

Sorry I thought I'd pushed to the other one!

@Mumbolian commented on GitHub (Nov 23, 2025): > @Mumbolian isnt tbis the wrong repo? We dont maintain that plugin Sorry I thought I'd pushed to the other one!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3069