CallToolTool answered every unforwarded call with "load it first". That
was wrong for a tool already in tools[] (an MCP tool, a built-in) and for
malformed arguments, and for the former it sent the model round in a
loop. DeferredToolLoader.proxy_refusal now names the reason (missing
name, call_tool itself, already in the tool list, proxy off, unknown,
not loaded) and proxy_arguments checks the arguments: an object, or a
string holding valid JSON for one; anything else is refused. The
pipeline's _resolve_proxied_tool_calls and CallToolTool both go through
proxy_call_refusal, so the message matches the decision.
Setup tools loaded through load_tools are proxied. Opening setup mode
later left them proxied: not in tools[], no rules (already loaded), and
a note that never mentioned call_tool. An opened mode's tools are now
made native, like mastery's outline tools; a setup turn whose tools are
still proxied gets a hint to reach them through call_tool.
Also: call_tool is mounted only when the loader has built-in/capability
tools to proxy; its manifest order no longer duplicates load_tools'; a
forwarded call without an id is not marked for renaming.
Refs #2972
load_tools appended the loaded schema to the end of tools[]. tools[] is the
first thing in the provider's prompt-cache key, so the next request of the
same turn re-processed the system prompt and the whole history.
When the turn mounts the new call_tool builtin, load_tools now returns the
loaded tools' definitions in its result and leaves tools[] alone; the loop
forwards each call_tool call to the named tool before dispatch, so the tool
runs with its own argument checks, injected kwargs and trace, while the
history keeps the model's own call. Tools loaded this way stay proxied for
the session (loaded_tools.json gains proxied_tools). Runtime loads that must
land in tools[] pass native=True; the TypeScript engine keeps the old
behaviour.
The docstring still said pipelines pass state_turn_path=True to embed
the turn folder. After the deep_question and deep_research changes no
caller does: every system prompt that uses the note is a cached prefix,
and the exact folder goes to the user message.
Refs #2974
The chat loop replays the workspace note as the "workspace" runtime
snapshot, which lives inside the cached prompt prefix. The note embedded
workspace.logical_output_dir — outputs/chat/<session>/<turn>/ — so its
bytes changed on every turn: the snapshot-replace logic cut the old copy
out of the middle of the rebuilt history and appended a fresh one,
invalidating the provider prompt cache on every multi-turn request
(cached-token hit rate <1%; single-turn tool loops were unaffected).
- workspace_system_note(state_turn_path=False) keeps the replayed chat
snapshot byte-identical for the whole session and points at the current
user message for the exact path instead.
- new workspace_turn_note() delivers the per-turn output folder in the
trailing user message — fresh bytes each turn, so cache-safe by
construction.
- phase-built prompts (question/research pipelines) keep embedding the
exact path via the default state_turn_path=True; their behavior is
unchanged.
- model-history reconstruction keeps an exact prefix once snapshots are
stable; new multi-turn replay tests assert byte-level prefix extension
across three consecutive turns, plus the second factor named in the
issue turns out to be a consequence of the turn-scoped snapshot and
needs no separate change.
Verified: tests/agents/chat 273 passed; tests/capabilities 739 passed;
tests/services/workspace+session 709 passed (8 failures pre-exist on the
clean tree and are unrelated); remaining tests/agents failures pre-exist.
Exclusive knowledge capabilities (obsidian, marginnote4, subagent) dropped
the whole chat built-in surface, including web_search (still shown on in
settings) and the always-on web_fetch. Add a coexisting_tools declaration
to KnowledgeCapability (default empty; the product KBs declare the web
pair), honoured in compose_enabled_tools' exclusive branch under each
tool's usual gate (user toggle / always-on / conditional flag) and the
partner builtin_whitelist, mirroring the #650 KB coexistence. The
capability's system prompt now also names what actually mounted via
coexisting_tools_block, so the model no longer disclaims mounted tools.
Fixes#2612
Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
Add rich text and learning blocks, media uploads, page trees, and revisioned notebook storage. Present AI suggestions at their target blocks with durable accept and dismiss actions.
Unify saved outputs as Favorites with typed expandable blocks, stable source links, atomic batch insertion, nesting, dragging, and undo/redo.
Validation: 99 frontend tests and 99 backend tests pass in an isolated snapshot, along with TypeScript, scoped ESLint, dependency architecture, and locale parity checks.
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>
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.
* 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>