Skip to content

[Bug]: Custom OpenAI-compatible endpoint misreported as broken — probe hard-coded 30s timeout + unknown-model 8K context fallback #1561

Description

@liuhu8207

Summary

Two related defects discovered while adding a custom OpenAI-compatible endpoint (https://token.sensenova.cn/v1) to OpenSquilla Desktop (0.5.x). Both cause a healthy endpoint to be misreported as broken, even though real chat works fine once configured.


Problem 1: probe has a hard-coded 30s timeout → slow models reported as "unable to connect"

  • probe.py uses _PROBE_TIMEOUT_SECONDS = 30 with a streaming max_tokens=1 request.
  • The endpoint/model is actually healthy: GET /v1/models → 200, chat completion → 200.
  • sensenova-6.8-flash-lite has a first-byte latency (TTFB) of ~34–70s in our measurements, so the probe always times out.
  • The UI "full probe" then reports "无法连接 · 30312 毫秒" (unable to connect · 30312ms), even though a normal chat (120s timeout) works perfectly.
  • Suggested fix: make the probe timeout configurable, align it with the runtime request timeout, or report "slow / uncertain" instead of a hard "unable to connect" on timeout.

Problem 2: unknown models fall back to a default 8K context budget → provider_request_too_large

  • When OpenSquilla does not recognize a model, it assumes a default 8K context window.
  • With a system prompt + tools (~30K tokens), the request is rejected as provider_request_too_large (ref 3ea4684e).
  • Workaround that confirms the root cause — adding an explicit entry in config.toml fixes it:
    [models.custom."sensenova-6.8-flash-lite"]
    context_window = 262144
    max_output_tokens = 65536
  • Suggested fix: for unknown models, derive the context window from /v1/models metadata where available, or prompt the user to configure it, rather than silently using a small default.

Related

Environment

  • OS: Windows 11
  • OpenSquilla Desktop 0.5.x
  • Endpoint: custom OpenAI-compatible (https://token.sensenova.cn/v1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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