Skip to content

Bug: BYOK session fails with empty response, code-server SIGABRT on new session #85

@hdot123

Description

@hdot123

Bug Report

Issue 1: BYOK session returns empty response

Environment:

  • macOS 15.4 (darwin 25.4.0)
  • Factory CLI v0.118.0
  • BYOK model: GLM-5.2 via custom proxy (AxonHub -> Zhipu API)
  • Session ID: c2b9f907-7ae8-40a4-8047-0f876e8d2774

Description:
When using a BYOK custom model through a proxy server, the session repeatedly fails with:

BYOK Error: 500 failed to stream request: empty response detected
Upstream error: failed to stream request: empty response detected

Root cause analysis:
The proxy server (AxonHub) had two issues:

  1. DNS resolution routed requests to a distant node (Singapore, 338ms latency) instead of a local node (Shenzhen, 28ms)
  2. The requested model GLM-5.2 was not registered in the proxy model list - only glm-5.1 was available

After fixing DNS and adding the correct model, the issue was resolved.

Improvement suggestion:
When a BYOK request fails with empty response, it would be helpful if Factory could surface more details about the upstream error (e.g., model not found, DNS timeout, etc.) instead of just empty response detected.


Issue 2: code-server SIGABRT prevents new session creation

Description:
After the BYOK session above failed repeatedly, attempting to create a new session in Factory CLI resulted in:

Failed to initialize session
RPC Error: Droid process exited unexpectedly (exit code 0)

Logs:

ERROR: [Daemon] Failed to start code-server
MetaError: code-server exited unexpectedly
    at #handleOnExit (node:child_process:520:14)
    signal: SIGABRT
    command: /opt/homebrew/bin/code-server

The code-server process crashes immediately (duration: 37-47ms) with SIGABRT and empty stdout/stderr.

Reproduction:

  1. Use BYOK with a custom model that returns errors
  2. Let the session fail multiple times
  3. Try to create a new session - fails with SIGABRT

Workaround:

killall -9 factory code-server
factory daemon start

Expected behavior:
A failed BYOK session should not prevent new session creation. The code-server crash appears unrelated to the BYOK error but is triggered in sequence.

Environment:

  • macOS 15.4 (darwin 25.4.0)
  • Factory CLI v0.118.0
  • code-server at /opt/homebrew/bin/code-server
  • Tier: team_annual

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions