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.
Remove course pages, APIs and the course_study capability. Add anchored note
threads and reviewed learning-block generation, queued and withdrawable chat
messages, quote attachments, side chats, and the calendar/favorites/navigation
updates.
Keep preview's existing backend architecture. Wire the new features through
its Python application and existing chat engine, retain legacy selected-text
requests, persist mid-turn messages in replay, and restore note context when
regenerating. Leave stored user data intact.
Validate frontend contracts, dependency boundaries, types, 1290 node tests,
840 rendered tests, lint, localization and the production build. Exercise
session/notes/API regressions, 53 chat-engine tests and 20 Python/native
integration tests with isolated runtime data.
The writer now returns a narration line per scene. The host speaks each one
with Edge's free read-aloud voices, times the captions from the sentence
boundaries, and inlines the audio into the lesson page. edge-tts is an optional
extra (video-lesson); without it, or when the service fails, the scene keeps
captions timed from an estimated speaking rate and plays silently.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
<Scenes> plays a lesson's scenes back to back and gives each one its voice-over
and captions from a per-lesson voice.ts. A scene stretches to fit its narration,
so the picture never cuts the voice short. The kit ships an empty voice.ts so
it still compiles on its own, and the player now shows a volume control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A video lesson's turn directory holds the model's source next to the
built page. Only artifacts/lesson.html is added to the public-output
allowlist; Lesson.tsx and anything else in the directory stay private.
The page runs model-written script, so it is served with
"Content-Security-Policy: sandbox allow-scripts allow-popups". It then
runs in an opaque origin even when opened in its own tab, without the
API's cookies or same-origin access.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One agent writes Lesson.tsx. Its system prompt covers the Remotion rules
a lesson needs (frame-driven animation, sequences, the 1920x1080 frame),
an art direction meant to keep lessons from looking machine-made
(textbook and documentary references, a list of tells to avoid,
captions in a teacher's voice), and the kit's source.
The conversation is kept across attempts, so a failed compile or frame
check goes back to the model with the errors and its previous reply.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Groundwork for a capability that answers with an animated explainer the
learner plays in the browser, rather than a server-rendered video.
kit.tsx is the component library lessons are written against: a paper
page, serif titles, captions, pen marks, plots (curves, point sequences,
cobwebs), an honest-scale timeline and a China map, all in DeepTutor's
palette. Style comes from the kit, so the model only arranges content.
build.mjs compiles Lesson.tsx with esbuild, renders 25 sample frames in
Node and bundles the composition into @remotion/player. Lessons may
import only react, remotion and ./kit, and the frame check runs under
Node's permission model (no file writes, child processes or workers).
Errors thrown during rendering are reported through renderToPipeableStream
so the model sees the real message.
runtime.py installs the pinned npm packages on first use, then wraps a
bundle into one self-contained page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
solve_finish_step folds the finished step's tool chatter, and the same cut
dropped the solve_plan result and the step's own `next` pointer, leaving the
model only "[S1] ... — done.". Pass SolveSession.progress_text() as the
checkpoint state so every fold keeps the current plan (done / next / todo) in
view, including after a replan, and the persisted model turn carries it into
follow-up turns.
Closes#1968
A checkpoint may now carry an optional `state` next to `summary`. The fold
keeps appending summaries before the boundary as before and places `state`
in one system message after it, so the next fold replaces the state instead
of stacking stale copies. Checkpoints without `state` behave exactly as before.
The guard sized the request from message content alone. It ignored
assistant tool_calls arguments and the tool schemas sent with the call,
so a request over the window could go out untrimmed.
- Count each message with the counter history planning uses, leaving out
the _context_snapshot key that _call_llm strips before sending.
- Pass the call's tool_schemas into the guard. The forced-finish round
sends none, so it passes none.
- Keep a running total while tool results are snipped instead of
re-estimating the whole request after every snip.
- Log a warning when nothing is left to trim and the request still does
not fit, rather than passing it silently.
With the call's tool schemas, the 8k reproduction from #1961 now trims all
three tool results, taking the request from 10435 to 6514 tokens against a
7372-token budget.
Refs #1961
`_append_loop_instruction` appended a recovery directive by rebuilding the
trailing user message as a string. A user message can carry content parts —
chat PDF attachments add image blocks beside the text — and `str()` on that
list folds every `data:...;base64,` URL into prompt text, so the next round
sends image bytes to the provider as language tokens instead of images.
A scanned 7-page PDF (whole-page JPEGs harvested as embedded figures) turned
into a ~5.9 MB prompt string: the image-aware context counter reported
4,014,309 tokens for the round against a 1M window, the provider answered
400 InvalidParameter, and the turn ended on the empty-response fallback.
The directive now extends the message's own text part, or appends a text part
when the message holds only images. Image parts, their order and the durable
model turn are unchanged; only the text grows.
Reached whenever a round ends with nothing to replay: an empty finish, or one
whose stream carried no text, reasoning or tool call.
Bind original visual sources and keys to supported tasks; verify accepted model pixels, preserve cues/assistance and canonical attempts, keep uncertainty ungraded, expose challenge/repair, and separate required visual evidence from generic text mastery.
Adapt the journal foundation from PR #1226 and add a read-only mission, handoff and confirmed-record panel. Share its snapshot with turn injection, preserve corrupt files, and serialize worker writes.
Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
* test: pin TZ in runtime_context date assertions for cross-timezone stability
* test: freeze naive FIXED_NOW for cross-platform TZ stability
Rework of 568c522f0 per review: datetime.now() returns a naive datetime,
so .astimezone() only attaches the host zone without shifting the calendar
date. The aware frozen clock made astimezone() convert across zones and
west-of-UTC hosts rendered the previous day. Making FIXED_NOW naive fixes
every timezone on every OS (including Windows) with no TZ env or tzset()
global-state churn; the tz-pinning fixture is reverted as unnecessary.
---------
Co-authored-by: XZH <cto@xzh.ai>
The KB seed searched the raw user message before the loop started, so
answering a card with "A" sent "A" to every attached KB. LightRAG rejects
that as too short, and it's never a useful query anyway. Loop capabilities
can now veto the seed with an optional skip_kb_seed hook; mastery uses it on
card answers and skips. The KBs stay mounted, so the tutor can still call
rag with the actual question.
dev already wires capabilities.visualize into agents.yaml and exposes
it in Settings → Capabilities → Visualize (get_visualize_params /
CapabilitiesSettingsSection), so the budget itself is fixed. The one
thing that shipped with that fix was left generic: when the turn ends
without a committed payload, _NO_PAYLOAD still just says "finished
without a valid canvas payload" with no pointer to the knob that
actually helps when a reasoning model truncates the
submit_visualization call mid-argument.
Name the cause and the fix in both the Python fallback and the en/zh
locale strings.