Skip to content

[Bug] API/provider connections: compaction spends time generating a summary, then fails to write it #18306

Closed

Description

@Dhrhciebcy

Environment

Where are you using Unsloth?

  • Unsloth desktop application
  • Unsloth web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version:

Windows 11 Pro 24H2

GPU model(s) and accelerator backend:

NVIDIA CUDA — RTX 5090 Laptop GPU (Mobile)

Versions:

  • Unsloth Studio / Desktop: 0.1.919-beta
  • llama.cpp: bundled build (exact revision is not relevant — this occurs on the remote API path, where llama.cpp is not in the loop at all)

What happened?

The summary from Unsloth Studio is generated—which takes time—but then it fails to write it and never ends up being used

Steps to reproduce:

  1. In Unsloth Studio, create a chat on an API/provider connection (not a local model).
  2. Grow it until compaction is due — either let auto-compaction trigger near the context limit, or press Compact chat manually.
  3. Wait for the compaction to finish. On this path a summary of the older messages is generated first, which takes a noticeable amount of time (long stall before anything happens).

Expected behavior:

Either:

  • the generated summary is actually written and used, so the compacted context contains it

Actual behavior:

The summary appears to be generated successfully — the full wait is paid — and then discarded because writing it fails (the UI shows the banner below and the chat continues without it), after which Studio falls back to plain eviction (dropping the oldest turns from the model's context). Net effect: I pay the latency/cost of summarization and get none of its benefit, landing in a worse state than simple eviction would have.

image

Observations / open questions for the maintainers:

  • Is the generated text lost entirely, or is it still in memory and merely not attached to the compacted context? If it exists, a retry of just the write step would recover it.
  • The wording "The full conversation is still visible and saved" is reassuring for the transcript on disk, but from the model's point of view those turns are simply gone — they are not in context and not retrievable, so a later question about an evicted ID/number silently degrades.

Model and operation involved:

  • Failing: Qwen 3.8 - Flash Next - IQ3_S via provider Strata — chat compaction / rolling context window during inference (both manual "Compact chat" and auto-compaction).
  • Operation: chat history compaction on an API connection. No installation, download, training, GGUF export or diffusion involved.

Additional context

This is the Unsloth Studio's log when the UI banner appears:

{"timestamp": "2026-11-18T10:54:11.254701Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 2.49}
{"timestamp": "2026-11-18T10:54:11.359530Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/liveness", "status_code": 200, "process_time_ms": 0.87}
{"timestamp": "2026-11-18T10:54:12.077901Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd", "status_code": 200, "process_time_ms": 4.61}
{"timestamp": "2026-11-18T10:54:12.098168Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 7.52}
{"timestamp": "2026-11-18T10:54:20.134610Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 8.11}
{"timestamp": "2026-11-18T10:54:20.478976Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/forks", "status_code": 200, "process_time_ms": 7.75}
{"timestamp": "2026-11-18T10:54:21.276138Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 2.71}
{"timestamp": "2026-11-18T10:54:28.156218Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd", "status_code": 200, "process_time_ms": 6.89}
{"timestamp": "2026-11-18T10:54:28.186911Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 12.63}
{"timestamp": "2026-11-18T10:54:30.570858Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/pins", "status_code": 200, "process_time_ms": 6.17}
{"timestamp": "2026-11-18T10:54:31.312027Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 4.08}
{"timestamp": "2026-11-18T10:54:36.235582Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 11.11}
{"timestamp": "2026-11-18T10:54:36.572525Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/forks", "status_code": 200, "process_time_ms": 9.32}
{"timestamp": "2026-11-18T10:54:41.342658Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 4.06}
{"timestamp": "2026-11-18T10:54:44.254406Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd", "status_code": 200, "process_time_ms": 5.98}
{"timestamp": "2026-11-18T10:54:44.283569Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 17.2}
{"timestamp": "2026-11-18T10:54:46.775666Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/forks", "status_code": 200, "process_time_ms": 28.36}
{"timestamp": "2026-11-18T10:54:51.746537Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 3.85}
{"timestamp": "2026-11-18T10:54:52.331640Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 13.23}
{"timestamp": "2026-11-18T10:55:00.351591Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd", "status_code": 200, "process_time_ms": 5.7}
{"timestamp": "2026-11-18T10:55:00.379682Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 10.83}
{"timestamp": "2026-11-18T10:55:00.574571Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/pins", "status_code": 200, "process_time_ms": 8.52}
{"timestamp": "2026-11-18T10:55:00.944795Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/forks", "status_code": 200, "process_time_ms": 9.96}
{"timestamp": "2026-11-18T10:55:01.782753Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 3.84}
{"timestamp": "2026-11-18T10:55:04.258508Z", "level": "info", "event": "custom stream complete (model=qwen3.8-flash-next-iq3_s, chosen=qwen3.8-flash-next-iq3_s, web_search_requested=False, citations=0, events={'delta': 2278})"}
{"timestamp": "2026-11-18T10:55:04.258736Z", "level": "warning", "event": "external_provider.summary_failed", "error": "the summary call timed out", "model": "qwen3.8-flash-next-iq3_s"}
{"timestamp": "2026-11-18T10:55:05.480767Z", "level": "info", "event": "Loaded default model defaults from C:\\Users\\Andryx\\.unsloth\\studio\\unsloth_studio\\Lib\\site-packages\\studio\\backend\\assets\\configs\\model_defaults\\default.yaml"}
{"timestamp": "2026-11-18T10:55:09.518794Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 952.15}
{"timestamp": "2026-11-18T10:55:11.437799Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/liveness", "status_code": 200, "process_time_ms": 3.61}
{"timestamp": "2026-11-18T10:55:11.835918Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 15.68}
{"timestamp": "2026-11-18T10:55:17.551704Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd", "status_code": 200, "process_time_ms": 11.91}
{"timestamp": "2026-11-18T10:55:17.594994Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 15.91}
{"timestamp": "2026-11-18T10:55:17.873271Z", "level": "info", "event": "Proxying chat completion to http://127.0.0.1:8080/v1/chat/completions (provider=custom, model=qwen3.8-flash-next-iq3_s)"}
{"timestamp": "2026-11-18T10:55:17.935967Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/forks", "status_code": 200, "process_time_ms": 10.98}
{"timestamp": "2026-11-18T10:55:23.244113Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 8.24}
{"timestamp": "2026-11-18T10:55:25.634732Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 9.19}
{"timestamp": "2026-11-18T10:55:28.933314Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/forks", "status_code": 200, "process_time_ms": 9.67}
{"timestamp": "2026-11-18T10:55:30.573477Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/pins", "status_code": 200, "process_time_ms": 6.57}
{"timestamp": "2026-11-18T10:55:33.267220Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 2.58}
{"timestamp": "2026-11-18T10:55:33.656862Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd", "status_code": 200, "process_time_ms": 6.8}
{"timestamp": "2026-11-18T10:55:33.687343Z", "level": "info", "event": "request_completed", "method": "PUT", "path": "/api/chat/threads/ac191141-20ad-4191-aca8-71b3c5f275cd/messages/gzSyUxm", "status_code": 200, "process_time_ms": 13.1}

Note a line: {"timestamp": "2026-11-18T10:55:04.258736Z", "level": "warning", "event": "external_provider.summary_failed", "error": "the summary call timed out", "model": "qwen3.8-flash-next-iq3_s"}

Activity

  1. added
    feature request
    on Nov 18, 2026
  2. danielhanchen commented on Nov 19, 2026

    @danielhanchen
    Member

    Fixed! The summary call had a fixed two minute limit for the whole reply, so a slow model that was still writing the summary at two minutes had all of it thrown away and Studio dropped the oldest turns anyway. Now Studio only gives up when the provider goes silent for two minutes, and a summary that keeps streaming is read to the end and used. Fixed in #18334.
    To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

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

Metadata

Metadata

Assignees

Labels

bugfeature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions