Skip to content

Harden chat, runtime, and generation stream reliability - #123

Merged
dovvnloading merged 1 commit into
mainfrom
codex/qa-reliability-pass
Aug 12, 2026
Merged

Harden chat, runtime, and generation stream reliability#123
dovvnloading merged 1 commit into
mainfrom
codex/qa-reliability-pass

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Summary

This QA pass fixes four high-confidence reliability issues across chat generation, the managed llama.cpp runtime, and the generated API contract.

  • Regenerate responses from the selected turn's own prompt and attachments instead of component-wide state that can belong to another chat.
  • Preserve next-turn text and attachments while a generation request is being accepted, including both attachment-staging race orderings and the temporary-to-persisted thread ID transition for new chats.
  • Reap a llama.cpp server process whenever startup fails, escalating from terminate to kill when the process does not cooperate.
  • Describe the generation event stream as text/event-stream in 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 full
    • Ruff: passed
    • Backend: 509 passed, 1 platform-specific skip
    • Generated contract drift: passed
    • Python compile check: passed
    • TypeScript typecheck: passed
    • ESLint: passed
    • Frontend unit tests: 161 passed
    • Playwright browser tests: 18 passed
    • Production frontend build: passed
  • Repository pre-push quick gate: passed
  • Focused regression coverage added for cross-chat regeneration, draft/attachment acceptance races in both orderings, new-chat scope migration, SSE media type, and uncooperative runtime shutdown.
  • Final diff review: no outstanding findings.

Operational notes

No dependencies, persistence formats, or database migrations change. Rollback is a normal revert of this commit.

@dovvnloading
dovvnloading marked this pull request as ready for review August 12, 2026 13:36
@dovvnloading
dovvnloading merged commit d2bcd81 into main Aug 12, 2026
2 checks passed
@dovvnloading
dovvnloading deleted the codex/qa-reliability-pass branch August 12, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant