80 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
9233a71cb4 fix(update): bound restart readiness and document legacy recovery 2026-11-15 01:04:25 +08:00
Bingxi Zhao (Frank)
e885120cf6 fix(runtime): preserve live turns owned by another local process
Local dev repairs for #2168, #2631.

Real child-process recovery: 16 tests passed, including queued, running, waiting_input, process exit and PID reuse. Existing coordination/application tests: 65 passed, 10 optional Redis skips.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
ebd0f11083 Merge PR #2605: fix(mastery): let a new reply supersede an ungraded clarification 2026-11-14 22:58:03 +08:00
Bingxi Zhao (Frank)
42d29e38fa Merge PR #2504: fix(runtime): recognize framework Python orphan backends on macOS 2026-11-14 22:49:40 +08:00
AleFlyX
1e86d251bd fix(dispatch): reserve _working_brief, an injected flag the list missed
`mastery_status` receives `_working_brief` from the mastery loop
(capabilities/mastery/loop.py:436) and reads it as a trusted switch for
whether to project the working brief (capabilities/mastery/tools.py:915).
It was not in RESERVED_ARGUMENT_NAMES, so a model could send
`_working_brief: false` and the tool would honour it.

Same class as `_learner_message`: an injected name treated as fact while
the model can write it. Caught on a later audit pass rather than by any
test, which is the argument for the follow-up in #2610.
2026-11-11 08:49:06 +08:00
AleFlyX
f982ef6102 style: apply ruff format to the dispatch regression tests 2026-11-11 08:44:10 +08:00
AleFlyX
636f522b43 fix(dispatch): withhold the arguments the runtime owns
`_`-prefixed names reach tools as provenance: `_learner_message` is the
learner's own words, `_sandbox_mounts` is where the turn may write,
`_turn_id` is which turn produced the call. A few of them gate credit or
sandbox access.

Nothing enforced that on the way in. A model emits arbitrary JSON and the
dispatch path never rejected a name it did not expect, so a model could
write `_learner_message` itself and have a built-in tool believe it. That
is how `mastery_grade` came to accept a model-authored answer as grounds
to overwrite a committed learner answer (#2595).

Withhold a fixed list of the names the runtime injects, at bind time,
before the augmenter runs. Adapter arguments outside that list are left
alone, so an MCP server publishing `_id` keeps working.

Also record the filtered arguments rather than the raw JSON. `_rebind`
replays the recording straight into the augmenter, so keeping the raw one
let any round containing a rebinding tool — `ask_user` and
`workspace_export` always qualify — re-admit a forged name the first bind
had already dropped.
2026-11-11 08:28:10 +08:00
Tazeem Mahashin
08fac21468 fix(runtime): pin backend imports to the launcher installation 2026-11-06 13:26:44 -05:00
Tazeem Mahashin
3f1610632b fix(runtime): recognize framework Python orphan backends on macOS 2026-11-06 12:15:10 -05:00
evan188199-tech
857bc6f6ad fix(workspace): conservatively clear dead migration markers (#2390) 2026-11-06 02:27:50 +08:00
Bingxi Zhao (Frank)
823aa1a8b3 Validate launcher, retrieval, migration, and responsive reader behavior 2026-11-06 02:04:53 +08:00
Bingxi Zhao (Frank)
79e726efb3 Merge #2435 from mathewgeejo 2026-11-06 02:04:52 +08:00
Bingxi Zhao (Frank)
b837217cb5 Merge #2357 from Antonio-Faure 2026-11-06 01:56:24 +08:00
mathewgeejo
b9756c6126 fix: keep detached Windows venv launchers hidden
Use CREATE_NO_WINDOW so the venv redirector interpreter inherits a hidden console. Preserve the separate process group and update the Windows launch regression. Fixes #2421.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 23:51:45 +05:30
Antonio-Faure
56073ebb75 test(update): compare package specs, not the interpreter path 2026-11-03 09:11:22 +01:00
Antonio-Faure
c7f203d594 fix(update): record a restart that never becomes ready 2026-11-02 09:12:32 +01:00
Antonio-Faure
f39b5d1c1f fix(update): keep installed modules on the target version 2026-11-02 08:44:04 +01:00
yert
edb205369a fix: preserve Redis event JSON arrays and tolerate legacy artifacts 2026-11-02 02:51:36 +00:00
Bingxi Zhao (Frank)
01d7c0ed55 feat: add conversational creation drafts and refresh local dev UI 2026-10-29 18:11:52 +08:00
Bingxi Zhao (Frank)
756baa7deb Merge commit 'ce333434c31a84dac85d5d9cf1737bdd66e7a556' into HEAD 2026-10-27 22:23:08 +08:00
Bingxi Zhao (Frank)
ce333434c3 fix: reap failed engine workers before notifying callers 2026-10-27 22:22:06 +08:00
Bingxi Zhao (Frank)
24dc13bb6b Merge commit '80a7dc2b348108d9bcef6c50078d74f398d9d381' into HEAD 2026-10-27 22:02:45 +08:00
Bingxi Zhao (Frank)
80a7dc2b34 test: keep dev CI contracts robust to formatting and worker startup 2026-10-27 22:00:54 +08:00
Bingxi Zhao (Frank)
1526d1a91d Merge remote-tracking branch 'origin/dev' into HEAD 2026-10-27 21:38:53 +08:00
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)
bf024d85d1 fix(ci): refresh preview route and locale contracts 2026-10-27 01:52:06 +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
AleFlyX
9b721a71d2 fix(runtime): 自动回收工作进程重启后遗留的轮次
变更:
- 内存协调模式从持久化记录发现无主轮次,并复核租约保护活跃执行
- 先以状态和 fencing token 完成失败转换,再持久化并发布连续编号的终态事件
- 增加重启恢复、活跃租约保护、竞争处理及 Redis 事件保留回归测试

验证:
- 相关协调、后台恢复、应用及订阅测试:101 项 PASS,含四 worker/1000 轮次压力测试
- 新增 Redis 恢复用例后的定向复测:14 项 PASS,与上述范围重叠
- 修改文件的适用 pre-commit 检查、架构检查、git diff --check:PASS
- Chromium SIGKILL 实测:无需刷新或新提交,自动显示失败和重试入口
- 用户在独立测试实例复测:旧轮次自动标记 worker_lost,前端显示重试

Fixes #2034
2026-10-23 16:26:01 +08:00
Bingxi Zhao (Frank)
e28c803636 fix(runtime): persist live prefixes and reclaim completed streams (#1971) 2026-10-19 03:29:21 +08:00
Bingxi Zhao (Frank)
3a3cb277c1 fix(runtime): localize incomplete turn notices 2026-10-19 00:33:38 +08:00
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
yepyhun
f8fa061759 test: reproduce incomplete capability reported as completed 2026-10-13 13:22:12 +02:00
Bingxi Zhao (Frank)
b7904fef3a fix(launcher): reclaim verified orphaned listeners on supervised restart (#1795) 2026-10-07 23:23:43 +08:00
Bingxi Zhao (Frank)
3b672dac89 Isolate sidebar auth fixtures and verify shared runtime home reset 2026-10-07 20:58:20 +08:00
evan188199-tech
3a192f6a53 fix(runtime): log swallowed launcher, init and update-worker failures (#1704)
* fix: log singleton reset failures instead of swallowing them

_reset_runtime_singletons() (deeptutor_cli/init_cmd.py and
deeptutor/runtime/launcher.py) swallowed every exception while dropping
cached PathService/RuntimeSettings/ModelCatalog singletons. A failed
PathService reset leaves the previous home's cached paths in place, so
deeptutor init --home / launcher start silently keep writing into the
old workspace. Log PathService failures at ERROR and cache-clear
failures at WARNING so the misdirection is observable.

* fix(launcher): log handoff failure when mark_failed fails too

_handoff_pending_update wrapped the fallback store.mark_failed in a bare
'except Exception: pass'. When the handoff itself failed and recording
the failure failed again (corrupt state, IO error), the launcher shut
down with no persistent trace of either error. Keep the minimal fix:
emit a fallback log naming the update job, the handoff error and the
recording error before returning False.

* fix(update): log and skip recovery when job state is unreadable

The update worker's recovery path wrapped store.load() in a bare
except-pass: with a corrupt state.json the failed-update bookkeeping and
the app restore were skipped silently, leaving the job stuck and no
trace in worker.log. Load failures now append a durable record (load
error plus the original failure) to the store log and skip the round
without touching the damaged state.

* 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:37:37 +08:00
evan188199-tech
6c5a6fa1c9 fix(runtime): surface launcher termination and port-kill signal failures (#1715)
_terminate and _kill_port_listeners wrapped every tree signal in
bare except-pass blocks, so a child or port listener the signals could
not reach survived shutdown with no log line to trace: zombie children
and occupied ports after restart, with nothing to investigate.

Signal delivery now goes through _signal_target, which logs each
failure at WARNING with its cause; the SIGTERM -> wait -> SIGKILL
ladder and its timeouts are unchanged. A target that is already gone
is not a failure: ESRCH from os.kill/os.killpg is treated as
terminated, and on Windows _send_tree_signal now checks taskkill's
exit code, staying quiet for its "process not found" (128) while
raising for real failures such as access denied, so the Windows path
is observable too.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:23:04 +08:00
evan188199-tech
4be54e8a9f test(launcher): cover lifecycle termination, port cleanup and marker corruption paths (#1769)
* test(launcher): cover lifecycle termination, port cleanup and marker corruption paths

* style(tests): sort imports in test_launcher_lifecycle to satisfy ruff I001

---------

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:14:37 +08:00
OrdoAbChao7
8b03d2ab56 fix: tolerate process probe decoding errors and avoid spurious LLM retries 2026-10-03 12:38:47 +08:00
Bingxi Zhao (Frank)
55b1b14769 test(update): isolate positive flows from runner systemd service 2026-09-27 11:38:29 +08:00
Bingxi Zhao (Frank)
e02c82bdf0 fix(update): refuse in-app handoff inside systemd services (#1555) 2026-09-27 04:52:21 +08:00
Bingxi Zhao (Frank)
9540d38a71 test(runtime): cover proxied loopback health checks 2026-09-23 10:41:55 +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
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
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
Hyeonsang Cho
3fab0de80d fix(runtime): cancel the capability when a turn's consumer stops (#1413)
`ChatOrchestrator.handle()` runs the capability in its own task and only
reads the bus, so a consumer that stopped reading never reached that
task. Pressing Stop persisted the turn as cancelled while the capability
kept calling the model and running tools until it finished on its own.
A capability parked on `ask_user` was never cancelled at all: once the
turn dropped its references it was destroyed mid-await, `_run`'s cleanup
failed before `unregister_bus`, and the turn's StreamBus stayed in the
registry for the life of the process.

Cancel and await the capability task in a `finally` around the
consumption loop, the same shape `llm.factory.stream()` already uses, so
both a cancelled consumer and a stream closed early take the capability
down with them. A normal turn is unaffected: its task has finished by
the time the loop ends.
2026-09-14 01:28:23 +08:00
evan188199-tech
4c2428db09 fix(api): preserve actual proxy peer identity (#1426) (#1427)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-14 01:28:09 +08:00
Bingxi Zhao (Frank)
883c90f2cc fix(launcher): stop killing a backend that is still starting
The readiness wait was a constant. 60 seconds is generous on a laptop and
short on an ARM board with a workspace to migrate: one reporter measured
78 seconds from spawn to `Application startup complete`, so the launcher
terminated a healthy child mid-initialisation, systemd restarted it, and
it hit the same wall again (#1435). Nothing about that is a property of
the product — it is a property of the machine.

`DEEPTUTOR_BACKEND_READY_TIMEOUT` and `DEEPTUTOR_FRONTEND_READY_TIMEOUT`
set it per deployment; absent, unparseable or non-positive values keep the
current 60 / 120, so an existing install starts byte-identically.

The failure text carries the remedy now. "Backend did not become ready
within 60s" is true and useless — it named a number the reader had no way
to change, in both locales.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 20:38:50 +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
Bingxi Zhao (Frank)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00