docs(tui): document defer_history vs omit_messages precedence

Follow-up to the #62799 salvage: Desktop sends both defer_history and
omit_messages on a cold resume. Make explicit in the deferred branch that
defer_history supersedes omit_messages — the single history read happens in
the background hydration worker and the synchronous omit_messages read on
the cold-resume default path is skipped entirely, so the transcript is
never loaded twice for one resume.
This commit is contained in:
Teknium
2026-08-16 00:49:01 -07:00
parent a2fd20f896
commit 69f7c655b4
+8
View File
@@ -523,6 +523,14 @@ def _(rid, params: dict) -> dict:
# transcript through the paginated REST endpoint. Register the runtime now,
# then load model history and initialize optional providers in background.
# Repeated requests reuse the record through the live fast path above.
#
# Precedence vs omit_messages: defer_history SUPERSEDES omit_messages.
# Desktop sends both flags on a cold resume; when defer_history is set the
# response never carries a transcript (messages is always []) and the ONE
# history read happens in the background hydration worker — the synchronous
# omit_messages read below (cold resume default) is skipped entirely, so
# the transcript is never loaded twice for one resume. omit_messages only
# governs the response shape of the non-deferred paths.
if defer_history and not is_truthy_value(params.get("eager_build", False)):
sid = uuid.uuid4().hex[:8]
source = _resolve_session_source(str(params.get("source") or "").strip() or None)