bug: DigitalOcean Interference fails to use tool-calls (openai-compatible provider) #576

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

Originally created by @8times4 on GitHub (Jul 9, 2025).

Originally assigned to: @thdxr on GitHub.

Hey!

I've attempted to use DigitalOcean's new interference endpoint as a provider, and it all works until a tool call needs to happen, then we error out.

error:

error=AI_TypeValidationError: Type validation failed: Value: {"choices":[{"delta":{"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\""},"index":0,"type":""}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1752067081,"id":"","model":"openai-gpt-4o","object":"chat.completion.chunk"}.
Error message: [{"code":"invalid_union","errors":[[{"code":"invalid_value","values":["function"],"path":["choices",0,"delta","tool_calls",0,"type"],"message":"Invalid input: expected \"function\""}],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input: expected object, received undefined"}]],"path":[],"message":"Invalid input"}]

config.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
      "do-openai": {
        "npm": "@ai-sdk/openai-compatible",
        "options": {
          "baseURL": "https://inference.do-ai.run/v1"
          },
          "models": {
            "openai-o3": {
              "name": "o3"
            },
            "openai-gpt-4o": {
              "name": "gpt-4o"
            }
          }
        }
      }
    }

with do-openai added as api key via auth.

It certainly works with tool-calls as I've ran some local tests using ai-sdk v5, but there's not much else I can offer here.

thanks!

  • 8x4
Originally created by @8times4 on GitHub (Jul 9, 2025). Originally assigned to: @thdxr on GitHub. Hey! I've attempted to use DigitalOcean's [new interference](https://docs.digitalocean.com/products/gradientai-platform/how-to/use-serverless-inference/) endpoint as a provider, and it all works until a tool call needs to happen, then we error out. error: ``` error=AI_TypeValidationError: Type validation failed: Value: {"choices":[{"delta":{"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\""},"index":0,"type":""}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1752067081,"id":"","model":"openai-gpt-4o","object":"chat.completion.chunk"}. Error message: [{"code":"invalid_union","errors":[[{"code":"invalid_value","values":["function"],"path":["choices",0,"delta","tool_calls",0,"type"],"message":"Invalid input: expected \"function\""}],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input: expected object, received undefined"}]],"path":[],"message":"Invalid input"}] ``` config.json: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "do-openai": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://inference.do-ai.run/v1" }, "models": { "openai-o3": { "name": "o3" }, "openai-gpt-4o": { "name": "gpt-4o" } } } } } ``` with `do-openai` added as api key via auth. It certainly works with tool-calls as I've ran some local tests using `ai-sdk v5`, but there's not much else I can offer here. thanks! - 8x4
yindo closed this issue 2026-02-16 17:27:24 -05:00
Author
Owner

@Sayed-47 commented on GitHub (Jul 27, 2025):

Same here, please solve it. Or add Digital Ocean as a provider

@Sayed-47 commented on GitHub (Jul 27, 2025): Same here, please solve it. Or add Digital Ocean as a provider
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#576