The last piece of #866. #899 stopped a linked folder's subdirectories from
collapsing, and same-named documents no longer overwrite or vanish — but the
reporter's actual workflow still could not rebuild his tree. He added one
subtree at a time, and a browser folder pick reports each file's path
relative to the chosen directory: `应用开发/钉钉CLI/` arrives as
`钉钉CLI/...`, with no way to say it belongs under `应用开发/`. Every batch
piled up at the KB root, and the ancestor was not missing data — it was
never in the payload.
Uploads now take an optional destination folder, composed ahead of each
file's own relative path. The picker offers the KB's existing folders (and
its root, the default) once files are staged, so batching a large tree is a
matter of picking where each part goes. It runs through the same
_sanitize_rel_subdir guard as a directory upload's own path, so a crafted
value cannot escape raw/.
Listing folders is best-effort: if that call fails the picker simply does
not appear and the batch goes to the root exactly as before.
Linked-folder sync keeps its own root-relative staging and does not take a
destination prefix yet — that needs the prefix persisted per linked folder
in metadata, which is a separate change.
#923 fixed the blank transcript in #912 — an orphaned message tree. The
same report's other screenshot is a different failure that survived it: the
overlay stuck on "Loading conversation / Still loading…" with the request
already answered in devtools.
Two paths led there, and both told the user their history was gone:
* The wait was unbounded ("the overlay stays until the API responds (no
timeout)"). A fetch that never settled span forever, and the only exit was
✕ — which abandons the conversation. The wait is now bounded, and the 8s
hint is no longer the last thing that ever happens.
* A cold open that *failed* ran router.replace("/home"), dropping the
session id from the URL. A transient error was indistinguishable from a
lost conversation, and the id needed to retry was gone.
Both now end in one terminal, retryable state with the id still in the URL:
the overlay shows the failure and a Retry, ✕ still means "leave". A failed
background revalidate is unchanged — the cached transcript stays on screen
rather than being replaced by an error.
Which of the three aborts counts as a failure is the whole subtlety (a
newer load and the user's ✕ own the state that replaces this one; a timeout
owns nothing), so that decision lives in a tested predicate rather than
inline in the component.
eslint is not one of CI's gates, so #921 merged with three errors in it. Two
were real:
* ``useMarkdown`` is a pure predicate, but the ``use`` prefix made it read as a
hook and calling it inside the message map tripped
react-hooks/rules-of-hooks. Renamed to ``rendersMarkdown``.
* The connect effect called ``setConnected(false)`` synchronously. It runs once
on mount, ``connected`` already starts false, and the client's own onClose
clears it — so the call did nothing but cascade a render.
`npx eslint .` is now clean of errors (79 pre-existing i18n literal warnings
remain).
Adds PageIndex OSS as a knowledge-base type and moves PageIndex retrieval from traditional RAG to reasoning-based retrieval: a small workflow-owned agent loop reads the document tree instead of going through the built-in MCP server, which this removes.
Scope stale-page detection to the KB documents that actually changed, and refuse to clear a drift warning while flagged pages are still awaiting recompilation (force=true overrides, since detection over-marks by design). One walk over raw/ per check, and a fingerprint-scheme tag so changing the formula re-baselines instead of marking every existing book stale.
Adds a /whisper workspace page (seat switch, room_id from the stream, trainee-only whisper/debrief) over the existing unified-ws with capability + config.room_id, and lets a capability publish a body and declared extras on CAPABILITY_COMPLETE via context.metadata['agent_output'] / ['event_metadata'] — capability, session_id and turn_id stay unspoofable.
Persist captured reading segments per book under learning_captures.json with an explicit status lifecycle, so selections can be reviewed before any downstream export. Follows the existing book storage conventions: a path_service seam, atomic writes, and per-row validation that skips bad entries instead of failing the read.
#923 inlined 25 lines of orphan detection into the middle of
buildVisiblePath, between "group by parent" and "walk". Extract it as
walkStartKey() so the function reads as its three steps again; behaviour and
the #912 regression tests are unchanged.
Follow-up to #845. Tika is remote-only: files are sent to a configured tika-server via PUT /tika and the extracted text is written as Markdown, so no local install or model download is needed.
Fixes#912. Deleting a turn left descendants pointing at deleted rows, so the session lost its root and rendered a blank page. Splice deleted rows out of the parent-pointer tree on delete, and let buildVisiblePath recover already-corrupted sessions from their oldest orphan.
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
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.
Changing the model-output language made the whole block vanish. Two causes,
and the second is the more interesting one.
The cache is keyed by language, so a switch correctly invalidates it and the
read returns nothing — but the background regeneration that would refill it was
being swallowed by the probe throttle. That interval exists because page loads
arrive in bursts and the material rarely changes between them; it is exactly
wrong when the caller already knows the cached set is unusable. A read that
finds a cache in another language now forces the probe past the interval. The
in-flight guard still applies, so forcing cannot fan out concurrent calls.
The deeper problem is that "no lines" rendered as "no slot". Every way this can
come up empty — cold cache, failed model call, re-reads that timed out, a
language just switched, no history at all — produced an identical blank space
with no way to act on it. The component now always renders its control once the
first read lands: a spinner with "finding what to explore next" while work is
in flight, and an explicit "suggest what to explore next" button whenever it is
not, which generates synchronously on click. When that returns nothing because
there is genuinely nothing to draw on, it says so rather than looking broken.
This is not the generic fallback copy that was removed earlier — that was
filler pretending to be a suggestion. This is a button that says what it does.
Two inputs, which is what this always should have been.
**L3.** The consolidated read on the learner — and in particular the
familiar/practising/unsure split in ``scope`` — is the single most useful thing
to know when proposing what to look at next, and it was not being read at all.
Now rendered through the memory parser (so footnote markers and their HTML
comments never reach the prompt) and bounded, with each slot's unspent budget
carried to the next: ``preferences`` is two lines, and its leftover is what
lets ``scope`` be shown in full. Section names pass through untranslated
because the consolidator writes them in the deployment's own language
("不确定" / "Unsure") and reading them is exactly the model's job.
**The last k activities, flat.** The per-surface quota and round-robin are
gone. What someone touched most recently is the signal; which surface it
happened on says nothing about whether they are in the middle of it. Noise is
still dropped, but now *before* the cut rather than after — placeholder titles
are the newest rows by definition, so "take k then filter" returns nothing on
an install where someone just opened three blank chats.
k defaults to 20 and is adjustable in Settings → Chat → Starting points. Per
user, not admin-gated: it changes the size of one prompt built from the
caller's own memory, not a resource anyone else shares.
**Language comes from the setting, not the caller.** The endpoint no longer
takes a language parameter; the service reads the learner's model-output
setting (Settings → Appearance), the same one the chat agent answers in. The
UI locale could resolve before settings loaded, and with one cache per user the
two would overwrite each other on every visit. This also retires the
scope+language throttle key — there is one language now, so one key.
On a real install this took the material from 5 traces to 18 plus 6k of
profile, and the proposals from "DeepTutor 这种 AI 助教如何实现启发式引导" to
"LangGraph 状态共享与竞争条件处理".
Found on a real install with 20+ sessions, where the slot stayed empty.
**A failed generation was cached as an answer.** One call failed shortly after
boot; the empty result was written with the fingerprint of the material it
failed on. The background pass then saw "fresh, and the material has not
changed" and skipped every retry — six hours of empty slot from one timeout.
An empty result is now only saved when it is the right answer (no material to
work from); an empty result produced despite having material is dropped, so
the next visit retries. Collecting the material once and passing it down is
what makes that distinction available.
**The throttle swallowed the language switch.** The component asked before
i18n settled, which resolves to "en" for everyone, so the cache was built in
English. The Chinese UI then asked for "zh", got nothing (a cached set in one
language is not an answer for another), and its background pass was throttled
behind the English one — for the whole interval, with a perfectly fresh cache
sitting there unusable. The throttle is now keyed by scope *and* language, and
the component waits for i18n's ready flag rather than guessing.
**The material was mostly noise.** A week's lookback plus label dedup left one
usable trace out of twenty sessions; the other two slots went to knowledge
bases the user had named "q" and "q2". Now: 30 days (dedup and per-surface caps
already bound the list, so a longer window means depth, not length), labels
under 3 chars dropped, placeholder titles dropped — those are the *newest* rows
by definition, so they were taking the budget from named work — and the brief
tells the model to skip the noise it still sees rather than build on it.
Also: the single delayed re-read assumed a model answers within 3.5s. A cold
provider does not, and the first visit is exactly when nothing is cached. Four
spaced attempts, stopping as soon as something lands.
The previous brief still produced lines that pointed *at* the traces —
"Redo the two eigenvalue questions you missed", "Pick up where Agentic RAG
retrieval left off". Those restate what the learner already knows they did.
They propose nothing to understand.
What earns a click is one step further out: read the traces for the *subject*
behind them, then name something specific about that subject worth
understanding. Same root, one jump.
Trace: [conversation, 2d ago] Agentic RAG retrieval flow
now: "How agentic RAG differs from naive RAG"
was: "Continue the Agentic RAG conversation" <- restates the trace
also bad: "Explore retrieval" <- a field, not a question
The brief now leads with that jump, shows it worked both ways, and asks for
three different *kinds* of question (a distinction, a mechanism, a why, a
boundary case) so the three do not collapse into one shape. The floor is
unchanged and still explicit: one step beyond a trace is the point, a subject
with no root in the material is invention.
The fixed fallback is gone. Its three lines named activities — exactly what
the brief now calls failure — and more importantly the whole value of this
slot is that it is about *this* learner's material; generic copy sitting there
teaches people to stop reading it. With nothing in memory, the component
renders nothing and the home screen looks as it did before. That also drops
the fixed/generated split and its i18n keys: everything rendered here is now
generated, so nothing in it goes through the translation table.
Two problems with the first pass, and they were the same problem.
The copy named activities, not subjects. "Explain a topic" fits any learner's
screen, which is exactly what makes it useless — it proposes nothing. The
model's brief now leads with concreteness and shows it both ways (BAD "Review
your notes" / GOOD "Redo the two eigenvalue questions you missed"), and the
label bound goes 40 → 60 chars because naming the actual thing costs words.
The fixed starters shown to a learner with no history got the same treatment:
they cannot name that learner's material, but they can still propose a
concrete first move.
And a specific sentence in a pill reads as a tag, not as an invitation. So the
pills are gone: one line each, left-aligned to the composer's own edge, serif,
no border or fill, with an arrow that is the only coloured thing at rest and
steps right on hover.
Note the colour is written as color-mix rather than `text-[var(--x)]/60` —
that Tailwind form compiles to nothing, and the arrow was silently inheriting
its parent's colour until this was checked against the computed style.
Each chip renders its label and sends its prompt — the whole sentence the
learner would have typed — so one click starts a real conversation instead of
prefilling something they still have to finish. No handoff is involved: the
home screen is already a draft session while it has no messages, so the chips
go through the same send path as the composer, which both creates the session
and starts it on the topic.
The time-of-day greeting above the composer is untouched. Chips sit between
the composer and the flex spacer, so they ride up with it on the empty screen
and disappear the moment there is a first message.
Generated text does NOT go through the i18n table — a generated label that
happened to match a key would be silently replaced by an unrelated
translation. Only the fixed starters are keys, and the component tracks which
of the two it is holding.
Nothing renders until the first response lands: chips appearing a beat late is
calmer than fixed copy visibly swapping for generated copy. A failed read
falls back to the fixed starters rather than an empty row, and a reroll that
comes back empty keeps what is already on screen.
* fix(knowledge): add GraphRAG model compatibility layer
* fix(graphrag): harden compatibility preflight
* fix: align GraphRAG compatibility with current dev
* test: skip GraphRAG config test without optional extra
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* 文档:明确 IMA 只读连接流程
* 文档:细化 IMA 连接状态与安全边界
* 文档:制定 IMA 只读连接实现计划
* 测试:固定 IMA 知识库列表协议
* 功能:支持枚举 IMA 知识库
* 功能:新增安全的 IMA 知识库列表接口
* 修复:说明 IMA 按知识库连接状态
* 功能:增加 IMA Web 连接接口
* 功能:接入 IMA 只读知识库连接表单
* 文案:补齐 IMA 连接流程中英文
* 修复:适配 IMA 知识库列表字段
* 修复:完善 IMA 认证与凭据清理
* 格式:统一 IMA 模块代码样式
* fix: load IMA source content safely
---------
Co-authored-by: TyrionH-is-coding <TyrionH-is-coding@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Route knowledge-base create and upload requests around Next Proxy body cloning and stream multipart data directly to FastAPI. Preserve authentication/content headers, strip hop-by-hop transport headers, and retain all backend validation limits.
Adds matcher and streaming contract regression coverage.
Preserve learner-facing Markdown emitted in Mastery tool rounds via the existing answer_visible contract. Ordinary tool narration remains trace-only.
Adds regression coverage for Markdown tables and teaching content that share a round with mastery_quiz.
Redact credentials from catalog responses and diagnostic streams, restore masked placeholders server-side, and resolve saved credentials for model discovery without returning them to the browser.
Web search was rebuilt onto a single spec table and six providers were
added on it — Doubao, Bocha, Zhipu, Firecrawl, Baidu Qianfan, and Aliyun
IQS. Consolidating seven copies of the provider list is what surfaced
three silent defects: Serper's `num` never reached the API, Serper
dropped its proxies, and Jina had no result-count limit. A runtime search
failure now walks the account's other credentialed profiles and finally
DuckDuckGo instead of failing the turn, recording the downgrade under a
top-level `search_fallback` key; a *missing* key still fails loudly for
the six new providers, five of which are China-hosted and cannot reach
the fallback anyway.
Also here, by way of main: LiteParse as a sixth document-parsing engine,
and MCP servers that reconnect when a stored credential is rotated and
report a dead transport as itself rather than as a tool timeout. Plus
CodeBuddy and OrcaRouter model providers, a persisted Codex
reasoning-effort override, and vision on OpenAI Codex.
Notes: assets/releases/ver1-5-12.md
This commit also carries the README prose sync, the ten translated
READMEs (which gain the Open Source Partners section they were missing),
the release-notes archive sweep, and the version bump.
Two PRs were merged straight into main after v1.5.11 and never reached
dev — #771 (LiteParse parsing engine) and #813 (MCP reconnect on
credential change; report transport failures as themselves rather than as
tool timeouts). dev had since moved 20 commits ahead, so main was no
longer an ancestor and a release could not fast-forward into it.
#813 was squash-merged from a branch cut before #808/#809/#825 landed, so
its snapshot carries pre-fix copies of five files. Every conflict is
resolved in dev's favour for that reason, verified file by file:
- citation_manager.py — main lacks #808's tool_metadata path
- reasoning_params.py — main hardcodes the Gemini check #809 tabled
- openai_responses/parsing.py — main aliases the "fc_0" placeholder as an
item identity, the exact defect #825 fixed
- test_citation_manager.py, test_openai_responses_parsing.py — dev's
copies are strict supersets; main contributes no unique assertion
main's genuinely new content (liteparse/, mcp/manager.py reconnect,
tests/services/mcp/test_call_failures.py) merges in untouched.
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.
* feat: add codebuddy provider
* fix: treat codebuddy as login-backed provider
* feat: sync codebuddy account models
* fix: ignore no-key placeholder for codebuddy
* feat: add codebuddy web login
* fix: streamline codebuddy settings and latency
* fix: support switching codebuddy accounts
* fix: preserve codebuddy sessions and tool calls
* feat: use CodeBuddy HTTP provider over Agent SDK
Chat with CodeBuddy over plain HTTP by reusing the login state that the
IDE plugin / CLI stores on disk, instead of bundling the ~130MB Agent SDK.
- add codebuddy_http_provider (OpenAI-compatible /chat/completions on
<endpoint>/v2) with codebuddy_credentials for local OAuth session reuse
- provider_factory picks HTTP transport whenever a login state or API key
is available; Agent SDK stays as fallback for CLI agent features
- demote codebuddy-agent-sdk from core deps to optional codebuddy extra
- default model codebuddy/default -> codebuddy/hy3
- update auth card UX and locales for SDK-less sign-in flow
* chore: label codebuddy provider as codebuddy/workbuddy in the dashboard
* style: apply pre-commit formatting after upstream merge
* chore: capitalise codebuddy provider label as CodeBuddy/WorkBuddy
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* feat(codex): persist managed reasoning effort overrides
* fix(codex): protect managed catalog refresh state
* feat(codex): allow user reasoning overrides
Expose only owner-scoped managed Codex model metadata and validate updates against provider-supported reasoning levels. Add ordinary-user settings controls without granting model catalog or provider administration access.
* fix(codex): bind reasoning overrides to OAuth account
Persist only a one-way account binding on managed Codex profiles. Hide and reject stale or legacy-unbound reasoning controls until a successful catalog refresh, and do not carry overrides across account switches.
* fix(codex): reject stale cross-account overrides
* fix(codex): isolate account switches at runtime
Found by an adversarial pass over the merged changes.
**A tool call could run under another call's name and arguments.**
``_ToolCallBuffers.add`` registered every buffer under the placeholder
item id ``fc_0``, which providers that omit ``item.id`` all share, and
``response.output_item.done`` looked buffers up by that same placeholder.
A ``done`` event for a call that was never announced therefore resolved to
whichever unrelated call last claimed it. Reproduced: a second call to
``list_kb`` was dispatched as ``delete_kb`` carrying the first call's
``{"kb": "secret"}``. The placeholder is a display fallback, not an
identity — never alias it, never look up by it.
**A blocked CDN froze every HTML visualization.** The iframe height
bridge attached its observers on ``DOMContentLoaded``, but ``injectKaTeX``
adds deferred script tags, and deferred scripts must all run before that
event fires. With jsdelivr unreachable the observers never attached and
every visualization sat at its initial height. The bridge is injected just
before ``</body>``, so it can gate on ``document.body`` instead and attach
before the CDN fetch resolves.
**RAG citations dropped their sources.** ``_extract_rag_citation`` was the
only extractor not handed ``tool_metadata``; it re-parsed ``raw_answer``,
which is the prose shown to the model, not JSON. Every RAG pipeline
normalises its retrieval into ``metadata["sources"]`` — already the shape
``_rag_source_payload`` reads — so prefer it and keep the answer parse as
the fallback. This is the user-visible half of #808 that normalising the
payload alone did not restore.
Also hoist the Gemini "minimal, not none" families beside
``_PROVIDER_DEFAULT_OFF_PATTERNS``, whose docstring calls itself the single
source of truth for exactly this knowledge.
The merge of #802 carried a `web/node_modules` symlink into the tree. It
pointed at the main checkout's own install, so pulling dev replaced that
directory with a symlink to itself and broke `npm` for anyone who pulled.
`.gitignore` did not stop it because both of its node_modules rules end in
a slash, which matches only a real directory — not the symlink a git
worktree uses to borrow the main checkout's install. Ignore both spellings.
* feat: integrate liteparse as a document parsing engine
* feat: implement background task dispatching for knowledge base processing
- Added `_dispatch_background_task` to run long-running tasks on a separate daemon thread, preventing blocking of the main event loop during knowledge base ingestion.
- Updated `upload_files` and `create_knowledge_base` functions to utilize the new background task dispatching method.
- Implemented rollback functionality for partially created knowledge bases in case of failures during file saving.
- Enhanced tests to verify the correct offloading of file saving and background task execution.
* update
* docs: add Open Source Partners section with PageIndex
* docs: replace partner blurb with PageIndex promo code
* docs: link PageIndex subscription to developer portal
* docs: point PageIndex logo at its GitHub repo
* fix: harden Responses stream parsing (#825)
* fix: remove obsolete Typer extra (#817)
* fix: normalize RAG citation payloads (#808)
* fix: decouple mastery paths from chat sessions (#810)
* fix(parsing): hold LiteParse to the workdir contract
The engine landed with three knobs that could not work as written:
- ``extract_images`` was gated on a user-supplied ``image_output_dir``
that defaulted to empty, so image extraction never ran. Even when set,
images landed outside ``images/`` and the Markdown kept LiteParse's
bare ```` names, so the cache loader saw neither.
Images now go to the workdir's ``images/`` like the PyMuPDF4LLM engine,
links are rewritten to ``images/<name>``, and an empty dir is removed.
- ``output_format`` was selectable, but the parse always writes ``.md``;
picking JSON or text produced a mislabelled document. Pinned to
Markdown and dropped from the settings slice.
- ``image_output_dir`` was a free-text path joined onto the workdir.
Removed with the rest.
Also: normalize the slice with the shared coercers (a bare ``bool()``
reads the string ``"false"`` as True), allow-list ``image_mode``, pass
``quiet`` and ``ocr_failure_fatal=False`` so a systemic OCR failure
degrades to recovered text instead of losing the document, pin the
extra to ``<3.0``, and keep the engine lists in the three tests that
assert them exactly.
Excludes the unrelated background-task/rollback/off-loop changes this
branch carried in ``api/routers/knowledge.py``: dev already routes
uploads through ``_save_uploaded_files_off_loop``, and the rest is a
separate change that deserves its own review.
---------
Co-authored-by: chenhj <hanjiang.chen@1stcs.cn>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* fix(web): repair malformed strong-emphasis spacing in assistant output
* style(web): keep removeEmptyMarkdownTables' loop header as dev has it
The branch reformatted an untouched line ('; )' -> ';)'). The repo's real
style is not what .prettierrc reports, so a stray prettier pass here would
land as unrelated churn in the squashed commit.
* fix(web): make the strong-emphasis repair fail-safe
The rewrite paired an opening ``**`` with the next one on the line
regardless of whether the line's markers pair off at all, so it corrupted
Markdown the renderer already handles correctly (checked against the
repo's own micromark):
- ``In Markdown, use ** to make text **bold**.`` lost its bold — the
capture was allowed to start at whitespace, so a literal ``**`` in
prose swallowed the sentence up to the next opener.
- ``**Note: **Important**`` became ``**Note:** Important**``, dropping
the bold and leaking a stray ``**``.
- ``**重點 **必讀** 內容**`` — valid nested emphasis — lost most of its
bold.
Anchor the capture at a non-space, require it to end at a colon (the
reported shape), and skip any line whose ``**`` count is odd: with an odd
count at least one marker is literal or unclosed, and there is no way to
tell which two were meant to pair. Bailing out is free — the line then
renders exactly as it does without this repair. Also skip indented code
blocks, which are shown verbatim and are not masked with the fenced ones.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* fix(web): settle scroll to bottom after loading chat history
Every message wrapper uses content-visibility: auto with
containIntrinsicSize placeholders, so the first scrollTop = scrollHeight
pin in useLayoutEffect lands on an estimated "fake bottom" before the
browser lays out real heights. Reopening a long history session could
therefore stop mid-conversation instead of at the true bottom.
- Re-arm autoscroll and re-pin with a double requestAnimationFrame after
session load completes, once real heights are laid out
- Listen for capture-phase load events in the post-stream observer so
lazy images that settle inside the window also re-pin to the bottom
* fix(web): re-pin only on a cold open, and describe the real mechanism
Two corrections to this branch's own fix:
- The re-arm and re-pin ran on every completed load, including the
background revalidate of a session painted instantly from cache. A
reader who opened a known session and scrolled up to re-read something
got yanked to the bottom when that round trip landed. Cold opens are
the case with a stale pin; gate on it, and check the abort signal
inside the queued frames so a superseded load cannot move a viewport
that now belongs to a newer session.
- The comment justified the double-rAF with ``content-visibility: auto``
and ``containIntrinsicSize`` placeholders, which do not appear anywhere
in web/. The heights that actually arrive late are lazily-loaded images
and the next/dynamic capability viewers. Same for the hook's listener:
opening a history session is not its path (that effect does not re-run
on a session switch), the window right after a stream stops is.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* update
* fix(mcp): reconnect on credential change; stop masking transport errors as timeouts
Two independent bugs, both surfaced connecting a remote MCP server that
authenticates with a header key.
connection_signature() fingerprints the stored config, which holds
${secret:...} references rather than values, so rotating a credential left
the reload diff byte-identical and the session kept using the replaced key
until the process restarted. _signature() now mixes in a digest of the
materialized config. The digest, never the value, reaches the signature;
configs with no references keep their plain signature, so this does not
invalidate and drop every live session on upgrade.
A transport failure on the POST carrying a tool call is raised inside the
SDK's own anyio task group and never resolves the caller's request, so a
call that failed in under a second was reported as a tool timeout -- the
one explanation that rules out the actual cause. call_tool() now watches
the connection task alongside the call and reports the error that task
recorded. _run_server() routes its post-live failure through the existing
describe_connect_failure(), so that string names the HTTP status rather
than "unhandled errors in a TaskGroup".
Tests: tests/services/mcp/test_call_failures.py
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs: add Open Source Partners section with PageIndex
* docs: replace partner blurb with PageIndex promo code
* docs: link PageIndex subscription to developer portal
* docs: point PageIndex logo at its GitHub repo
* fix: harden Responses stream parsing (#825)
* fix: remove obsolete Typer extra (#817)
* fix: normalize RAG citation payloads (#808)
* fix: decouple mastery paths from chat sessions (#810)
* fix(llm): mark OpenAI Codex as vision capable (#821)
Declare the Codex Responses provider as image-capable so multimodal calls do not silently degrade to text and RAG image indexing can use it. Cover capability resolution, fallback behavior, and input_image conversion.
* fix: return minimal reasoning_effort for Gemini 3 and 2.5 Pro (#809)
Gemini 3 models and Gemini 2.5 Pro reject reasoning_effort="none"
with a 400 INVALID_ARGUMENT error. Per Google's OpenAI-compat docs,
"none" is only valid for the 2.5 Flash family.
Return "minimal" (the lowest valid level) for Gemini 3 and 2.5 Pro,
preserving the cost-intent while avoiding the API error.
Fixes#734
Co-authored-by: 0xtidalbore <ahmed@itcloud.ca>
* fix(mcp): don't orphan a cancelled call, or leak a URL credential
Follow-ups to this branch's own two fixes, both on paths it opened:
- ``asyncio.wait`` — unlike ``gather`` — leaves the futures it waits on
running when the *waiter* is cancelled, and the call was moved into a
free-standing task, so nothing else would ever stop it. Stopping a turn
left the tool running against the server with its result discarded.
Cancel and absorb it whenever the wait is interrupted, sharing one
``_abandon`` helper with the connection-died path.
- A dead transport is now reported to the *model*, not just in settings,
and httpx names the full request URL in its message. ``CredentialTarget``
includes "url_param" and several curated servers use it, so that string
can carry an API key. Redact query and userinfo before it travels.
Also: route the one transient retry through the same watcher (a retry is
if anything more likely to meet a dead transport — the exact failure this
branch exists to stop reporting as a timeout), and skip materializing a
config that holds no ``${secret:...}`` references at all. The latter is
worth it: ``_signature`` runs per live connection on every reload, which
``ensure_scope`` performs once per turn, and resolving does per-reference
mkdir + chmod + read synchronously on that path.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: NoxsMedia <155662416+NoxsMedia@users.noreply.github.com>
Co-authored-by: 0xTidalBore <142905837+0xTidalBore@users.noreply.github.com>
Co-authored-by: 0xtidalbore <ahmed@itcloud.ca>
What happens while the answer is still being written. Prose that shared a
round with a tool call vanished into the trace, a truncated generation read as
the model deciding it had finished, and local indexing sat on the event loop
everything else needed.
- DSML tool calls are stripped from the stream incrementally instead of
all-or-nothing. Once a round's content channel showed markup, the rest of it
was diverted to the thinking channel, so any prose around the call left the
answer. DSMLStreamFilter suppresses only the envelope and the invoke blocks;
text before, between and after streams and persists (turn_runtime carries
answer_visible rounds into the assembled answer). An incomplete invoke is
released verbatim by flush, and a 512-char ceiling stops a stray `<` in
ordinary prose from making the live stream wait for a closing bracket.
- DSML parameter decoding consults the declared schema. DeepSeek marks
essentially every parameter string="true", arrays and objects included, so a
container argument reached the tool as a string of JSON. A parameter the
schema types array/object is parsed when the payload actually matches; the
provider's string contract still wins elsewhere. The catalog is kept when a
provider rejects native `tools` and the loop falls back to DSML — exactly
when the parser needs it.
- The round budget is three stages: exploration, a bounded settlement window
(MAX_SETTLEMENT_ROUNDS, tools still available so an already-started
interaction can finish), then one tool-less hard finish. A `length` finish is
an incomplete generation, not a decision to stop: the visible prefix is kept
and a continuation requested, under the same upper bound of exploration + 4.
- Resident memory across the process tree, at GET /api/v1/system/memory and in
the settings strip. runtime/memory_probe.py walks the tree; psutil is
imported lazily with a /proc fallback, so a missing wheel costs the strip and
not the app, and non-admins get {available: false}. The strip drops
LLM/Embedding/Search, which restated what the Models and Chat pages own.
- Local LightRAG indexing runs on a worker thread's own event loop.
RAG-Anything's local backends do synchronous graph merging and JSON
serialization inside async methods, stalling unrelated API and LLM work;
OwnerLoopBridge forwards LLM, vision and embedding calls back to the
request's loop with a copy of the caller's contextvars.
- Mastery works from the persisted question. learning/pending.py projects a
PendingQuestion into the public contract (prompt, type, label/body map) with
the expected answer server-side; ask_user renders that instead of display
data the model re-authored, and registration validates the quiz shape rather
than silently accepting a contradictory one.
- Connected KBs answer honestly about local files (empty listing, explicit 409
where a local file is required) instead of resolving a raw/ directory that
does not exist. resolve_public_output_path replaces is_public_output_path so
the new request-scoped /api/outputs endpoint authorizes and resolves in one
operation and fails closed with no request user. Visualize iframes measure
body content so they shrink as well as grow, and the chat page's model list
is fetched once behind a single-flight hook.
test_forced_finish_still_reports_the_tools_the_turn_carried asserted the old
two-stage budget (exhausted exploration = the next call is the tool-less
finish); it now drives through settlement to reach the real hard finish. Also
syncs the README prose, all ten translations, and the release-notes archive.
Work in progress carried over from earlier sessions, committed together.
Chat / DSML:
- Tolerate partial and malformed tool-call tags mid-stream, with a character
ceiling so a stray "<" cannot make the live stream wait forever for its
closing bracket.
- Narration rounds can now mark their prose as visible, so a DSML round that
keeps the text surrounding a call has it persisted as part of the answer.
Runtime observability:
- New deeptutor/runtime/memory_probe.py reports resident memory across the
process tree, exposed at /api/v1/system/memory and surfaced in the settings
status strip. psutil is a soft dependency, imported lazily with a /proc
fallback, so a missing wheel costs the strip and not the app.
Mastery:
- New deeptutor/learning/pending.py projects a persisted PendingQuestion into
the smaller public contract safe to hand the tutor model, and owns the
multiple-choice translations shared by registration and grading.
LightRAG:
- New pipelines/lightrag/worker.py moves local indexing onto a worker thread's
own event loop, so RAG-Anything's synchronous graph merging stops stalling
unrelated API and LLM work.
Also: request-scoped output artifact delivery (api/routers/outputs.py),
partner runtime and path_service adjustments, and CLI chat renderer updates.
A Codex token authorizes one person's ChatGPT plan, so the profile is
correctly never grantable — but the OAuth endpoints were admin-only too,
which left ordinary users unable to reach Codex by any route: they could
neither be given the administrator's profile nor sign in for themselves.
What made per-user sign-in unsafe was where the profile landed:
``get_model_catalog_service()`` resolves a non-admin to the ADMIN catalog, so
a user's sync would have published their profile into the shared one. A
sign-in now publishes into the owner's own catalog, keyed by the same owner
resolution as the credential store, so a login and its profile can never
land in different places. Ordinary users get
``data/users/<uid>/settings/model_catalog.json``; an administrator gets the
shared catalog exactly as before.
``redacted_model_access`` — the one place grants are resolved — gains those
personal rows (source="personal") for the caller's OWN id only, so the
option list, the capability gate, and selection validation agree without
three separate merges, and an administrator inspecting somebody's grants
still sees only what they assigned. The resolution path merges the same
profiles so a personal selection resolves to a real profile, with the
owner's copy winning over a shared profile of the same managed id (the ids
are per-provider constants, and the administrator's copy lists their models,
not the user's).
Runtime token ownership needed no change: the provider already reads the
token per owner. Endpoint gating is narrower rather than absent — a partner
is refused, since it is a synthetic user whose owner is a real account and
admitting one would mean acting on that person's login, sign-out included.
The restricted-user Settings → LLM page grows the connect/refresh/sign-out
card (no catalog, no credentials), and a sign-in now drops the cached model
options so a freshly connected account does not keep seeing the old list.
* feat: separate UI and model response languages
* refactor(settings): keep one owner for the interface.json language rules
The legacy migration — a file written before the UI/response split
inherits its single language into both fields — had been duplicated into
both readers of interface.json, as had the theme/language defaults. Two
copies of a migration rule drift.
Move the rule into resolve_languages() in the module that owns the file,
have the router compose its superset of defaults on top of the service's,
and cover the agreement with a test that reads one legacy file through
both paths. The helper also drops the separate key-presence check:
_normalize_language already falls back to its default for missing, null
and unrecognized values alike.
* fix: keep the language bootstrap single and local-choice-first
Merging dev surfaced three collisions this branch had not seen:
- The new bootstrap fetched /settings/ui unconditionally and overwrote
writeStoredLanguage on every mount, undoing #730's rule that a choice
made in this browser is the more specific signal and must win. Folded it
into the existing guarded effect so one fetch serves both language
fields and neither can clobber a local selection.
- apiFetch/apiUrl ended up imported twice in AppShellContext, which git
merged without a conflict and tsc rejects outright.
- Three tests still stubbed get_ui_language at call sites that now ask for
get_response_language: the question router's stand-in module and two
mastery_path patches (renamed the zh case to say response language).
* fix(api): include response_language in the pre-session UI read
The bootstrap adopts both languages from this one endpoint, so leaving
response_language out of the projection meant a fresh browser always
inherited the interface locale and never saw the saved output-language
preference. It belongs with the other two: all three are the visitor's
own presentation choices, none describe the deployment.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* fix: stop Partner responses with Escape
Fixes#766
* fix(partners): let an open overlay keep Escape for itself
The streaming Escape listener is bound on window, so it also fired for
dismissals aimed at a Modal, PickerShell, ConfirmDialog or preview
drawer — closing the dialog killed the partner's answer with it. Bail
while any overlay is mounted; every one of them carries a dialog role
and unmounts on close, so the DOM answers the question directly.
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
#784 fixed the launcher, but the same address is rendered on two other paths
that kept "localhost": the Docker entrypoint (render_environment) and the
last-resort default in web/proxy.ts. On a dual-stack host that name resolves
to ::1 first while uvicorn binds 0.0.0.0 (IPv4 only), so every rewritten
/api/* request fails to connect — the launcher and container paths are meant
to stay in sync, and after #784 they no longer did.
Also disambiguates the two same-named _optional_positive_int helpers added by
#774: catalog's drops junk from a live API response, contracts' rejects it as
cache corruption. Same name, opposite behaviour — the strict one is now
_require_optional_positive_int and says why it differs.