[GH-ISSUE #962] Strata ignores cancellation from Claude Code #420

Closed
opened 2026-11-04 01:42:53 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @awcator on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/962

Send a large prompt through Claude Code, watch it being processed (reading promopt), then cancel the request and start writing a new one. Strata doesn't notice the cancellation. It keeps processing the old prompt anyway.

Originally created by @awcator on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/962 Send a large prompt through Claude Code, watch it being processed (reading promopt), then cancel the request and start writing a new one. Strata doesn't notice the cancellation. It keeps processing the old prompt anyway.
Author
Owner

@awcator commented on GitHub (Oct 5, 2026):

I see it stops after reading promopt, but is it possible to stop in middle as sson as promopt is nolonger intrested by the user ?

<!-- gh-comment-id:5999285560 --> @awcator commented on GitHub (Oct 5, 2026): I see it stops after reading promopt, but is it possible to stop in middle as sson as promopt is nolonger intrested by the user ?
Author
Owner

@talisp commented on GitHub (Oct 5, 2026):

A quick way to tell whether this is Strata or the client: try the same thing in Strata's own web chat, which has a Stop button.

  • How to open it: the server prints its address when it is ready (ready: http://127.0.0.1:<port>/v1 …); open http://127.0.0.1:<port>/ in a browser (8080 by default; the port is in your start script / strata-<model>.json). If Strata runs on another machine, use an SSH tunnel (ssh -L 8081:127.0.0.1:<port> <host>, then http://localhost:8081/).
  • API key: if you set one, the page says "This server needs an API key: add it under About > Settings". Paste the same key there (the api_key in strata-<model>.json); it is kept only in your browser.

Then paste a long prompt, press Stop while the window still shows reading the prompt, and watch the server log:

  • The web chat's Stop also waits until the prompt is read: it is Strata's behaviour (and your follow-up suggests that: it stops only after the prompt).
  • The web chat stops right away but Claude Code does not: the client probably keeps the HTTP connection open after you cancel, so the server never sees a disconnect.
<!-- gh-comment-id:6001763236 --> @talisp commented on GitHub (Oct 5, 2026): A quick way to tell whether this is Strata or the client: try the same thing in **Strata's own web chat**, which has a Stop button. - **How to open it:** the server prints its address when it is ready (`ready: http://127.0.0.1:<port>/v1 …`); open `http://127.0.0.1:<port>/` in a browser (8080 by default; the port is in your start script / `strata-<model>.json`). If Strata runs on another machine, use an SSH tunnel (`ssh -L 8081:127.0.0.1:<port> <host>`, then `http://localhost:8081/`). - **API key:** if you set one, the page says *"This server needs an API key: add it under About > Settings"*. Paste the same key there (the `api_key` in `strata-<model>.json`); it is kept only in your browser. Then paste a long prompt, press Stop while the window still shows `reading the prompt`, and watch the server log: - **The web chat's Stop also waits until the prompt is read:** it is Strata's behaviour (and your follow-up suggests that: it stops only after the prompt). - **The web chat stops right away but Claude Code does not:** the client probably keeps the HTTP connection open after you cancel, so the server never sees a disconnect.
Author
Owner

@christopherrobertbrooks-tech commented on GitHub (Oct 6, 2026):

A data point that may help narrow this down: when the client actually closes the connection, Strata stopped reading the
prompt within about 4 seconds here, both directly and behind llama-swap.

Setup: Coder IQ1_M, engine 0.1.39, Tesla V100 32 GB, /v1/messages. Test: send a ~48K-token prompt (streaming),
close the socket 8 s into prompt reading, then watch the GPU's utilisation and time a tiny follow-up request.

Case GPU busy after the hang-up Tiny request right after
Direct to Strata's port 3.8 s 0.6 s
Through llama-swap 4.1 s 0.7 s
Same prompt read in full (no hang-up), for scale 32 s total --

So the engine abandons the read at about the next prompt chunk (8,192 tokens at ~1,500 tok/s here) rather than finishing
the remaining ~24 s. That suggests checking whether the client really closes its connection when you cancel. Our own
Claude Agent SDK-based client ends the request by stopping its claude process, which closes the socket; whether the
interactive Claude Code's cancel does the same while a request is still in prompt reading, we have not checked. One
machine and one run each.

Drafted with an AI assistant (Claude) from our measurements, and checked by me.

<!-- gh-comment-id:6009649097 --> @christopherrobertbrooks-tech commented on GitHub (Oct 6, 2026): A data point that may help narrow this down: when the client actually closes the connection, Strata stopped reading the prompt within about 4 seconds here, both directly and behind llama-swap. **Setup:** Coder IQ1_M, engine 0.1.39, Tesla V100 32 GB, `/v1/messages`. Test: send a ~48K-token prompt (streaming), close the socket 8 s into prompt reading, then watch the GPU's utilisation and time a tiny follow-up request. | Case | GPU busy after the hang-up | Tiny request right after | | --- | --- | --- | | Direct to Strata's port | 3.8 s | 0.6 s | | Through llama-swap | 4.1 s | 0.7 s | | Same prompt read in full (no hang-up), for scale | 32 s total | -- | So the engine abandons the read at about the next prompt chunk (8,192 tokens at ~1,500 tok/s here) rather than finishing the remaining ~24 s. That suggests checking whether the client really closes its connection when you cancel. Our own Claude Agent SDK-based client ends the request by stopping its `claude` process, which closes the socket; whether the interactive Claude Code's cancel does the same while a request is still in prompt reading, we have not checked. One machine and one run each. Drafted with an AI assistant (Claude) from our measurements, and checked by me.
Author
Owner

@Niko1221 commented on GitHub (Oct 6, 2026):

Thanks. We will check what the server does with a client that disconnects while its prompt is still being read, and whether the engine can stop between prompt chunks. Tracked for 0.1.41; no change in 0.1.40.

<!-- gh-comment-id:6010949342 --> @Niko1221 commented on GitHub (Oct 6, 2026): Thanks. We will check what the server does with a client that disconnects while its prompt is still being read, and whether the engine can stop between prompt chunks. Tracked for 0.1.41; no change in 0.1.40.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6155998806 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#420
No description provided.