Update the status contract for session_id and prove concurrent retries in a fresh session create only one card while retaining the archived question (139 passed).
A pending quiz card stores the source snapshot it was verified against,
including a fingerprint of the whole published KB index. Adding any
document to that KB changed the fingerprint, so every grade failed with
"Prepare the lesson again" - which refreshes only the lesson packet,
never the card - and the learner's answer could not be recorded.
An issued question is now bound to the pages it cites: when the index
changed but each cited page (KB, document, page, source digest) is still
published unchanged, the question validates and is graded. If a cited
page did change, the error says so and names the recovery tools.
Lesson packets and question issuance keep the strict whole-index check;
objective, answer-key and scope gates are unchanged.
Opening the response stream was still unbounded, so a provider that hangs
while connecting parked the turn the same way a mid-stream stall did. The
answer loop bounds both halves (agent_loop.py:886 pairs the create() call with
the same _STREAM_IDLE_TIMEOUT_SECONDS the reader uses); mirror that here.
ContextExplorer._call_llm iterated the provider stream with a bare
``async for``. A provider that connects and then stops yielding frames left
that await pending forever, so ``pre_loop`` never returned, the capability
never finished, and the turn stayed ``running``. The lease kept renewing, so
TurnRecoveryService saw a live owner and never claimed it; only an explicit
cancel freed the turn.
The answer loop already bounds its own reads (``_bounded_stream_chunks``,
90s), but the pre-pass runs before that loop starts, so it never inherited
the bound. Give it the same watchdog: on idle, raise
LLMProviderTransportError, which the existing ``except Exception`` around
``_run_loop`` turns into the single-pass briefing fallback.
Refs #2539 (the third attempt left ``running`` is a separate, pre-existing
bug, not the empty-error-message one this session's other PR fixes).
The fold loop counted only each exchange's archive text and always folded
the oldest exchange, so one exchange over the plan was sent whole, and
prior learner memory could push a fitting exchange over it.
Fold the longest prefix of whole exchanges whose complete request fits:
prior memory, the system instruction and the exchanges as _summarize()
serializes them, plus a reserve for the length line. If even the oldest
exchange doesn't fit, send no memory call; the watermark stays and the
exchange stays in exact recall.
Exclusive knowledge capabilities (obsidian, marginnote4, subagent) dropped
the whole chat built-in surface, including web_search (still shown on in
settings) and the always-on web_fetch. Add a coexisting_tools declaration
to KnowledgeCapability (default empty; the product KBs declare the web
pair), honoured in compose_enabled_tools' exclusive branch under each
tool's usual gate (user toggle / always-on / conditional flag) and the
partner builtin_whitelist, mirroring the #650 KB coexistence. The
capability's system prompt now also names what actually mounted via
coexisting_tools_block, so the model no longer disclaims mounted tools.
Fixes#2612
Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
A failed tutoring-memory call keeps the watermark, so the next turn
retried with the same backlog plus the newest exchange, and the call
grew without limit (#2496). Fold in only the oldest whole exchanges
that fit one history plan, at least one, and leave the rest
unsummarized so the watermark moves only past what was covered.
Related to #2496
An endpoint that makes optional properties required forces the model to
send visual even for a text card, with every source left blank.
prepare_visual always rejects an unnamed source, so mastery_quiz failed
on every call and no answer card appeared (#2427).
Treat a visual whose sources name no knowledge base, asset, path, hash
or figure as absent, for single cards and group leaves, as #2170 does
for blank resume ids and empty groups. A visual naming any source still
goes through prepare_visual unchanged.
search() and linked_objects() fed the caller's text straight into a LIKE
pattern without an ESCAPE clause, so "%" matched every object, "_" matched
every object with a character, and linked_objects("100%") also linked the
object that stores 1000.
Escape the value once and declare ESCAPE '\' on every clause, matching
the other LIKE call sites in the repository.
Signed-off-by: Eapp1e <163811520+Eapp1e@users.noreply.github.com>
The web client restates answer_by on every turn and sends "" when Dito
answers (sideChatTurnConfig, QuizFollowupContext). TurnRequest only
accepted an omitted value or partner:/subagent:, so every Dito side chat
failed with "Command does not match the turn protocol."
Read a blank value as None. The field stays in fields_set, so
to_payload() still carries it and the stored hand-off is cleared as the
client intends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first visit stored the detected palette and never listened for
prefers-color-scheme changes, so the theme stopped tracking the OS and
Settings had no System choice.
Do not write that fallback. Subscribe while the preference is missing or
"system", and add a System option in Appearance. New accounts default to
system so Apply does not freeze the snow palette.
Keep learner-facing explanations visible across finish checks, persistence, and replay. Remove mastery prose heuristics and prioritize learner objections.
Coordinate service shutdown and descendant cleanup, and preserve video lesson identity and playable results across chat completion and reload.