Commit Graph

77 Commits

Author SHA1 Message Date
Bingxi Zhao
5c1495b3f6 Merge pull request #1513 from evan188199-tech/codex/fix/rag-empty-result
fix(rag): report empty retrieval results (#1500)
2026-09-23 10:24:47 +08:00
Bingxi Zhao (Frank)
1fe74df0ed fix(notebook): decouple evidence from chat sessions (#1519) 2026-09-21 14:50:02 +08:00
Gao-Chenkai
33fa74b5b6 fix(mastery): keep learning evidence bound to objective identity
Replace no longer reuses positional IDs for unrelated waypoints, invalid
questions can be voided or re-keyed, and defer advances the route without
faking mastery.

Fixes #1527

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:23:53 +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)
715e5de592 Merge remote-tracking branch 'origin/dev' into codex/question-pr-1341 2026-09-19 16:11:05 +08:00
XZH
7dde859eaf fix(rag): report empty retrieval results (#1500) 2026-09-18 16:35:55 -07:00
Bingxi Zhao (Frank)
2ad1d45d18 fix(mastery): stop a review session offering to start the topic it is teaching
Clicking "start review" opened a session whose first reply was a card
offering to start a session on that same topic. Clicking it opened another,
which offered the card again — one conversation per click, all on one topic,
some bound to no topic at all (#1412). Those conversations begin with nothing
to quiz against, so they answer in prose; that is the other half of the same
report (#1411).

The generator is a premise the tool states as fact. `mastery_new_session`
stays mounted inside a mastery session on purpose — sending the learner to a
*different* topic mid-course is a real thing to want — and its hand-off
instruction tells the model not to tutor the topic here, because "the mastery
tutor picks up on the other side". Inside that topic's own session there is no
other side, and nothing in the tool's result said so, so the model kept
proposing the trip it was already on.

The turn knows which topic it is tutoring; the tool did not. Binding it the
way the mastery tools already get `_mastery_path_id` lets the tool answer for
itself: a hand-off aimed at the topic this conversation *is* gets refused, with
the instruction to teach the lesson here. A hand-off to any other topic is
untouched, and so is `mastery_open_session` — returning to an older
conversation on the same topic is not a loop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 02:02:53 +08:00
evan188199-tech
9ad83d0630 fix(skills): improve read_skill file recovery (#1347) (#1370)
* fix(skills): distinguish missing skill files

* review: bound the file listing, drop the scolding

Naming a skill's actual files is the right fix — it tells the model the path
it should have asked for instead of leaving it to guess. Two corrections.

`list_skill_files` walks `rglob("*")` with no ceiling, so a skill carrying a
references tree answered a wrong path by reciting its whole inventory into
the turn. Capped at 40, and it says how many it withheld.

"Do NOT try other skill names." was a rule aimed at the model in the middle
of a result. The message already resolves the skill and lists its files, so
the structure says the name was fine and only the path was wrong; the
instruction was restating that in a louder voice.

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

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 01:43:22 +08:00
evan188199-tech
271e4f7865 feat(knowledge): add KB frontier discovery tool (#1292) (#1293)
* feat(knowledge): add KB frontier discovery tool

* review: let agents.yaml own the query-derivation budget

`reason()` falls back to agents.yaml when the caller says nothing, which is
where every LLM budget in this codebase lives. 512 tokens is also the shape
that starves a reasoning model before it emits a single query — it spends the
allowance thinking and returns nothing, which is how #1318 shipped.

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

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 01:43:14 +08:00
ZQR1101
6f72468d86 fix(ask-user): drop an option whose visible text duplicates another (#1409) (#1418)
Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
2026-09-14 01:28:41 +08:00
AoHanBei
eb49228d8f fix(chat): recover hallucinated PDF tool calls for attached sources (#1333)
* fix(chat): recover PDF source tool calls

* fix(runtime): preserve tool alias defaults
2026-09-10 23:44:31 +08:00
Albertanda
08963e29ab fix(geogebra): repair image analysis that crashed before any model call (#1362)
* fix(geogebra): repair image analysis that crashed before any model call

Every invocation of the ``geogebra_analysis`` tool died with a TypeError
before reaching a model: ``_call_vision_llm`` passed a ``verbose=False``
kwarg that ``BaseAgent.stream_llm`` does not accept (the signature has no
``verbose`` parameter and no ``**kwargs`` fallback). Image understanding —
the only path that turns a problem figure into GeoGebra commands — was
therefore broken end to end, in both chat and deep_solve.

Two repairs in the vision solver agent:

* drop the nonexistent ``verbose=`` kwarg so the call reaches the model;
* make ``_extract_json`` tolerate what reasoning vision models actually
  return: a ``<think>`` preamble (e.g. Qwen3-VL-*-Thinking), prose after
  the JSON object, multiple fenced blocks (the last one wins), and bare
  tail JSON. The comment and trailing-comma tolerance of the original
  parser is preserved.

Regression coverage: parametrized ``_extract_json`` cases for the shapes
above, plus a test asserting ``_call_vision_llm`` forwards no ``verbose``
kwarg while still building the multimodal ``image_url`` message.

* fix(geogebra): bound a stalled vision analysis with a 240s timeout

An unbounded ``await agent.process(...)`` lets a stalled provider hang the
whole turn. Reasoning VL models legitimately take minutes on hard figures,
so the bound is generous (240s): it only converts a silent hang into a
loud, actionable failure ("retry, or describe the figure in text") instead
of leaving the learner staring at an empty response.
2026-09-10 23:44:08 +08:00
evan188199-tech
2cefc62a71 fix(skills): distinguish missing file from missing skill in read_skill (#1349)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-10 23:42:09 +08:00
evan188199-tech
9286ede57f fix(visualize): reject fatal GeoGebra Text patterns and surface evalCommand failures (#1346)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-10 23:42:04 +08:00
ZQR1101
ed6b5da1b9 feat(partners): record wrong questions into the question bank (#1244) 2026-09-10 01:48:52 +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
Bingxi Zhao (Frank)
1c918e87a8 Merge pull request #1032 from Zuan0/reading-chat-references
# Conflicts:
#	deeptutor/services/session/source_inventory.py
#	deeptutor/services/session/turn_runtime.py
#	tests/reading/test_turn_wiring.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/context/UnifiedChatContext.tsx
2026-08-31 19:19:38 +08:00
Bingxi Zhao (Frank)
8cfec4e685 Merge pull request #1033 from contributor
# Conflicts:
#	deeptutor/tools/prompting/hints/en/exec.yaml
#	deeptutor/tools/prompting/hints/zh/exec.yaml
2026-08-31 18:36:05 +08:00
Bingxi Zhao (Frank)
3dc372f551 release: v1.6.2 — immersive watching and extensible visualizers
Add synchronized YouTube learning, a plugin-driven visualizer catalog, and Hermes, OpenClaw, and DeepSeek agent harnesses. Refresh Reading, Knowledge, Partner status, guided updates, documentation, translations, and release notes for v1.6.2.
2026-08-31 01:13:07 +08:00
Bingxi Zhao (Frank)
3f3bf0b841 feat(reading): render safe versioned web snapshots 2026-08-30 16:01:40 +08:00
XZH
7615e36bb8 fix(code-execution): preserve deliverable scope and retry discipline 2026-08-30 15:42:32 +08:00
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
Bingxi Zhao (Frank)
d790419548 Merge remote-tracking branch 'origin/dev' into dev 2026-08-29 19:14:40 +08:00
Bingxi Zhao
f3d43d969b Merge pull request #1025 from evan188199-tech/codex/fix/code-execution-file-artifacts 2026-08-29 11:50:04 +08:00
Bingxi Zhao
8e1a6656c5 Merge pull request #1023 from evan188199-tech/codex/fix/mastery-skip-tool 2026-08-29 11:32:09 +08:00
Bingxi Zhao (Frank)
97a4d0eeef feat(reading): add immersive reading workspace 2026-08-28 14:58:48 +08:00
ZQR1101
81e5ff8e3d fix(tools): decode unicode escapes in ask_user payloads
Models sometimes emit literal \\uXXXX runs in ask_user and mastery_quiz tool args. Decode dense non-ASCII runs when building learner-facing payloads so cards do not leak escapes (#973).
2026-08-28 13:21:08 +08:00
zhou2030109-glitch
b342b63b7a fix: align Windows exec runtime and search readiness 2026-08-27 17:17:03 +08:00
Benjamin
e3d8b05c0d feat(reading): add chat section references 2026-08-27 16:15:28 +08:00
XZH
8b24f1ae67 fix(tools): route file generation through code execution 2026-08-26 19:19:54 -07:00
XZH
f5e4b7cd48 fix(mastery): add explicit question recovery exit 2026-08-26 18:57:06 -07:00
zh769394
61a32bd626 fix: improve Windows cross-platform compatibility across runner, tools, and tests
- Guard resource module import in runner server for non-POSIX platforms
- Use POSIX relative path format in ListDirTool for consistent path separators
- Specify UTF-8 encoding in Weixin channel state loading and prompt tests to avoid GBK UnicodeDecodeError
- Use as_posix() in path assertion tests for cross-platform compatibility
2026-08-26 00:29:52 +08:00
john00010
dcbb1d3393 fix(sandbox): support Windows code execution (#964)
* fix(sandbox): support Windows code execution

* refactor(sandbox): vary only the shell clause in the workspace note

The Windows branch duplicated the whole workspace paragraph, so the note
existed in four near-identical copies (zh/en x posix/windows) that would drift
apart on the next edit. Only the "how do I get a script into a file" clause
actually depends on the host shell, so vary that clause and keep one template
per language.

Also prefer `pwsh` (PowerShell 7+) when it is on PATH — it defaults to UTF-8
and is the version still receiving updates; the generated commands are written
in 5.1-compatible syntax, which 7 accepts too. And hoist `import sys` to module
scope now that two methods need it.

Adds the tests this note never had: each host gets the syntax that works there
(a Bash heredoc is a syntax error in PowerShell, and the model would silently
produce no file), and the host-independent half stays byte-identical.

---------

Co-authored-by: Frank <bingxizhao@novix.science>
2026-08-24 16:52:04 +08:00
evan188199-tech
1413cd8ed0 feat(knowledge): add MarginNote 4 as a connected knowledge base (#931)
* feat(marginnote4): add connected KB type, read-only tools, and sync bridge

Add MarginNote 4 as a connected knowledge base type that syncs study data
(notes, excerpts, cards, mindmap nodes) from MN4 via the official Add-on API
into a dedicated SQLite store, then exposes it to the chat loop through seven
read-only tools.

New package: deeptutor/capabilities/marginnote4/
- models.py: MarginNoteObject, SyncBatch, PairedDevice, LearningEvent
- store.py: SQLite CRUD + search + device pairing with hashed tokens
- binding.py: per-turn resolution of the selected MN4 library
- tools.py: search, read, list, documents, links, tags, cards
- capability.py: KnowledgeCapability (exclusive turn ownership)
- prompts/{en,zh}/system.md

HTTP bridge: deeptutor/api/routers/marginnote4.py
- POST /pair (session auth) -- register a device, get one-time token
- POST /sync (device-token auth) -- incremental upsert + tombstones
- POST /heartbeat (device-token auth) -- liveness + object count
- GET /devices, DELETE /devices/{id}, GET /status (session auth)

Integration points:
- kb_types.py: MARGINNOTE4_KB_TYPE added to CONNECTED_KB_TYPES
- manager.py: db_path surfaced in get_metadata allowlist
- registry.py: MarginNoteCapability registered in LOOP_CAPABILITIES
- builtin/__init__.py: MARGINNOTE_TOOL_TYPES in BUILTIN_TOOL_TYPES
- api/main.py: router mounted at /api/v1/marginnote4

Phase 1 scope: device pairing, read-only sync, tool navigation.
Write-back (propose/apply/verify), learning events, and mastery bridge
are planned for Phase 2-3.

Refs: #756 (Obsidian external knowledge source pattern), #180

* fix(marginnote4): search scope, store caching, prompts, KB registration

Testing and experience improvements:

- Search now includes document_title in scope: searching for a textbook
  name returns results instead of zero hits
- Store instances cached by db_path so schema init runs once, not per
  tool call within a turn
- object_type parameters carry enum constraints so the LLM knows valid
  types without guessing
- System prompts (en/zh) rewritten with domain context: explains the
  five object types, link traversal strategy, and citation guidance
- KB registration: register_marginnote4_kb manager method +
  /connect-marginnote4 API endpoint, mirroring the Obsidian connect flow
- Fix indentation inconsistencies in manager.py and main.py
- New tests: document_title search scope, KB registration (create,
  default path, duplicate rejection)

65 tests pass, 0 regressions, ruff clean.

* style(marginnote4): apply repository formatter

* fix(marginnote4): keep MN4 libraries out of the rag_search sweep

``MARGINNOTE4_KB_TYPE`` joined ``CONNECTED_KB_TYPES`` but not
``NON_RETRIEVABLE_KB_TYPES``, so ``supports_rag_retrieval`` answered true
for a library that has no index and no retrieval API — its objects live
in ``mn4_objects`` and are reachable only through the seven
``marginnote_*`` tools. Book's source explorer would have swept it,
gotten nothing back, and reported it as a source with no relevant
content rather than one that needs its own tools.

MN4 belongs with ``obsidian`` and ``subagent``, not with ``linked`` /
``lightrag_server`` / ``ima``, which do resolve to an index or an HTTP
retrieval API. Tests pin both halves of that split, since collapsing it
the other way has cost Book its connected sources before.

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: evan <evan@dazongguandeMac-mini.local>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-21 16:10:22 +08:00
Bingxi Zhao (Frank)
2503c2ccc4 feat(tools): add a question_bank tool so the tutor can file questions
Asking the tutor to group wrong answers had no writable handle on the
bank, so it reached for write_note and the request silently became a
notebook record — the zh write_note hint even listed 错题分析 as a
reason to append. The new tool is name-addressed: organize takes a
category name and creates it when missing, so filing is one call after
one listing. Auto-mounted only when the bank has entries, and both
write_note hints now point categorisation at it.
2026-08-20 01:29:55 +08:00
Bingxi Zhao (Frank)
7c6bcfaef7 release: v1.5.14
Immersive Reading, self-configuration, and a two-way IMA library.

- Immersive Reading: a new capability that opens a document beside the
  thread. New reading engine (PDF pages / slides / page-sized sections),
  five reading tools, a deterministic locate pre-pass that grounds the
  turn without a second LLM call, /api/v1/reading, and a reader pane with
  selection, highlights, notes, and export to an annotated PDF or Markdown.
- Setup capability: inspect the install, apply a setting, install a
  parsing engine, or request a credential from a chat turn. New settings
  spec table; a candidate value is probed before it is committed, and API
  keys never enter the model's context.
- Tencent IMA: pipeline split into transport/envelope/models/sources/
  notes/media/inventory, an additive capability with five tools, and
  connected libraries that can finally be enumerated (bounded listings
  are reported as a lower bound).
- Retrieval: supports_rag_retrieval() replaces is_connected_kb() for the
  "can I sweep this?" question, so linked / lightrag_server / ima sources
  stop being silently dropped from every book.
- Notebooks: their own console at /notebook, per-notebook locks and atomic
  writes, copy / move / export routes, damaged files surfaced instead of
  dropped, and renaming a record no longer clears its knowledge-base link.
- Settings persistence: one lock and one atomic replace shared by every
  writer of interface.json; the PUT endpoints stop writing the
  defaults-merged view back to disk.

Release notes: assets/releases/ver1-5-14.md
2026-08-19 17:34:52 +08:00
Bingxi Zhao (Frank)
96d6df9eb1 release: v1.5.13
Book is the bulk of this one. Compilation outlives the request that
started it, so a bus owned by that request dropped every background event
and "watch your book being written" degraded into a frozen page; the
stream is now owned per book by the process and survives a refresh or a
reconnect. Reading progress is finally recorded — `visited_page_ids` and
`bookmarked_page_ids` had been declared but never written for the life of
the feature — and rolls up into a completion score and weak chapters. A
book can also leave the app now, as one self-contained Markdown document,
with non-ASCII titles surviving the download.

Two scheduling defects that were invisible in production are fixed: the
same page compiled twice concurrently (billed twice, one result
discarded), and a book grinding on through a provider outage until every
chapter was half-generated. The source sweep is bounded and allocated
round-robin rather than spent on the first few knowledge bases, and
retrieval now tells indexed bases from connected pointers, so an Obsidian
vault or a remote IMA library no longer contributes zero while looking
like a source with nothing relevant. Confirming a spine shows a live
per-chapter estimate derived from the Section Architect's own templates.

Also here: three home starter suggestions built from memory recall,
mastery-path handoff moved into one module that changes lease, session
preference, and live turn together, and account-level Tencent IMA
credentials with the per-KB pair still winning.

Notes: assets/releases/ver1-5-13.md

This commit also carries the README prose sync, the eleven translated
READMEs, the release-notes archive sweep, and the version bump. Two gate
fixes ride along: the `Stamped` protocol is declared read-only so the
frozen `EntityStamp` satisfies it, and six GraphRAG adapter tests that
reached a deep `graphrag` import without guarding it now skip like their
four neighbours instead of failing where the extra is not installed.
2026-08-17 11:22:26 +08:00
Bingxi Zhao
4f06aaa070 fix: isolate Partner data per user (#621)
Keep Partner configuration and assets shared while isolating authenticated users’ sessions, relationship memory, search, and media paths. Preserve legacy admin/IM behavior and enforce assignment checks at every access boundary.
2026-08-16 23:00:41 +08:00
Bingxi Zhao (Frank)
f4f2a73b2a feat(search): rebuild the search provider layer and add six providers
Two pieces of work land together because the second is built on the
first: the provider layer was consolidated onto one spec table, then six
new providers were registered against it.

Layer overhaul
- Converge seven separate provider lists (backend registry, runtime
  config, settings router, CLI wizard, frontend catalog, i18n, tests)
  onto a single SEARCH_PROVIDERS spec table; every consumer derives from
  it instead of keeping its own copy.
- Fix three silent defects: serper's `num` never reached the API (it was
  swallowed by **kwargs, so max_results did nothing), serper dropped its
  proxies, and jina had no result-count limit at all.
- A runtime failure (rate limit, timeout, unreachable network) no longer
  fails the whole turn. The request walks the user's other credentialed
  search profiles and finally DuckDuckGo, recording the downgrade under
  a top-level `search_fallback` key so the trace shows what happened.
- Drop three provider modules that were never registered (exa, baidu,
  openrouter). They stay in the deprecated list, so a stale config reads
  as outdated rather than as a misspelled name.

Six new providers
doubao, bocha, zhipu, firecrawl, qianfan, aliyun_iqs — selectable under
Settings > Catalog > Search with their credential fields derived from the
spec table, and offered by `deeptutor init`. All six set
`soft_fallback=False`: five are China-hosted and the DuckDuckGo fallback
is unreachable on those networks, so a missing API key has to fail
loudly instead of silently timing out somewhere else.

Baidu returns as `qianfan` on the official Qianfan API; the old `baidu`
key stays deprecated.
2026-08-13 16:41:39 +08:00
Bingxi Zhao (Frank)
740ec413a0 release: v1.5.7
Per-account MCP Services and CLI Apps — the two ways a deployment plugs in
tools DeepTutor never shipped — plus the isolation that makes them safe on a
shared install.

- MCP Services: a 45-entry curated store of hosted servers each account
  installs for itself, OAuth 2.1 (PKCE + dynamic client registration) for the
  servers that require it, static keys held by reference and resolved in memory
  at connect time, stdio refused for self-service. Settings no longer
  configures MCP; /settings/mcp redirects to the store.
- CLI Apps: 101 tools snapshotted from the two CLI-Anything registries.
  Installs are admin-only, the registry's install_cmd is parsed into an argv we
  build rather than executed, npm install scripts are forced off, and 66
  first-party entries are pinned to one reviewed commit. Apps land in
  data/cli-apps, one environment each, mounted read-only into the runner.
- Credentials that authorise a person move to data/system, the one branch the
  exec sandbox never mounts: Codex tokens relocate themselves on first use
  (refusing to follow a symlink), per-user MCP configs and keys land beside
  them.
- Grants gain a cli_apps whitelist with the same deny-by-default posture as
  MCP tools; a per-turn registry view keeps one owner's provider tools out of
  the process-global registry and refuses an unauthorised tool at execute, not
  just in the manifest.
- The composer reports what filled this turn's context window, a gutter rail
  jumps back through long conversations, and the workspace collapses to a
  drawer on small screens.
- The composer keeps focus after sending and across tab switches (#720);
  released images carry provenance and SBOM attestations (#722).

README prose, all ten translated READMEs, and the docs-site pages that named
Settings → MCP are updated to match. Release notes:
assets/releases/ver1-5-7.md
2026-07-31 00:25:48 +08:00
Bingxi Zhao (Frank)
a43f9fdf2a feat(knowledge): answer "how many files" from an inventory, not retrieval
Asked how many files a knowledge base holds, or whether some document is in
it, the model had only `rag` — and retrieval cannot answer either question:
the passages it returns say nothing about the size of the collection they
came from, so the model guessed from whichever chunks the query happened to
match. PageIndex KBs already answered correctly (their doc list is injected
into the system prompt) and Obsidian vaults have `list_notes`, which makes
this a wiring gap in the default engines rather than a limit of retrieval.

`deeptutor/knowledge/manifest.py` now owns a KB's document inventory as facts
read off disk, with two consumers that cannot disagree:

- the chat system prompt carries a per-KB inventory (count plus a truncated
  name list), so a count costs no tool round-trip — the failure mode where a
  weaker model never emits the call at all (cf. #532). Built once per turn on
  a worker thread, keeping the prompt byte-stable for the whole turn;
- a new `kb_files` tool enumerates on demand with glob / substring filtering,
  mounted under `rag`'s gate (a KB is attached) and deniable per partner the
  same way.

The inventory reports the document set and the KB's index status, and stops
there. It deliberately does not report how many documents reached the index:
every per-file record available is unreliable — LlamaIndex's docstore.json
counts nodes (chunk-level, so it drifts with the chunking config, and costs a
multi-MB parse to read), metadata.json's file_hashes is only written on the
incremental-add path, and last_indexed_count is the last batch's size rather
than a total. A confidently wrong count is worse than none. The prompt block
also states the rule that retrieved passages must never be used to infer how
many documents a KB holds or whether one exists in it.

Connected KBs degrade honestly instead of reporting zero: linked folders and
Obsidian vaults are enumerated in place, while a remote LightRAG server and a
connected subagent are declared unlistable. Hidden OS/editor entries
(.DS_Store, .obsidian/) stop counting as documents, and get_info's
raw_documents reads the same definition, so the KB page and the chat answer
can no longer disagree about the same KB.

Deep Research is untouched: its block loop narrows tools to the four that
produce block-level evidence, and a file list is not evidence for a subtopic.
2026-07-26 22:02:54 +08:00
Bingxi Zhao (Frank)
9f25da9f77 fix(rag): cite what retrieval actually returned (#694)
The `rag` tool reported a single source that was just an echo of its own
query, while `result["sources"]` — the chunks / entities / reports each
pipeline already normalises into DeepTutor's citation shape — was dropped
on the floor. Grounded answers therefore carried no traceable provenance,
unlike web_search / web_fetch / arxiv.

Forward the retrieval's own sources, keeping `type`/`kb_name` on every
entry for existing consumers, and fall back to the query echo only when an
engine surfaces nothing.

Note the local LightRAG pipeline still returns `sources: []` (it keeps only
the synthesised answer from `engine.query`), so #694 stays open for that
engine; GraphRAG and the LightRAG-server pipeline cite properly now.
2026-07-26 20:47:01 +08:00
Bingxi Zhao (Frank)
630041a1cd fix(memory): make write_memory preference add idempotent (#647)
preferences.md is never auto-consolidated, so a repeated identical
write_memory add persisted forever as a duplicate — common in long,
tool-driven mastery turns. write_preference now short-circuits a
duplicate add to a no-op that reports the existing entry, and the tool
returns an explicit 'already saved' signal to the model.
2026-07-24 00:42:28 +08:00
Bingxi Zhao (Frank)
88c2565389 release: v1.4.8
Partners become consultable agents and gain their own memory.

- My Agents now lists your Partners next to local Claude Code / Codex;
  connect one and the turn runs on `consult_subagent` against the
  partner's own chat loop, streaming its trace live. Every consult in a
  DeepTutor chat threads into one archived partner session.
- Partners get a split memory model via three always-on tools that
  replace chat's read_memory/write_memory on partner turns:
  partner_read (owner shared + own), partner_memorize (own only),
  partner_search (own history). The per-Partner memory toggles are gone.
- A `partner:` history reference resolves a partner transcript
  (admin-only) into a DeepTutor chat as third-party context.

Release-prep fixes for a clean CI parity run:
- partner.py: replace mypy-misparsed `# type:` dict-entry comments with
  a proper variable annotation.
- claude_models.py: `# nosec B606 B607` on the PATH-resolved `os.execvp`
  in the forked PTY child (no shell; pre-existed since v1.4.7).

Bump __version__ to 1.4.8, add assets/releases/ver1-4-8.md, README row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 22:16:31 +08:00
Bingxi Zhao (Frank)
7871955ab5 fix:partners & improve my agents 2026-06-18 22:00:59 +08:00
Bingxi Zhao (Frank)
1bf11d13e7 prepare 1.4.7 2026-06-18 00:22:48 +08:00
Bingxi Zhao (Frank)
7ac3a3ba79 release: v1.4.6
A broad consolidation release across four product surfaces.

- Learning Space: Space becomes a learning dashboard; My Agents imports
  local Claude Code / Codex chat history into resumable agents (with an
  objective explore_context briefing so the tutor never role-plays the
  user); Memory is promoted to a top-level /memory route; Partner
  conversations flow into Memory; EduHub skills install inline.
- Knowledge Center: /knowledge rebuilt as a console with per-engine
  detail pages; GraphRAG / PageIndex / LightRAG engines join LlamaIndex;
  linked-KB read-only mounts; Obsidian live-vault capability.
- Settings: pluggable document parsing (MinerU / Docling / MarkItDown)
  with a content-addressed cache and MinerU cloud/local backends; voice
  TTS/STT; image & video generation; rebuilt settings navigation.
- Platform: per-user capability gating by assigned model; Solve rebuilt
  on the chat loop with a per-step gate and mid-run failure fallback;
  username login + inline errors; CLI skill publish/update; picker
  polish; math-before-citation render fix.

Docs were split out to a standalone site, so site/ is now landing-page
only. Bumps __version__ to 1.4.6 and adds assets/releases/ver1-4-6.md.

Folds in mypy fixes surfaced by pre-commit (mineru/local Path typing,
knowledge/manager no-redef, explore_context token kwargs, CLI
set_dist_tag capability probe) plus prettier reformatting of
previously-committed web files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 10:50:44 +08:00
Bingxi Zhao (Frank)
c9d387e2b6 super super great great update 2026-06-17 00:56:27 +08:00