Repository navigation
Studio: renew the chat-run lease while long prefill is still advancing - #12619
Conversation
#12562 (make carried rows a faintly frosted, darker copy) landed after this branch was cut and restyles the shared ghost rule that #12499 introduced: it relies on --row-ghost-surface and .model-picker-row-ghost, and edits model-picker-pinned-drag-preview.test.ts, all of which the #12499 revert removes. Keeping it without #12499 leaves .sidebar-row-ghost reading an unset variable, so the conflict is resolved by dropping #12562's two hunks as well. It should be re-opened together with #12499. #12563, #12564 and #12597 are kept.
#12523) * Studio: renew the chat-run lease while long prefill is still advancing Dropped prompt_progress was replaced with : keep-alive, which the durable lease deliberately ignores, so a healthy multi-minute prefill was reaped as "Generation stopped making progress" (unslothai#12518). Stand in with : prefill-progress and renew on it, same pattern as : tool-heartbeat. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Studio: renew the lease from native GGUF prefill too The Studio UI never sends client tools, so its GGUF chat and tool loop run the native generators rather than the passthrough. Those consume prompt_progress themselves and stay silent until the first token, so the stall loop only ever sent ": keep-alive" and a long prefill was still reaped after the lease ran out. Wrap the GGUF perf callback in a small signal that counts moving prompt_progress, and have both native stall loops send ": prefill-progress" when it moved since the last tick. A generator that reports nothing still gets ": keep-alive" and is still reaped. The wrapper opts out of per-token timings unless a monitor is attached, and non-streaming requests keep the plain monitor callback. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Etherl <[email protected]> (cherry picked from commit d8740d3)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
#12523) * Studio: renew the chat-run lease while long prefill is still advancing Dropped prompt_progress was replaced with : keep-alive, which the durable lease deliberately ignores, so a healthy multi-minute prefill was reaped as "Generation stopped making progress" (unslothai#12518). Stand in with : prefill-progress and renew on it, same pattern as : tool-heartbeat. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Studio: renew the lease from native GGUF prefill too The Studio UI never sends client tools, so its GGUF chat and tool loop run the native generators rather than the passthrough. Those consume prompt_progress themselves and stay silent until the first token, so the stall loop only ever sent ": keep-alive" and a long prefill was still reaped after the lease ran out. Wrap the GGUF perf callback in a small signal that counts moving prompt_progress, and have both native stall loops send ": prefill-progress" when it moved since the last tick. A generator that reports nothing still gets ": keep-alive" and is still reaped. The wrapper opts out of per-token timings unless a monitor is attached, and non-streaming requests keep the plain monitor callback. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Etherl <[email protected]> (cherry picked from commit d8740d3)
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05ebc646d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| yield ( | ||
| _OPENAI_PREFILL_PROGRESS_SSE | ||
| if _gguf_prefill_signal.advanced() | ||
| else _OPENAI_PASSTHROUGH_SSE_KEEPALIVE |
There was a problem hiding this comment.
Poll prefill before the shortest lease expires
When UNSLOTH_STUDIO_CHAT_RUN_LEASE_TIMEOUT_S is configured at or below 15 seconds, the lease is clamped to exactly 15 seconds, but this native GGUF loop can emit its first : prefill-progress marker only after the fixed 15-second stall timeout. Because reconciliation expires timestamps using <=, a sweep—especially with a short sweep interval or one aligned with this timer—can settle a healthy prefill before this marker is handled. Poll the progress signal on a cadence strictly shorter than the applied lease, or include this 15-second producer cadence plus margin in the lease clamp.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The lease only drops to 15 s if UNSLOTH_STUDIO_CHAT_RUN_LEASE_TIMEOUT_S is set that low; the default is 1200 s with a 60 s sweep, so the 15 s prefill-progress poll renews well inside it and a live prefill is not reaped.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05ebc646d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not client_wants_progress and _is_prefill_progress_only(chunk_data): | ||
| _monitor_openai_sse_line(monitor_id, raw_line, llama_backend.context_length) | ||
| if progress_keepalive.due(): | ||
| yield _OPENAI_PASSTHROUGH_SSE_KEEPALIVE | ||
| yield _OPENAI_PREFILL_PROGRESS_SSE |
There was a problem hiding this comment.
Verify passthrough progress advances before renewing the lease
When llama-server repeatedly emits the same prompt_progress.processed value, _aiter_llama_stream_items correctly treats it as non-advancing for the first-token deadline, but this branch still emits : prefill-progress whenever the wall-clock interval is due. The durable supervisor consequently renews the run lease for static progress, so a stalled passthrough generation can evade a shorter configured lease until the separate first-token timeout expires. Track the processed value here (and in the equivalent completions relay) and emit this marker only when it increases.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The first-token deadline only extends when processed increases, so repeated progress values cannot keep a stalled run alive past the 1200 s first-token timeout, and a hung llama-server emits no progress events at all.
| if not client_wants_progress and _is_prefill_progress_only(chunk_data): | ||
| _monitor_openai_sse_line(monitor_id, raw_line, llama_backend.context_length) | ||
| if progress_keepalive.due(): | ||
| yield _OPENAI_PASSTHROUGH_SSE_KEEPALIVE | ||
| yield _OPENAI_PREFILL_PROGRESS_SSE |
There was a problem hiding this comment.
Keep durable progress renewal when relay keepalives are disabled
When UNSLOTH_OPENAI_COMPAT_STREAM_KEEPALIVE_INTERVAL=0, _keepalive_s is None, so _ProgressKeepalive.due() is always false and every dropped prompt_progress event takes this continue without emitting : prefill-progress. _aiter_llama_stream_items still extends the first-token deadline for advancing progress, but the durable supervisor receives no renewal and can reap an otherwise healthy long prefill after its lease timeout. Durable lease signaling needs a cadence independent of the optional client/proxy keepalive setting.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This needs UNSLOTH_OPENAI_COMPAT_STREAM_KEEPALIVE_INTERVAL=0, an undocumented non-default setting that deliberately relays in silence; there behaviour matches main, and with the default interval the prefill-progress renewal is active.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
The red |
unslothai#12619) Re-land of unslothai#12523 (reverted in unslothai#12569). Co-authored-by: Indrajit swain <[email protected]> Co-authored-by: Etherl <[email protected]>
Re-opens #12523 for review. It was merged before its review converged and was reverted in #12569.
The change is the original squash commit, cherry-picked unchanged (
git cherry-pick -x d8740d387), with authorship kept for @indrajeetapache. The full description and discussion are on #12523.#12569 has merged, so this PR targets
mainand its diff shows only this change.