Commit Graph

1019 Commits

Author SHA1 Message Date
Wenjun Li
fdebb2761e fix(chat): keep parked ask_user turns alive across deletion and reload (#1789)
* 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.
2026-10-07 20:37:04 +08:00
Bingxi Zhao (Frank)
33c81a435c fix(quiz): translate follow-up notebook writeback errors 2026-10-07 20:31:13 +08:00
Bingxi Zhao (Frank)
a137fbd29d fix(settings): retain explicit token clearing and edits made during Apply 2026-10-07 20:31:13 +08:00
evan188199-tech
12b8e531f2 fix(web): surface quiz follow-up session-id writeback failures (#1701)
* 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>
2026-10-07 20:30:03 +08:00
georgelichen
510fe3a744 fix(settings): prevent phantom unsaved changes when configuring MinerU cloud API (#1798)
- 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>
2026-10-07 20:29:54 +08:00
evan188199-tech
03ac69a0d3 fix(chat): keep unsent drafts safe when restore fails (#1705)
* 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>
2026-10-07 20:29:43 +08:00
evan188199-tech
d022aa6d04 feat(chat): keep branch navigator visible on forked messages (#1410) (#1723)
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>
2026-10-07 20:29:31 +08:00
evan188199-tech
a597998134 fix(reading): converge the mobile header and dock the selection panel (#1734)
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>
2026-10-07 20:29:14 +08:00
evan188199-tech
46199adf51 fix(courses): surface course deletion failure instead of silent redirect (#1754)
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>
2026-10-07 20:29:00 +08:00
evan188199-tech
ca2241aa7b test(web): cover the settings store and memory-graph helpers (#1710)
* 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>
2026-10-07 20:28:38 +08:00
evan188199-tech
f2ce12cef3 test(web): smoke coverage for StandaloneComposer send gating (#1744)
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>
2026-10-07 20:28:28 +08:00
evan188199-tech
ea3e2ff47b test(web): cover VisualizationViewer render branches (mermaid/svg/chartjs/html/plugin/manim) (#1749)
Add web/tests/visualize/VisualizationViewer.spec.tsx with 22 vitest cases
covering the three core states (loading, render success, render-failure
fallback) plus the remaining render dispatch branches: svg sanitize/split,
chartjs parse/destroy, html iframe bridge, plugin iframe, geogebra,
unknown renderer, manim delegation, toolbar/fullscreen/code panel.

VisualizationViewer.tsx coverage: statements 1.69% -> 74.57%, branches
0% -> 50.86%, functions 0% -> 71.69%, lines 1.49% -> 61.56%.
Full suite 114 files / 493 tests green; typecheck + eslint clean.
No product code changed. Evidence: evidence/test-visualization-viewer-20261003/

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:28:19 +08:00
evan188199-tech
386df342cb test(web): smoke ChatWorkspace empty home, streaming turn, failure banner (#1767)
* 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>
2026-10-07 20:28:05 +08:00
evan188199-tech
bffe8e84b1 test(quiz): add QuizViewer smoke and grading interaction coverage (#1775)
Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:27:54 +08:00
evan188199-tech
b697ec72e9 test(settings): cover CLI-app model persistence end to end (#1630) (#1745)
* 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>
2026-10-07 20:27:43 +08:00
Bingxi Zhao (Frank)
1e048bab77 fix(visualize): validate mindmap roots and complete translations 2026-10-07 20:27:15 +08:00
evan188199-tech
61a2cad184 feat(visualize): add Mermaid mindmap visualizer (#1295)
Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:24:02 +08:00
Bingxi Zhao (Frank)
f07029cfcf release: v1.6.13
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.
2026-10-04 21:35:00 +08:00
Bingxi Zhao (Frank)
aa498ff704 fix(tests): normalize Windows paths in web contracts (#1696) 2026-10-04 18:22:49 +08:00
Bingxi Zhao (Frank)
8ccca47bac fix(reading): track EPUB text progress within chapters (#1673) 2026-10-04 18:20:29 +08:00
Bingxi Zhao (Frank)
ed3f9e9b4e fix(chat): distinguish unconfirmed replies from expired questions (#1648) 2026-10-04 18:14:40 +08:00
Bingxi Zhao (Frank)
8ed5fe040e test: synchronize session restoration and turn cleanup 2026-10-04 16:21:59 +08:00
Bingxi Zhao (Frank)
0d8f4a4c87 perf(reading): defer EPUB and video marks until needed 2026-10-04 15:51:09 +08:00
Bingxi Zhao (Frank)
e91d9800ed chore(contracts): sync browser APIs after PR integration 2026-10-04 15:50:57 +08:00
Bingxi Zhao (Frank)
c134833fcb fix(i18n): complete Polish translations for integrated features 2026-10-04 15:14:46 +08:00
Bingxi Zhao
c30449895e Merge pull request #1661 from ChinskiKaczynski/feat/polish-language
feat: add Polish localization
2026-10-04 15:13:29 +08:00
Bingxi Zhao (Frank)
a3c76c9d27 fix(voice): preserve math and isolate reply playback lifecycle 2026-10-04 15:13:14 +08:00
Bingxi Zhao (Frank)
b83592a107 Merge dev into PR #1557 and preserve integrated behavior 2026-10-04 15:09:24 +08:00
Bingxi Zhao (Frank)
8b51caf055 fix(reading): isolate audio cleanup across delayed playback and unmount 2026-10-04 15:07:00 +08:00
Bingxi Zhao
90d2d06366 Merge pull request #1655 from evan188199-tech/codex/feat/reading-natural-tts
feat(reading): add material-scoped natural read-aloud audio (#1654)
2026-10-04 15:04:37 +08:00
Bingxi Zhao (Frank)
232f720e90 Merge dev into PR #1671 and preserve integrated behavior 2026-10-04 14:55:52 +08:00
Bingxi Zhao (Frank)
f44db74f9c fix(i18n): complete image description model settings copy 2026-10-04 14:43:50 +08:00
Bingxi Zhao (Frank)
2700105923 Merge dev into PR #1664 and preserve integrated behavior 2026-10-04 14:41:40 +08:00
Bingxi Zhao (Frank)
6327c41d55 fix(settings): match GLM reasoning choices to the model contract 2026-10-04 14:37:31 +08:00
Bingxi Zhao
6a734e356c Merge pull request #1653 from yizhang-dream/feat/glm-reasoning-effort
feat(web): offer reasoning effort levels for GLM models under openai binding
2026-10-04 14:35:20 +08:00
Bingxi Zhao (Frank)
5cff0b3e90 fix(chat): compute continuation depths without recursion 2026-10-04 14:35:08 +08:00
Bingxi Zhao
440eed2dac Merge pull request #1619 from evan188199-tech/codex/fix/chat-long-session-branching
fix(chat): preserve long-session branch path (#1614)
2026-10-04 14:33:49 +08:00
Bingxi Zhao (Frank)
5532b90107 test(partners): verify exports after switching discussions 2026-10-04 14:33:37 +08:00
Bingxi Zhao
df724000ca Merge pull request #1558 from AoHanBei/feat/1512-group-chat-export
feat(partners): export group conversations as Markdown
2026-10-04 14:32:22 +08:00
Bingxi Zhao (Frank)
95e3c7749a fix(practice): return library practice to its scoped collection 2026-10-04 14:32:11 +08:00
Bingxi Zhao
63e27afff3 Merge pull request #1620 from Chanson4/feature/practice-from-question-bank
feat: allow practice from the question bank
2026-10-04 14:30:35 +08:00
Bingxi Zhao (Frank)
7268378088 test(chat): cover persistent question picker selections 2026-10-04 14:30:22 +08:00
Bingxi Zhao
6ed3b0c1a0 Merge pull request #1618 from Chanson4/feature/chat-question-bank-bulk-select
feat: bulk select question bank entries in chat
2026-10-04 14:28:21 +08:00
Bingxi Zhao
ab52f95cc3 Merge pull request #1640 from evan188199-tech/codex/co-writer-model-selection
feat(co-writer): support model selection for edits (#661)
2026-10-04 14:27:08 +08:00
Bingxi Zhao (Frank)
c160ad5cf7 Merge dev into PR #1645 and preserve integrated behavior 2026-10-04 14:26:07 +08:00
Bingxi Zhao (Frank)
6d2d9ee7bd fix(i18n): translate reading quiz stars in French 2026-10-04 14:25:03 +08:00
Bingxi Zhao (Frank)
dfeb2fb4f3 Merge dev into PR #1657 and preserve integrated behavior 2026-10-04 14:22:45 +08:00
Bingxi Zhao
891493b7b1 Merge pull request #1686 from evan188199-tech/codex/fix/epub-toc-anchors
fix(reading): preserve EPUB outline anchors (#1673)
2026-10-04 14:20:41 +08:00
Bingxi Zhao
1ae435ef87 Merge pull request #1688 from ZyPulse-zy/fix/pdf-resize-reading-position
fix(reading): preserve PDF reading position across resizes
2026-10-04 14:19:54 +08:00
Bingxi Zhao
f56dfb476e Merge pull request #1599 from dxhome/codex/fix-knowledge-list-proxy
fix: knowledge base listing through proxy
2026-10-04 14:13:31 +08:00