* fix(chat): open quiz settings only when the learner picks the mode
The Activity panel auto-open watched the active capability, so loading or
reloading a session that was already in Quiz / Visualize / Research mode
counted as a switch into that mode. On a phone the panel is a full-screen
sheet, so every reopened quiz session started covered by its settings.
Open the config card from handleSelectCapability instead, the only path
for an explicit mode change (composer picker, slash command, launch
intent). Session hydration no longer opens it; restored per-session
settings are untouched.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
* test(chat): record viewer panel props through a spy
Assigning to the hoisted fixture inside the forwardRef stub trips
react-hooks/immutability; capture the props with a mock call instead.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
* fix(quiz): translate question badges and the German mimic label
The quiz card header printed the raw question type (short_answer,
fill_in_blank) and difficulty ids instead of the labels the quiz
settings already use, and the German catalog left "Mimic Paper"
untranslated.
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
---------
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Continues #2978 and closes#2887. Includes the original Windows file actions, integrates the changes with dev, and adds an explicit default-app action.
Co-authored-by: Botong Wu <2048400180@qq.com>
Retain admission error text and localized model-access guidance; allow explicit retry to revalidate access instead of permanently blocking stored messages. No automatic retry on reload. Backend tests and both manual retry paths passed.
A start_turn_rejected terminal error already carries the server's own
explanation ("No LLM model is assigned to your account. Please contact
an administrator.", #2637; "This learning account cannot use this
mode...", the mastery case in #2638). The client toasted it for ten
seconds and then dispatched STREAM_END without it, so the persistent
composer-adjacent banner — the text users actually read — hardcoded the
transport copy "Couldn't reach the server..." for every rejection.
Carry the server text onto the flagged unsent row
(failedSubmissionMessage) and render it in the banner, falling back to
the connection copy only when the server provided no text. The toast
stays; the unsent row + Resend semantics from #1594 are unchanged.
Not persisted across reload: a reloaded unsent row shows the generic
fallback (its durable record keeps the exact request for retry); a
follow-up can extend the durable record if wanted.
A persisted override the selected model no longer supports (e.g. a saved
xhigh after the catalog restricts the model to low/high) could reach the
provider: the selector re-listed the stale value, and the send path
forwarded the restored llm_selection.reasoning_effort unchecked.
- lib/reasoning-effort.ts: supportedReasoningEffortValues() returns the
model's supported wire values (catalog list, else provider/model tables
honouring declared_reasoning) without ever re-adding the stored value;
effectiveReasoningEffort() resolves an override to null when the model
does not support it; dropUnvalidatedReasoningEffort() strips it from an
outgoing llm_selection — including when the option is unresolved, where
the override is omitted (falls back to the configured default) rather
than forwarded unvalidated.
- ReasoningEffortSelector: computeReasoningOptions uses the helper; a
stale value is not offered and Auto renders as selected instead.
- ChatComposer: once the model options are loaded, a detected-unsupported
persisted override is reset through the selector's onChange persist
path; nothing is cleared while the option is still unresolved.
- ChatStateAdapter: outgoing llm_selection (live send and failed-turn
resend) is sanitized via the last-known option catalog, which
listLLMOptions now records (readLastKnownLLMOptions, synchronous).
- tests: helper/selector/restore-path coverage in
reasoning-effort.test.ts, reasoning-effort-selector.spec.tsx and the
new reasoning-effort-restore.spec.ts.
Carry the #958 service-layer reasoning_effort override through the whole
turn contract: the core TurnRequest LLMSelection accepts the field
(validated against VALID_REASONING_EFFORTS, old two-ID payloads unchanged),
the generated web contracts are regenerated, and ChatStateAdapter's
asLLMSelection restores a legal override instead of dropping it.
The composer gains a selector beside the model picker, offering only the
levels the selected model supports (live supported_reasoning_efforts or
the provider/model tables) narrowed to the wire vocabulary, hidden when
the model has none. The choice persists on the conversation's
llm_selection, so the next send uses it without a backend restart and
other conversations are unaffected; switching models resets the override.
Precedence stays conversation override -> profile/model default ->
provider default, and the context-budget readout reports the effective
effort beside the model when one was used.
AssistantMessage derived its lang attribute from the session-wide
language prop, so switching the reply language re-tagged every past
reply (zh->ja gave old Chinese replies Japanese fonts). Derive the
per-message language from the turn's request snapshot, recorded when
the turn was sent, and fall back to the session language only for
legacy messages without one. Add a behavior test covering two replies
with different recorded languages and the legacy fallback.
Engine-level search provider backed by DeepSeek's /v1/tools/search endpoint,
distinct from the model-side web_search tool mapping: works with any
configured LLM. Rows carry no model-written answer, so consolidation still
supplies it.
- providers/deepseek.py: Bearer auth, count capped 1-50, need_content
default False (page Markdown kept in SearchResult.content only when
requested), summary preferred over snippet as the model-facing blurb,
authority/rerank_score in attributes, proxy honored, base_url used
verbatim with the documented endpoint as fallback. No new dependency.
- SEARCH_PROVIDERS: label DeepSeek, requires_api_key=True,
soft_fallback=False (billed per request; a missing key raises instead
of landing on DuckDuckGo).
- Init wizard entry with DEEPSEEK_API_KEY/SEARCH_API_KEY env keys, keeping
the wizard set equal to the backend table.
- TracePresentation PROVIDER_LABELS: deepseek -> DeepSeek (titleCase would
render "Deepseek").
- Tests: row mapping, 401/402/429 paths, missing key fails before network,
and the base_url/proxy/max_results contract via _NEW_PROVIDERS.
Return the detached thread ids from deleteMessage and have deleteTurn
notify the session-change bus, so useSessionThreads and the viewer refresh
immediately instead of keeping a stale marker.
ChatWorkspace clears only the tabs still pointing at one of the deleted
message rows; a newer passage selected but not yet sent survives the delete.
Detaching a thread from its message cleared only the server preference, so an open tab still sent the old quoted_message_id and filed the thread back under the message. Clear the tab's anchor once the server confirms, unless a newer selection already moved it. A new side chat is matched through its live thread state too: its first send binds a session before the tab records a followupSessionId.
A selection whose message is still optimistic has no persisted id; it now leaves the thread unattached instead of keeping the previous message.
quoted_message_id now follows the create_target rule: the key's presence
is authoritative. A value moves the thread, an explicit null clears it,
and omitting the key leaves the stored anchor untouched. A new selection
moves the thread to the passage just asked about.
The message-level popover gains a detach action that clears the anchor
through the organization PATCH without deleting the conversation, and a
deliberate clear also stops the legacy backfill from re-attaching it.
Side chats are filed under the message their quoted passage came from:
the turn carries quoted_message_id, the backend stores it as
tutor_source_message_id, and the chat list shows "Little Tutor x N"
under that message with a popover to open or delete each thread.
Threads are read once per conversation and shared with the viewer, only
side-chat turns refresh the session lists, and a turn that omits the
field leaves the stored anchor untouched.
Refs #2118
Editing a saved question copies its request snapshot and replaces only the
content, and sendMessage treats any supplied snapshot as an exact replay, so
the model picker and the explicit reply language of the moment lose to the
ones the original turn ran with.
An edit opens a new branch: it keeps the turn's material context (attachments,
tools, knowledge bases, references, capability, parent) but resolves generation
settings from the session, the way a fresh send does. Unsent drafts keep
replaying their exact reserved request, which is what the submission-replacement
protocol requires.
Adds a regression case for the persisted-message edit, and lets the mocked
PATCH /api/sessions/{id}/reply-language echo the language back like the real
endpoint does.
Editing a persisted message and resending a saved failed turn both replayed
the failed turn's saved request verbatim, so the new turn silently ran on
the previous model and the previous reply language.
- An edit keeps the original request's context (attachments, references,
parent, capability, tools, config) but takes the model and the reply
language from the current session state (#2106).
- A Resend of a saved failed turn sends the current model and reply
language in the regenerate overrides. The backend already prefers those
over the saved snapshot, and the recovered model is now written back to
the conversation, so the choice survives a reload (#2105).
- An unconfirmed submission is still retried with its own parameters: the
server may already hold that submission id, and a changed request would
no longer match it.