Repository navigation
Studio: show status between tool rounds and while context compaction runs - #16608
Conversation
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d983b1563
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47e8858d72
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
|
Pushed two small follow-ups on top of e7e0bdc (no behavior change to the feature):
Both open review threads were already addressed by 51e8ac6 and e7e0bdc, so I resolved them. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4917fa75d7
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
|
Wrap-up for
|
After a tool call in a GGUF chat, the reply shows nothing until the model's next pass starts writing. In that gap Studio fits the context window, compacts it if needed, and processes the prompt again, which took 26 to 40 s per tool call in the CPU test below. A user on r/unsloth could not tell whether the model had frozen, the tool had failed, or compaction was running. Their slowdown went away after updating Studio, but the missing status still reproduces on current main, as measured below.
Two things cause the gap:
GeneratingIndicatorinthread.tsxonly renders while the reply is empty, so after the first tool call neither "Working..." nor "Processing prompt N%" comes back. The server keeps sending prefill progress during this time, but nothing displays it.context_truncated, is sent after the fit finishes.Changes
NextRoundIndicatorrenders the existingGeneratingStatusunder a finished tool call while the reply is still running, until the next pass streams something. A tool result clears the previous pass's live figures on the client and server, so a stale "Processing prompt 100%" cannot carry over.on_evicthook at the point where they decide to drop turns, including a manual/compact. That reaches_PrefillProgressSignal.compacting(), and the stall loop sends{"type": "generation_progress", "phase": "compacting"}while the fit is still blocked. Replaying a cut from an earlier request never reaches the hook. This matters because once a chat has compacted, its full history is over budget on every later request, so a token-count check would show the label on every turn.context_truncated, or the next prefill or decode sample, clears it. Both the live stream and the reconnect path (runtime-provider.tsx) handle it.Notes
generation_progress, which is only sent on Studio UI streams. A plain streaming/v1/chat/completionsrequest that compacts still gets only chat chunks,context_truncatedand[DONE]. Older frontends ignore the unknown phase.Orchestrator.compact_chat_contextand still report only afterwards, but the between-calls status applies to them too.llama_cpp.pycall sites. Whichever merges second needs to carry theon_compactingargument across.Screenshots
Main (
3d4aa8685f) vs this PR, on a fresh Studio home, third turn of the test below.While compaction runs:
While the prompt is processed again after compaction:
Testing
Live A/B in the browser: Qwen3-8B Q4_K_M on a CPU-only llama-server, 8192 context, auto-compact on. Three turns, each asking for one
pythoncall that prints 1200 items; the third turn compacts. Seconds from the tool result to the first token with no status line shown (measured at47dab66e99):The 0.3 s left on this PR is between the first token arriving and the run finishing. On the compacting turn the line goes "Working...", "Compacting context..." (about 1 s after the tool result, until
context_truncated), "Working...", then "Processing prompt 60% · 16s left". A fourth turn that only replays the earlier cut shows no compaction label.test_live_generation_progress.py. They cover the hook in both fit policies, replay staying silent, a new checkpoint past an earlier cut, a forced reset, frame ordering in the stall loop, and dropping a previous pass's unsent figures. The related fit, compaction, tool-loop and refactor-guard suites pass (721 tests).generation-details.test.ts. The typecheck andi18n:check:strictpass. In the full node suite, 14738 pass and 15 fail; the same 15 fail on3d4aa8685f.