Harden chat, runtime, and generation stream reliability - #123
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This QA pass fixes four high-confidence reliability issues across chat generation, the managed llama.cpp runtime, and the generated API contract.
text/event-streamin OpenAPI instead of incorrectly advertising JSON.Root cause and impact
Chat regeneration reused mutable page-level prompt and attachment state. After navigation, that state could belong to a different thread, while delayed request acceptance could clear or strand drafts created for the next turn. The fix derives regeneration inputs from the selected transcript turn and gives each in-flight attachment batch a request-local draft target that can be safely retargeted before new-chat navigation.
The llama.cpp manager did not publish a process into managed state until it became healthy. A process that timed out during startup could therefore survive the failure path without being wait-reaped or kill-escalated, continuing to consume CPU, RAM, or GPU resources.
The generation events route returned SSE at runtime but its generated OpenAPI response still declared
application/json, which could misconfigure generated clients and API tooling.Validation
./scripts/check.ps1 -Tier fullOperational notes
No dependencies, persistence formats, or database migrations change. Rollback is a normal revert of this commit.