Summary
PromptX Desktop session requests fail with:
API Error: Connection error.
This occurs when using LiteLLM as an Anthropic-format gateway for AgentX / Claude Agent SDK.
Environment
- OS: Windows
- PromptX Desktop: 2.4.0
- PromptX MCP Server: 2.2.1
- Claude Agent SDK: 0.1.77
- LiteLLM Proxy: 1.83.3-nightly
- Node: 22.20.0
Symptom in Desktop
After sending a message in PromptX Desktop, the UI shows:
Error (success)
API Error: Connection error.
Repro
- Configure PromptX Desktop / AgentX to use LiteLLM via Anthropic-style gateway
- Open a new session
- Send a message such as:
- Observe:
API Error: Connection error.
Gateway behavior observed locally
The gateway responds on:
/v1/messages
/v1/messages?beta=true
However Claude Agent SDK debug logs show streaming/parser failures such as:
Error streaming, falling back to non-streaming mode: Unexpected event order, got message_start before receiving "message_stop"
and earlier also:
Error streaming, falling back to non-streaming mode: Connection error.
Expected
PromptX Desktop sessions should stream and complete normally through a LiteLLM Anthropic gateway.
Actual
Desktop sessions fail with API Error: Connection error. and Claude Agent SDK appears unable to complete the request flow.
Additional notes
Anthropic's Claude Code gateway docs require gateways to correctly support at least:
/v1/messages
/v1/messages/count_tokens
- Anthropic header forwarding
- correct Anthropic SSE/event ordering
This may be a PromptX/AgentX compatibility issue with LiteLLM's Anthropic gateway path rather than a plain local proxy configuration issue.
Summary
PromptX Desktop session requests fail with:
API Error: Connection error.This occurs when using LiteLLM as an Anthropic-format gateway for AgentX / Claude Agent SDK.
Environment
Symptom in Desktop
After sending a message in PromptX Desktop, the UI shows:
Repro
激活女娲,我要创建一个角色API Error: Connection error.Gateway behavior observed locally
The gateway responds on:
/v1/messages/v1/messages?beta=trueHowever Claude Agent SDK debug logs show streaming/parser failures such as:
and earlier also:
Expected
PromptX Desktop sessions should stream and complete normally through a LiteLLM Anthropic gateway.
Actual
Desktop sessions fail with
API Error: Connection error.and Claude Agent SDK appears unable to complete the request flow.Additional notes
Anthropic's Claude Code gateway docs require gateways to correctly support at least:
/v1/messages/v1/messages/count_tokensThis may be a PromptX/AgentX compatibility issue with LiteLLM's Anthropic gateway path rather than a plain local proxy configuration issue.