Skip to content

[Bug]: LiteLLM non-task helpers call undefined/chat/completions #963

Description

@tomny-dev

Preflight

  • I searched existing issues and docs before opening this.
  • I removed secrets, tokens, private keys, customer data, and private repository details from logs and screenshots.
  • This report describes observed behavior, not a speculative AI-generated rewrite request.

Summary

When a self-hosted Roomote deployment uses a LiteLLM-backed model for non-task helper inference, GitHub mention routing fails because the restricted OpenCode runtime selects the model ID but does not appear to register the endpoint-backed provider configuration.

The request reaches the GitHub webhook successfully, but the control-plane inference call attempts to use an invalid URL:

undefined/chat/completions

Normal task conversations are unaffected because the worker runtime appears to generate the complete endpoint-provider configuration.

Affected surface

API

Steps to reproduce

  1. Deploy Roomote using the official Docker Compose/Coolify setup.

  2. Configure a LiteLLM provider with a valid base URL and API key.

  3. Select a LiteLLM model for both the coding model and small/helper model, for example:

    litellm/qwen3.6:35b-unsloth
    
  4. Install the Roomote GitHub App on a repository.

  5. Comment on a pull request:

    @<roomote-app-slug> review this PR
    
  6. Observe the API logs.

Expected behavior

Roomote should use the configured LiteLLM endpoint for the non-task helper call, route the GitHub request, and enqueue the review task.

Actual behavior

The webhook reaches Roomote, but structured helper inference fails before routing or task enqueueing:

OpenCode structured prompt failed: UnknownError: "undefined/chat/completions" cannot be parsed as a URL.

Supplying only options.baseURL changes the failure to a generic server error, suggesting that the provider adapter and model catalog are also required.

As a deployment workaround, setting OPENCODE_CONFIG_CONTENT with a complete OpenAI-compatible provider entry makes the same GitHub mention route successfully. The working shape includes:

  • npm: "@ai-sdk/openai-compatible"
  • the LiteLLM provider name
  • options.baseURL
  • an API-key environment reference
  • a model catalog entry for the selected helper model

After applying that workaround, the logs show a successful direct routing decision and environment resolution:

[LLM Router] Routed GitHub task ... followUpMode="review" ...
[enqueueTask] Auto-resolved environment ...

Roomote version

ghcr.io/roocodeinc/roomote-app:develop

Installation method

Docker Compose

Deployment context

Host OS / architecture: Linux, amd64
Deployment: Docker Compose managed by Coolify
Postgres: Official Roomote Compose service
Redis: Official Roomote Compose service
Object storage: Official Roomote Compose service
Public URL / reverse proxy: Cloudflare Tunnel in front of Coolify/Traefik
Compute provider: Docker
Model gateway: Self-hosted LiteLLM exposing an OpenAI-compatible /v1 endpoint

Diagnostics output

No response

Logs, screenshots, task IDs, or job IDs

OpenCode structured prompt failed: UnknownError: "undefined/chat/completions" cannot be parsed as a URL.

Additional context

The issue appears limited to restricted non-task OpenCode helpers such as GitHub routing and other control-plane inference. The task worker path already appears to construct endpoint-backed provider metadata correctly.

Temporary workaround

Setting OPENCODE_CONFIG_CONTENT on the API service with a complete OpenAI-compatible provider entry makes the same GitHub mention route successfully.

A sanitized version of the working override is:

services:
  api:
    environment:
      LITELLM_API_KEY: ${LITELLM_API_KEY}
      LITELLM_BASE_URL: http://<litellm-host>:4000/v1
      OPENCODE_CONFIG_CONTENT: >-
        {"model":"litellm/qwen3.6:35b-unsloth","small_model":"litellm/qwen3.6:35b-unsloth","provider":{"litellm":{"npm":"@ai-sdk/openai-compatible","name":"LiteLLM","options":{"baseURL":"http://<litellm-host>:4000/v1","apiKey":"{env:LITELLM_API_KEY}"},"models":{"qwen3.6:35b-unsloth":{"name":"qwen3.6:35b-unsloth"}}}}}

The deployment still provides LITELLM_API_KEY separately; the secret is not embedded in the JSON.

Adding only options.baseURL was not sufficient. The provider adapter and model catalog were also required.

After applying the full override, the logs show a successful direct routing decision and environment resolution:

[LLM Router] Routed GitHub task ... followUpMode="review" ...
[enqueueTask] Auto-resolved environment ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions