* 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>
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
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
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.
* fix: sync partner tool list with global chat tool toggles
When a user disables a toggleable tool (web_search, brainstorm,
paper_search, reason) in Settings → Chat → Tools, partners
must respect that choice in both the Mind tool picker and at
runtime. Previously the picker showed the full USER_TOGGLEABLE_TOOL_NAMES
pool and defaulted every tool to enabled, and the runtime intersected
only with the partner's own config — so a globally-disabled tool could
still be picked and executed inside a partner.
Changes:
- deeptutor/agents/_shared/tool_composition.py
Add admin_enabled_optional_tools() that reads the admin's
interface.json directly (partners run in a synthetic scope, so
get_enabled_optional_tools() would read the wrong settings file).
Fails open to the full toggleable set on missing/unreadable file.
- deeptutor/api/utils/tool_options.py
build_tool_options() now filters the tools list against
admin_enabled_optional_tools(), so globally-disabled tools do not
appear in the Mind step picker and are excluded from the default
'select all' set.
- deeptutor/services/partners/runtime.py
_resolved_enabled_tools() intersects the partner's configured
(or defaulted) whitelist with admin_enabled_optional_tools(), so a
globally-disabled tool can never run inside a partner turn.
- tests/services/partners/test_partner_runtime.py
Three new tests covering: explicit config intersection, default
config intersection, and fail-open on missing admin settings.
- tests/api/test_partners_router.py
New test verifying tool-options endpoint honors global chat toggles.
Closes: Partner tool picker and runtime drift from global chat tool switches
* fix(pre-commit): apply ruff import sorting
* fix: scope optional tool filtering to partner surfaces
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
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.
Selecting an Obsidian vault (an exclusive KnowledgeCapability) silently
dropped every co-selected LlamaIndex KB: rag was unmounted, unseeded and
unmentioned. Capabilities now declare owned_kbs (the vault / agent refs
they consume via their own tools); the pipeline keeps rag mounted,
seeded and noted for the remaining coexisting KBs, while a pure-vault
turn still mounts nothing but the owned tools + ask_user.
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>
Replaces three bespoke multi-agent pipelines with orchestrators on top
of a shared agentic-engine primitive set (core/agentic/: labeled_step,
loop, tool_dispatch, usage, client). Each capability now lives in one
pipeline.py file with one pipeline.yaml prompt.
- Deep Research: Rephrase (ask_user loop) -> Decompose (OUTLINE) ->
Research blocks (THINK/TOOL/APPEND/FINISH per topic, dynamic queue
preserved) -> Reporting (OUTLINE/INTRO/SECTION/CONCLUSION).
CitationManager and the dynamic topic queue are kept.
- Deep Solve: Pre-retrieve (KB-only, QUERIES/rag/SUMMARY) -> Plan ->
per-step THINK/TOOL/FINISH/REPLAN loop with back-edge to Plan ->
Synthesize. Step FINISH text flows into the next step's context.
- Question: coordinator + pipeline replace generator / idea_agent /
models, with new history.py and mimic_source.py helpers.
Removed: research/agents/, research/research_pipeline.py,
research/prompts/{en,zh}/*.yaml (legacy multi-agent prompts);
solve/agents/, solve/memory/, solve/utils/, main_solver.py,
session_manager.py, tool_runtime.py and old prompts;
question/agents/{generator,idea_agent}.py, example.py, models.py,
old prompts; api/routers/solve.py (capability owns its own routing).
Adds shared agents/_shared/tool_composition.py for cross-pipeline
tool wiring. Updates deep_research/deep_solve/deep_question
capabilities to dispatch through the new pipelines.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>