Skip to content

fix(models): model job and GGUF runtime UI fixes (bug-crawl batch F4) - #752

Merged
dovvnloading merged 35 commits into
mainfrom
batch/f4-models-runtime
Nov 28, 2026
Merged

dovvnloading merged 35 commits into
mainfrom
batch/f4-models-runtime

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Batch F4 of the bug-crawl plan: 6 issues in 6 commits. Each fix commit adds a regression test that was run against the old code and fails there.

Fixes

  • High: A transient HTTP 503 while following a model job discards the accepted job ID and Cancel control #712 fix(models): keep following a model job through a temporary 503: A model job's stream or status check that answered 503 was treated as a final refusal: the hook stopped tracking the job and its Cancel control went away, while the download or pull kept running on the backend. A 502, 503 or 504 says nothing about the job, so it is now followed again, like a lost connection; any other refusal still ends it.
  • Medium: A late cancellation failure can restore the previous model job's progress over a different job #718 fix(models): restore cancelled progress only for the job it belonged to: When a cancel request was refused, the hook put back the progress it had captured before asking. It checked only that the current row was cancelling, not that it was still the same job: a refusal arriving after that job had ended and another had been started and cancelled put the old job's progress over the new one. It now restores only while the same job is still tracked.
  • High: A 401 during ambiguous model-admission replay erases the only recoverable request identity #713 fix(models): keep a model admission's request id after a 401: A lost acceptance for an Ollama pull or GGUF download is replayed with the same request id. Any 4xx on that replay cleared the id, but a 401 is answered before the handler runs and says nothing about the earlier request: the backend could already be downloading, with nothing left to find the job by. A 401 now keeps the id, so the next signed-in workspace recovers the running job.
  • High: A failed GGUF runtime disables every GGUF model, including models the backend can successfully load #716 fix(models): let a send retry a GGUF runtime that failed to start: After one failed GGUF start, the chat page refused every send to every GGUF model, though the backend starts the runtime again on the next request (for corrected settings or another model) and applies its own crash-loop limits. The failure is still reported with its message, but no longer blocks the request that would recover. The unclean-stop state that needs a restart still blocks.
  • Medium: GGUF runtime status polling stops when the chat model is non-GGUF, leaving System controls stale #717 fix(models): keep watching a GGUF runtime that is still loaded: The GGUF runtime's status was polled only while a GGUF chat model was selected. Choosing an Ollama or cloud model does not unload a GGUF model, but polling stopped, so System settings went on saying it was loaded (and offering Unload) after the runtime had unloaded it on its idle timeout. The status is now watched while a GGUF model is selected or the runtime is anything but idle.
  • Medium: Chat model selection advertises embedding-only Ollama models as ready for chat #719 fix(models): never offer an embedding-only model for chat: The chat model picker, Settings' chat and translation choices, and the selected-model check used every installed model, so an Ollama model that reports only embedding was listed and marked ready, and every message to it failed. They now use the models that can chat (the filter Agent mode already used): a model without completion is left out, and one with no capability report stays.

Tests

Run locally on Windows, one test file at a time: the test files each commit touches, plus the neighbouring suites for the same area, all passing. CI runs the full Quality gate on this PR, and the serial Python-compatibility suite (3.12-3.14) was run on this branch with workflow_dispatch before merge, since PR CI does not run it.

Risk and rollback

Each fix is its own commit; reverting the PR or one commit restores the previous behaviour. Commit messages give the root cause and the behaviour change of each fix.

The changelog entries are added as the last commit before this PR merges.

Fixes #712
Fixes #718
Fixes #713
Fixes #716
Fixes #717
Fixes #719

The local pre-push hook was skipped with the maintainer's authorization; CI is the gate.

🤖 Generated with Claude Code

dovvnloading and others added 30 commits November 28, 2026 12:16
Tokens are batched into animation-frame store writes, and every append or
replacement set the phase to streaming. A frame flushed after Stop turned
Stopping back into Generating, re-enabled Stop and could mislabel the
end for screen readers. Output that arrives after Stop is still kept, but
only revertStopping (the server refused the cancel) or the job's end moves
the phase out of stopping.

Fixes #673

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… translated

A regenerated answer keeps its message id, but the stream only ever marked
an answer untranslated and never cleared the mark. After a failed
translation, a successfully translated replacement still said it could not
be translated. Every finished result now reconciles the mark, live and from
the status fallback.

Fixes #674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vered

When the stream dropped before the refusal or the end arrived, the status
fallback recovered the saved answer but never looked at the job result's
code_execution_rejection, so the user was not told why the requested task
never ran. One helper now announces the refusal from the stream or from the
fallback, once per job.

Fixes #699

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s job

A generation sends its memory suggestions as it saves the answer and again
in its final result, and each delivery replaced the whole list. A
suggestion the user dismissed (or saved) in between came back with the
final result. The store now records which job a message's suggestions came
from and which of them the user already handled; a repeat from the same job
leaves those out, and a new generation for the message starts afresh.

Fixes #694

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stream reader waited for the transport to close even after it had
delivered the job's terminal event. A connection left open after that event
kept the hook from finishing, so the composer stayed busy in every chat; a
transport error after the end also ran a needless status check. The client
now stops reading at the generation's terminal event and releases the
connection, and an error after the end changes nothing.

Fixes #693

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where crypto.randomUUID is missing, chat requests and model downloads fell
back to `${Date.now()}-${Math.random()}`. The decimal point in that number
fails the API's request-id pattern, so attachments could not be staged, and
a pending admission was dropped on restore instead of replayed. One shared
generator now falls back to random bytes in hexadecimal.

Fixes #696

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A regeneration went out without base_revision, so the server checked it
against its current revision instead of the one the client showed. A second
client still showing an older answer could replace a newer one saved from
elsewhere without being told. The revision is now sent, and kept in the
pending admission so a replay sends exactly the same request.

Fixes #685

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A regeneration that failed or was stopped before its replacement was saved
keeps the old answer, so the transcript still ends in a normal assistant
reply. Retry then found nothing to recover and sent the question as a new
turn, duplicating the user's message (and paying for another turn).

The page now remembers the answer a regeneration was replacing from the
moment it starts, and Retry regenerates that answer again if it is still
the last one; if the conversation changed, it asks the user to choose. Any
other send forgets it, so a later failed message is retried as itself.

Fixes #671

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any 4xx cleared a pending admission's request id, as if the request had
certainly not taken effect. But a 401 is answered before the handler runs,
and a replay can be refused while the original attempt was admitted: in
both cases the id was the only way to reach that job, and the next send
could duplicate a turn that was already saved. A replay now keeps the id
until the user abandons it, and no attempt drops it on an authentication
refusal; fork request ids follow the same rule.

Fixes #691

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chat page unmounts for Settings and other routes, but a send or an
upload it started can finish afterwards. Each mount kept its own copy of
the drafts and attachments, so the old mount settled into its stale copy
and wrote that to storage over what the remounted page held: a send
accepted late cleared a newer draft typed after the round trip (#697), and
an upload finishing late brought back a removed file and dropped one added
since (#687).

Drafts and staged attachments now live in one store shared by every mount;
a scope it has not seen is still read from storage, and every change is
still written there.

Fixes #697
Fixes #687

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client now releases a generation stream as soon as the job's terminal
event arrives (#693). The app-level test's hand-fed stream then threw when
the test closed it; like a real server, it now treats a cancelled stream as
gone and drops later writes.

Refs #693

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is recovered

Settling a first message moves what is left of the new-chat draft, its
files and its overrides to the real thread. When the send was a recovery
whose thread already existed, the user may have written in that chat
since, and the move replaced that unsent text, its staged files and its
settings. Now the thread keeps its own draft (the leftover stays under New
chat), its staged files gain the leftovers instead of being replaced, and
overrides move only to a thread that has none.

Fixes #692

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each mount of the chat page read the pending admission from storage once
and kept its own copy. When a send was accepted after a Settings round
trip, the old mount cleared storage but the remounted page kept the stale
intent: it refused the next send as "an earlier message may already be
running", and its retry could track the already finished job again, which
the stream host then skipped, leaving the composer busy for good.

The pending admission is now read from its one shared store (storage, or
memory when storage is denied), and every mount re-renders when it
changes. The stream host also releases its attach guard whenever a job
settles, so tracking a finished job again attaches to it and ends it.

Fixes #686

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A send waited for its acceptance and then installed its chat snapshot and
load state unconditionally. If the user had opened another chat meanwhile,
that chat was replaced by the sender's snapshot and the route guard showed
"Loading conversation..." with nothing left to load it. The job is still
tracked and the admission settled, but only the chat the send came from
takes the snapshot now.

Fixes #672

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a generation the stream host reloads the chat and upserts its
summary. A reload that was already out when the user renamed, moved or
deleted the chat landed afterwards and put back the old title or group, or
recreated the row of a chat the server had deleted. The store now counts
each chat's sidebar changes; the reload notes the count before it goes out
and leaves the summary alone if it changed.

Fixes #698

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A draft is written to session and local storage, and read session-first.
A tier whose write was refused (over quota, denied) kept its older copy:
a stale session copy then hid newer text saved locally, and after a
restart a stale local copy came back over text the session had taken. A
refused write now removes that tier's copy instead.

Fixes #688

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys ungrouped

Refreshing a chat's summary fell back to its current folder whenever the
response's group_id was null, but null is the server saying the chat is
ungrouped: a chat moved out of its folder from another client stayed in it.
Only an omitted group_id (an older server) keeps the current folder now.

Fixes #690

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After loading the chat list, preferences of deleted chats were pruned from
storage only. The live map still held them, and the next change to any
chat's options wrote them all back, where the 100-entry cap could push out
a chat that still exists. The store now prunes its live map and writes
that, keeping the new-chat draft options.

Fixes #689

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The group list loads separately from the workspace. A group created,
renamed, deleted or collapsed before that first list arrived invalidated
the request, so the list was discarded and the sidebar showed only the
groups changed since, until the next workspace load. The workspace now
records whether it has its list; a change made before then asks for the
list again.

Fixes #711

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a group create whose outcome was unknown, every other name was
refused for up to a day, and the New group dialog opened blank, so the only
way out was to guess and resubmit the old name. The dialog now starts from
the pending name, says its creation was not confirmed and may already
exist, and offers an explicit Abandon; the refusal names the pending group.
Creating it again still recovers it without a duplicate.

Fixes #695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every allowed link was resolved against the app's origin and opened in a
new window, so a footnote reference or a "#section" link opened the app's
start page instead of moving within the answer. A same-document link now
stays in place and brings its target into view: the nearest one, so an
answer's own footnote wins over another message's with the same label.
External links still open separately with noopener and noreferrer.

Fixes #700

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The memory editor stayed editable while a replacement was being saved.
The server's answer then reconciled the draft against the old values, so
text typed after Save was replaced by what had been submitted and the
editor reported no unsaved changes. The rows are read-only until the save
finishes.

Fixes #701

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A memory save that another view had overtaken was refused (409), but the
editor kept the old list as its precondition, so every retry and Save and
close failed the same way. A refused save now reloads the saved list; the
editor keeps the unsaved edits and merges them onto it, and the next save
is checked against what the server holds. The server's message is shown
with a note that the list was reloaded.

Fixes #702

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy details read the session's one last-crash slot. Another boundary
failing later overwrote it, so a route's crash screen copied a widget's
details instead of its own, and with session storage blocked it copied
"No crash details were recorded" although the boundary had just built the
record. Each boundary now keeps the record it built and copies that.

Fixes #723

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A toast pauses while it is hovered or has keyboard focus, but whichever of
the two ended first resumed the countdown. With focus still on its Undo
button after the pointer left (or the other way round), a chat-deletion
toast could expire and commit the deletion. It now resumes only when it is
neither hovered nor focused.

Fixes #710

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A task-list request answered after an approval was confirmed replaced the
whole list, so the approved task showed as pending again with its
Allow/Deny buttons, and stayed that way until a later poll. The list is
now merged into the tasks shown: a listed task does not replace one the
screen knows a newer state of (a higher sequence, or a decision the
listing has not seen).

Fixes #722

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A model job's stream or status check that answered 503 was treated as a
final refusal: the hook stopped tracking the job and its Cancel control
went away, while the download or pull kept running on the backend. A
502, 503 or 504 says nothing about the job, so it is now followed again,
like a lost connection; any other refusal still ends it.

Fixes #712

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a cancel request was refused, the hook put back the progress it had
captured before asking. It checked only that the current row was
cancelling, not that it was still the same job: a refusal arriving after
that job had ended and another had been started and cancelled put the old
job's progress over the new one. It now restores only while the same job is
still tracked.

Fixes #718

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lost acceptance for an Ollama pull or GGUF download is replayed with the
same request id. Any 4xx on that replay cleared the id, but a 401 is
answered before the handler runs and says nothing about the earlier
request: the backend could already be downloading, with nothing left to
find the job by. A 401 now keeps the id, so the next signed-in workspace
recovers the running job.

Fixes #713

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After one failed GGUF start, the chat page refused every send to every
GGUF model, though the backend starts the runtime again on the next
request (for corrected settings or another model) and applies its own
crash-loop limits. The failure is still reported with its message, but no
longer blocks the request that would recover. The unclean-stop state that
needs a restart still blocks.

Fixes #716

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dovvnloading and others added 5 commits November 28, 2026 13:23
The GGUF runtime's status was polled only while a GGUF chat model was
selected. Choosing an Ollama or cloud model does not unload a GGUF model,
but polling stopped, so System settings went on saying it was loaded (and
offering Unload) after the runtime had unloaded it on its idle timeout. The
status is now watched while a GGUF model is selected or the runtime is
anything but idle.

Fixes #717

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chat model picker, Settings' chat and translation choices, and the
selected-model check used every installed model, so an Ollama model that
reports only embedding was listed and marked ready, and every message to it
failed. They now use the models that can chat (the filter Agent mode
already used): a model without completion is left out, and one with no
capability report stays.

Fixes #719

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dovvnloading
dovvnloading merged commit c9c3e9b into main Nov 28, 2026
20 checks passed
@dovvnloading
dovvnloading deleted the batch/f4-models-runtime branch November 28, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment