31 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
e347c0c2e0 fix: preserve tutoring replies and stabilize preview runtime
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.
2026-10-27 17:58:46 +08:00
Bingxi Zhao (Frank)
6bbcc00c55 Merge dev into preview, preserving preview features
Integrate dev fixes with preview's Python/TypeScript schedulers, chat queue, learning navigation, and live turn persistence.
2026-10-27 01:16:58 +08:00
Bingxi Zhao (Frank)
1497994c9f Merge PR #1938: bound tutoring history and retain exact recall when condensation fails 2026-10-19 00:57:48 +08:00
Bingxi Zhao (Frank)
9aae961412 Merge PR #1957: separate private source evidence from explicit public presentation 2026-10-19 00:53:44 +08:00
Bingxi Zhao (Frank)
3196b6d792 Merge PR #1954: prepare source evidence through a generic capability prerequisite contract 2026-10-19 00:48:43 +08:00
Bingxi Zhao (Frank)
ba899ffc68 Merge PR #1939: review outline changes before atomic commit 2026-10-19 00:38:00 +08:00
Bingxi Zhao (Frank)
e8c0b1eed5 Merge PR #1962: count complete projected requests in context guard 2026-10-19 00:31:25 +08:00
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
wangkai
87a0317255 feat(agent-loop): let a context checkpoint carry replaceable state
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.
2026-10-15 13:00:03 +08:00
Bingxi Zhao
0e784d5080 Merge pull request #1910 from YizukiAme/codex/fix-1909-image-compaction
fix(session): budget projected image replay before compaction
2026-10-15 03:23:49 +08:00
cgycorey
8df56e7dfe fix(agents): count the full request in the context-window guard
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
2026-10-14 10:18:59 +01:00
yepyhun
755686264d fix(mastery): separate source inspection from assessment delivery 2026-10-13 13:49:35 +02:00
yepyhun
3175b812e2 fix(mastery): make source delivery demand-driven and preserve partial teaching 2026-10-13 12:33:44 +02:00
yepyhun
c510b13363 feat(mastery): add reviewed outline previews and retry-safe commits 2026-10-12 11:23:32 +02:00
yepyhun
499e6bc75f feat(mastery): bound tutoring memory with exact branch recall 2026-10-12 11:16:34 +02:00
Fancie-Personal
4826ae980a fix(agent-loop): keep content parts when appending a loop directive
`_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.
2026-10-11 20:12:57 +08:00
YizukiAme
e747f28705 fix(session): budget projected image replay before compaction 2026-10-10 00:33:40 +08:00
Bingxi Zhao (Frank)
2350ea2dba feat(mastery): complete source-grounded visual practice and evidence (#1611)
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.
2026-10-08 05:25:05 +08:00
Bingxi Zhao (Frank)
081c9e6d98 fix(chat): bound cold-start stream waits and avoid nested retries (#1421) 2026-10-08 00:00:30 +08:00
Bingxi Zhao (Frank)
2ccd8a75fb fix(mastery): deliver retrieved source images through the active agent loop (#1611) 2026-10-07 23:17:15 +08:00
ZyPulse
f3b840ce46 perf(llm): deduplicate repeated inline user images per request (#1714)
* perf(llm): deduplicate repeated inline user images per request

* fix(llm): preserve image fallback and stable replay references
2026-10-07 20:18:56 +08:00
Bingxi Zhao (Frank)
eabc17d79f release: v1.6.10
Native LightRAG role models: extraction, keyword, query and vision each
resolve their own model, vision indexing pins a vision-capable model
instead of silently degrading, and a knowledge base records which models
and which embedding built it. A published index refuses queries after its
embedding identity changes rather than searching a foreign vector space,
and a rebuild is confirmed against the configuration it will actually
use — a stale confirmation is rejected instead of quietly rebuilding
something else. A failed publication is withdrawn, not left half-written.

PDF attachments follow the parsing engine configured for the workspace,
report the stage they are in, and a truncated answer says it was
truncated with the counters that prove it. Providers are no longer
filtered out of the embedding picker on an unverifiable capability guess:
configure the model and test it. Visualize's temperature and token budget
are settings rather than literals. Notebook evidence no longer depends on
the chat session that produced it.

See assets/releases/ver1-6-10.md for the full notes, and the README
translations for the propagated prose.
2026-09-22 21:36:27 +08:00
Wubian111
ead57a7b2e fix: require selected mastery quizzes to complete delivery 2026-09-21 10:26:31 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
Bingxi Zhao (Frank)
42d793839b Merge branch 'dev' into worktree-chat-engine-interleaved 2026-09-15 13:25:06 +08:00
Gao Chenkai
3192757d45 fix: handle DeepSeek reasoning budget exhaustion (#1331)
* fix: handle DeepSeek reasoning budget exhaustion

* style: satisfy ruff format, the one thing CI was red on

`ruff format --check` on agent_loop.py, the Responses parser and the test
file that came with them. No behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 01:43:40 +08:00
evan188199-tech
24d3db124c fix(agent-loop): recover bounded reasoning-only finishes (#1402)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-14 01:32:58 +08:00
Bingxi Zhao (Frank)
541b7f4f16 feat(chat): let a turn read as a running account instead of an answer with hidden working
Every round already streamed its text to the reader. The loop then took it
back: a round that called tools was marked narration, and the client moved
that prose out of the answer and into a collapsed block pinned to the top of
the message. The reader watched a sentence appear and vanish, and what was
left was an answer with no account of how it was reached.

That behaviour came from one field doing two jobs. ``call_role`` said both
where the turn was and whether the text counted, so "more work follows" and
"hide this" could not be told apart — and three separate exceptions had grown
to say "actually, show this one" for DSML, truncation and mastery.

Split the two facts. ``call_role`` keeps the phase. A new ``answer_visible``
carries visibility, true for every ordinary round, false only where a
capability's finish guard retracts a round it rejected. The three exceptions
disappear with the default they were fighting.

The client then lays the message out in the order it was written: the sentence
that introduced a step, the step's own row beneath it, what the next round
said below that. A settled turn is restored from an event preview that carries
no text, so tool calls now record how much of the answer had been written when
they ran, and the stored body is laid back out around them.

The prompt asks for the commentary this depends on, and says the closing
answer should not replay it.
2026-09-11 16:49:40 +08:00
Bingxi Zhao (Frank)
a3ff561cca fix(errors): finish the sweep for failure notices that hide their cause
#1356 was reported as "retrieval hides embedding connectivity failures".
The adapter had always raised a ConnectionError naming the endpoint and
the remedy; the text was discarded a layer above, where the template had
no placeholder to put it in. 4e816d79 converged the tool-dispatch half.
This is the audit for the rest of it.

Two scans, both over the AST rather than by eye: handlers that raise or
return a generic literal without touching the exception they caught, and
handlers that log the cause but hand the user a literal. The result is
smaller than expected and worth recording — the codebase is mostly
honest here, and the sites that do hide a cause almost all do it on
purpose. `knowledge.py` refuses to echo an upstream message from a
credential-bearing flow, and says so at the site; WeCom onboarding does
the same. Those stay.

Three did not have a reason:

* the agent loop's forced finish told the reader "a step failed" while
  the caller was logging the exception on the line above;
* the question pipeline's tool summarizer did the same, in the same
  shape, two lines apart;
* the update check turned every transport failure into "Unable to check
  for updates", which cannot distinguish being offline from a proxy that
  blocks github.com. The release URL is public and carries no
  credentials, so there was nothing to protect.

All three now carry what they already knew, through the same `{error}`
placeholder 4e816d79 established, in both locales.

The test is the durable half. A key the runtime formats with a cause must
have a slot for it in every locale that defines it — the exact drift that
let #1356 ship, where the code passed a cause the template could not
accept and nothing complained.

6925 passed, 24 skipped.
2026-09-11 12:43:41 +08:00
Bingxi Zhao (Frank)
a531e650f7 fix(llm): say why a self-hosted model endpoint refused the connection
Pointing DeepTutor at a local Ollama and getting it wrong produces
"Unable to reach the model provider. Please retry." in the UI and a bare
`httpcore.ConnectError: All connection attempts failed` in the log.
Neither says what to do, and the two ways this fails need opposite
fixes: nothing is listening on the address, or DeepTutor is inside a
container where `localhost` is the container rather than the machine
serving the model.

`unreachable_endpoint_hint` names which. It stays silent for a cloud
endpoint — there "please retry" really is the whole story — and for a
loopback address inside a container it points at
`host.docker.internal`, the answer CONTAINERIZATION.md already
documents but that nobody reads at the moment they need it. An address
that is already the host gateway gets the "start the server" advice
instead, not advice to use the gateway it is using.

Appended only when the round produced no output: an interrupted answer
is a different failure and the endpoint is demonstrably reachable.
2026-09-10 22:51:08 +08:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00