[Bug]: Agent TARS v0.3.0 crashes on Windows with `TypeError: Cannot read properties of undefined (reading '0')` when using custom API endpoint

Author: zhang2gongziCreated Jul 13, 2026Updated Aug 16, 2026
LabelsBugUI-TARS

Version

v0.3.0

Model

UI-TARS-1.5-7B

Deployment Method

Cloud

Issue Description

  • Expected behavior: Agent TARS should successfully process user input when configured with a custom OpenAI-compatible API endpoint via --provider openai-compatible --baseURL.
  • Actual behavior: Every user input immediately triggers TypeError: Cannot read properties of undefined (reading '0') during LLM stream processing. The error occurs in both headless mode (--headless --input) and interactive Web UI mode.

Steps to reproduce:

  1. On Windows, run: npx @agent-tars/cli@latest --provider openai-compatible --model gpt-4o --apiKey --baseURL /v1 --input "hello" --headless
  2. Observe the error "Sorry, an error occurred while processing your request: TypeError: Cannot read properties of undefined (reading '0')"

Additional findings:

  • The custom API endpoint works correctly when called directly via OpenAI SDK (same model, same baseURL, streaming enabled). All chunks return proper ChatCompletionChunk format.
  • Using --provider anthropic yields the same error.
  • Using @tarko/agent-cli run agent-tars fails with a different error: Only URLs with a scheme in: file, data, and node are supported... Received protocol 'c:' — a Windows path resolution issue.

Error Logs

AgentRunner [Session] Error in execution | SessionId: "..." | Error: TypeError: Cannot read properties of undefined (reading '0')

Debug log shows the stream starts (LLMProcessor llm stream start) but immediately the finally block runs and the error is caught before any chunk is processed.

Source: bytedance/UI-TARS-desktop