* fix(session): delete a message's own turn and refuse active-turn deletion
Resolve the owning turn via `turns.assistant_message_id` for assistant rows
and the user row's `metadata.turn_id`, falling back to the last turn created
at or before the user row for legacy data. The previous `created_at >=` match
selected the *next* turn, because a turn row is always written before its user
row (`begin_turn` -> `add_message`); deleting a completed turn's message could
therefore destroy a later `waiting_input` turn's record while its task still
held the session lease.
Refuse the delete whenever the resolved turn is in `ACTIVE_TURN_STATUSES`
(queued/running/waiting_input) instead of only "running"; the API answers 409
with "running or waiting for input".
* fix(chat): resubscribe a parked turn on load so its ask_user card survives a reload
A `waiting_input` turn keeps the session lease while it waits, and its
ask_user card exists only in the live event stream: no assistant row is
persisted until the turn settles. Loading a session only resubscribed
"running" turns, and through `sendThroughRunner`, whose retry gate drops a
non-streaming session -- so after a reload the card was unreachable while the
turn kept waiting, and the conversation could neither be answered nor used.
Parked turns now subscribe through the client's durable command queue (sent
once the socket opens), once per turn per tab. The replayed stream rebuilds
the card so it can be answered.
* test(chat): align the loader-gate assertion with the parked-turn resubscribe
The source-shape assertion pinned the previous loader line
(`if (loadedStatus === "running" && (activeTurn?.turn_id || activeTurn?.id))`).
The parked-turn resubscribe extracts `activeTurnId` first and adds a
`waiting_input` branch, so update the assertion to the new gate and cover the
parked branch's status check as well.
* fix: surface quiz followup session-id writeback failures
The notebook entry writeback of followup_session_id swallowed all
errors with a noop catch, silently losing the quiz-to-note link when
the API call failed. Retry once for transient failures and surface a
visible thread error if the retry also fails.
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
- Normalize MinerU API URL and endpoint trailing slashes in normalizeDraft
- Prevent browser credential autofill on MinerU API token field with autoComplete='new-password'
- Add toggleable visibility for MinerU API token with Eye/EyeOff icons
- Reset dirty flags on mounted extensions in clearPending after successful apply
- Add tests covering MinerU cloud credentials application in unified draft
Co-authored-by: 李晨 <lichen@lichendeMac-Mini.local>
* fix(chat): keep unsent drafts safe when restore fails
When the workspace-draft restore fails, the composer stays out of sync
with the stored draft. Saving on workspace switch then clobbers the
unseen stored draft with the composer content (or empties it), and
sending clears the stored draft although its text was never shown.
Track the restore failure and, on workspace switch, skip the save when
the composer has no new content; otherwise merge the newly typed input
on top of the stored draft, re-reading it once per mount so a retried
switch merges the original draft instead of re-appending. If the
re-read also fails, reject the switch so no text is lost. Sending no
longer clears the stored draft after a failed restore.
Add tests that cover the restore-failure switch and send paths.
* fix(chat): keep typed text when stored draft text is empty
The failed-restore merge used a ternary that fell back to
`stored?.text ?? draft.text`, so an empty-string stored draft dropped
newly typed input (deleted the draft on save). Merge with
filter(Boolean) so any non-empty side survives, matching
transferWorkspaceDraft.
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
Editing an early message forks the transcript and the visible path jumps
to the newest sibling, so the pre-edit history disappears from view. The
only way back — the BranchNavigator under the forked user message — was
gated behind the hover-only action row, so readers who never hovered that
one bubble saw "chat history lost, only the latest few messages remain".
Keep the single action row: the BranchNavigator renders beside Copy/Edit
and stays visible without hovering, while only Copy/Edit keep the
hover/focus reveal. No data was ever lost — rows, read path, and Memory
L1 behaviour are untouched.
Related to #1410
Co-authored-by: XZH <cto@xzh.ai>
Below 768px the reader header converges to back, title + chapter,
bookmark and more: forward moves into the more menu (also when the
workspace hosts it), the file icon yields its width, and the chapter
indicator truncates inside a bounded share of the row instead of
disappearing. The selection panel becomes a bottom card on phones:
collapsed rows for short content, a capped scrollable body for the
note editor and overflow actions, a drag handle for pull-down-to-
dismiss, and safe-area padding; the desktop popover is unchanged.
Refs #916
Co-authored-by: XZH <cto@xzh.ai>
The confirm handler fired deleteCourse with void and no .catch, so a
failed delete left an unhandled rejection, gave the learner no feedback,
and still navigated away from the course page. Await the call in a
try/catch: stay on the page with a visible alert (and the dialog open
for retry) on failure, push /courses only on success, and disable the
confirm button while pending.
Co-authored-by: XZH <cto@xzh.ai>
* test(web): cover settings store persistence and normalization
* test(web): cover memory-graph pure functions
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
Pins the composer's own state pool: empty-input guard, full submission
payload with one-shot state consumption, the isStreaming lock and its
awaitingUserReply escape hatch. ChatComposer is stubbed so the tests
exercise StandaloneComposer's decisions, not the presentation.
Covers the 0%-coverage Top-20 entry from evidence/coverage-2026-10-02.
Co-authored-by: XZH <cto@xzh.ai>
* test(web): smoke ChatWorkspace empty home, streaming turn, failure banner
ChatWorkspace.tsx had 0% unit coverage (DT-21 top-15 gap #2). Mount the
real surface with the ChatStateAdapter mocked at its boundary and stub
the heavy leaf components, then assert:
- empty draft renders the greeting home and bootstraps newSession()
- a first send reaches sendMessage with the composed turn config
- streamed deltas drive message-list/composer streaming flags until done
- submission failure shows the composer-adjacent error banner with a
working Resend, and the needs-review variant drops the Resend
- an unloadable URL session settles into the retryable failure state
File coverage: 0% -> 50.3% lines (476/947), 47.4% statements.
* docs(evidence): add PR draft for ChatWorkspace smoke tests
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(settings): apply PR #1634 draft test verbatim
Applies the exact test change from PR #1634 (codex/test/subagent-settings-draft,
fc8ef2f36) on top of dev to verify it passes without any fix commit.
* test(settings): cover CLI-app model persistence end to end (#1630)
Mounts the real SubagentSettingsEditor inside SettingsProvider with the
settings toolbar and a network-level mock backend. Verifies the three
paths from issue #1630: live model edits flush through PUT
/api/subagents/settings before POST /api/settings/apply and survive a
remount; a draft parked server-side applies even when its editor is not
mounted; a restored draft applies from the editor's page and survives a
reload.
---------
Co-authored-by: XZH <cto@xzh.ai>
Ship the reading, listening, question-bank, parsing, and provider updates
summarized in assets/releases/ver1-6-13.md.
Make speech timeouts configurable, report actionable synthesis failures,
and keep chat attachments discoverable in their selected workspace while
preserving earlier uploads and URLs. Keep reply playback cancellation and
single-audio ownership intact.
Sync README prose and all eleven translations, update the stable install
note, and archive release notes older than one week. Repair stale reading
test fixtures and spawned test imports, and clear the Partner type error.
Validation: 9252 Python tests and 8 subtests passed (28 skipped); 518 web
unit tests, 1253 Node tests, and 62 browser audits passed. Pre-commit, ruff,
typecheck, contracts, architecture, i18n, production build, route budgets,
and the docs build passed.