Commit Graph

1227 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
f2b7828bc4 fix: correct the provider PRs merged this round
An adversarial pass over #818 / #789 / #780 after merging.

**Codex sign-ins from before this week stopped working (#789).**
``validate_runtime_profile`` compared the profile's ``codex_account_binding``
for equality, but that key is written only by ``sync_codex_catalog`` — every
managed profile published by #690/#774 has none, so ``None != <hash>`` made
each of them look like another account's and locked its owner out of Codex
until they re-ran "Refresh models". Absent now reads as legacy; a binding
that is present and different is still an account switch and still refused.

**Overriding reasoning effort for one turn returned 409 (#789).** The same
function also required the request's effort to be byte-equal to the value
stored in the catalog. Effort is a per-request knob, not part of the identity
that ties a config to a token — the check now stops at model membership.
Its test asserted the old behaviour and has been rewritten around what the
function is actually for.

**The reasoning-effort endpoint left the runtime caches stale (#789).** It
writes the catalog the runtime resolves against, like every other catalog
write in this router, but skipped ``_invalidate_runtime_caches()``.

**OrcaRouter claimed Anthropic prompt caching (#818).** ``supports_prompt_caching``
makes ``_build_kwargs`` inject ``cache_control`` blocks into any ``anthropic/*``
or ``claude*`` request — an OpenRouter extension. No other gateway sets it and
nothing established the second one accepts it; a strict gateway would 400 every
Claude turn. Also fixed ``anthropic/claude-sonnet-4.6`` in the fallback list,
which the rest of the repo spells with dashes, so a user picking it from our
own menu would have got "model not found".

**OrcaRouter inserted itself into the curated menus (#818).** The featured
lists are hand-picked and rendered as a positional numbered menu, so adding an
entry shifted Ollama from [10] to [11]. The registry entry alone already makes
a provider reachable via "Show all" and the Settings dropdown; which providers
are featured is a maintainer decision. The README paragraph goes with it — no
other provider has per-provider prose there, and it would have been translated
into ten languages.
2026-08-13 00:07:06 +08:00
Ching Wing Kwok
8297fc7b7e feat(provider): add codebuddy as a LLM provider (#780)
* 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>
2026-08-13 00:02:42 +08:00
NoxsMedia
104e844b55 feat(codex): persist managed reasoning effort overrides (#789)
* 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
2026-08-12 23:38:15 +08:00
XiaoHuo888-hue
80766a420c feat: add OrcaRouter as a named OpenAI-compatible gateway provider (#818) 2026-08-12 23:38:08 +08:00
Bingxi Zhao (Frank)
c6ae78e334 chore: ignore the playwright audit's output dirs
`npm run audit` writes web/test-results/ (and web/playwright-report/ when a
report is generated). Neither was ignored, so both showed up as untracked
noise ready to be swept into an unrelated commit.
2026-08-12 17:33:56 +08:00
Bingxi Zhao (Frank)
97574b5236 fix: three defects on the paths this week's PRs touched
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.
2026-08-12 17:28:56 +08:00
Bingxi Zhao (Frank)
2da883627f fix: drop a symlinked web/node_modules that #802 staged
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.
2026-08-12 17:11:41 +08:00
p421098
cfbd49bad0 fix(web): repair malformed strong-emphasis spacing in assistant output (#786)
* 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>
2026-08-12 17:06:47 +08:00
Hamm0101
1de795cace fix(web): settle scroll to bottom after loading chat history (#802)
* 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>
2026-08-12 17:06:41 +08:00
0xTidalBore
f83a27275d 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>
2026-08-12 16:51:57 +08:00
NoxsMedia
cc78ca1a83 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.
2026-08-12 16:51:51 +08:00
Bingxi Zhao (Frank)
a8e03347cb fix: decouple mastery paths from chat sessions (#810) 2026-08-12 16:11:35 +08:00
Bingxi Zhao (Frank)
eec4134d15 fix: normalize RAG citation payloads (#808) 2026-08-12 16:11:29 +08:00
Bingxi Zhao (Frank)
ea63482f77 fix: remove obsolete Typer extra (#817) 2026-08-12 16:11:25 +08:00
Bingxi Zhao (Frank)
c96440d6ac fix: harden Responses stream parsing (#825) 2026-08-12 16:11:21 +08:00
Bingxi Zhao (Frank)
d7cf75d006 docs: point PageIndex logo at its GitHub repo 2026-08-11 17:03:02 +08:00
Bingxi Zhao (Frank)
e84f31e0b1 docs: link PageIndex subscription to developer portal 2026-08-11 16:58:48 +08:00
Bingxi Zhao (Frank)
5746ebff7d docs: replace partner blurb with PageIndex promo code 2026-08-11 16:52:18 +08:00
Bingxi Zhao (Frank)
c488037e92 docs: add Open Source Partners section with PageIndex 2026-08-11 16:46:42 +08:00
Bingxi Zhao (Frank)
515a754b67 update 2026-08-10 22:34:51 +08:00
Bingxi Zhao (Frank)
456f9c2422 release: v1.5.11
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.
v1.5.11
2026-08-10 00:47:37 +08:00
Bingxi Zhao (Frank)
7009f7a988 fix 2026-08-09 22:18:22 +08:00
Bingxi Zhao (Frank)
712d4137f0 feat: DSML streaming robustness, memory observability, and mastery pending questions
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.
2026-08-09 02:31:44 +08:00
Bingxi Zhao (Frank)
8865da7c6d release: v1.5.10
The paths underneath the providers. A batch upload that stalled every other
request, a knowledge-base list that rescanned every index, a tool call
dispatched with no arguments and retried until the budget ran out — plus two
things that were quietly missing.

- Every account can sign in to its own Codex. The token authorizes one
  person's ChatGPT plan so the profile was correctly never grantable, but the
  OAuth endpoints were admin-only too, leaving ordinary users no route at all.
  A sign-in now publishes into the OWNER's catalog
  (data/users/<uid>/settings/model_catalog.json), keyed by the same owner
  resolution as the credential store; redacted_model_access gains those
  personal rows for the caller's own id only, so the option list, capability
  gate and selection validation cannot disagree. Partners are refused.
- Model output language is its own setting. Settings -> Appearance carries two
  independent toggles; resolve_languages() in interface_settings.py owns the
  legacy migration (a pre-split file inherits its single `language` into both),
  and both readers go through it. GET /settings/ui is public so /login and
  /register can bootstrap before a session, projected down to theme+language.
- A tool call with empty `arguments` is rejected in front of dispatch instead
  of run. The tool used to do the rejecting ("requires a non-empty command",
  "Unknown mode ''"), which does not read as a missing argument, so the model
  re-emitted the same call until the loop budget ran out. The guard names the
  missing arguments and their accepted values, enums included.
- Batch uploads move off the event loop (the chunked write, zip extraction and
  per-file PocketBase upload ran inline; the staging pass sat in an async
  BackgroundTasks entry, which starlette awaits ON the loop). KB listing reuses
  one reconciled snapshot instead of reloading config and rescanning every
  index per item.
- Deep Research mounts the read-only Obsidian tools instead of rag for a linked
  vault, injects the vault path server-side, and treats their evidence as
  citable.
- The server-side backend address is the IPv4 loopback on all three paths
  (launcher, Docker entrypoint, web/proxy.ts default): `localhost` resolves to
  ::1 first on a dual-stack host while uvicorn binds 0.0.0.0.
- Escape stops a streaming Partner reply and bails while any dialog overlay is
  mounted; vision overrides match `claude-` by vendor prefix and recognize Kimi
  K3 and Qwen3.8-Max; Codex context-window metadata survives the catalog round
  trip; editing a message no longer races its refresh; the deeptutor-cli wheel
  ships the agents' prompt YAML again and prompt misses are no longer cached.

Also fixes the `ruff format --check` failure red on dev since 6cd55939, and
syncs the README prose, all ten translations, and the release-notes archive.
v1.5.10
2026-08-07 22:28:33 +08:00
Bingxi Zhao (Frank)
4041c75d8e feat(multi-user): let each account sign in to its own Codex (#781)
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.
2026-08-07 21:09:40 +08:00
Bingxi Zhao (Frank)
f342281f33 fix(knowledge): keep batch uploads off the event loop (#777)
Batch-uploading files stalled every other request — chat WebSockets included
— for the whole duration of the batch. Two blocking paths, both in an async
context:

* ``_save_uploaded_files`` blocks end to end (a chunked write of every
  uploaded byte, zip extraction, plus a synchronous HTTP upload per file
  when PocketBase is on) and was called inline from the upload and
  create-KB routes;
* the follow-up work runs in a FastAPI ``BackgroundTasks`` entry declared
  ``async def``, which starlette awaits ON the loop — only *sync* callables
  reach its threadpool — so the staging pass (a full-content hash per file
  plus a copy) and the per-file re-hash blocked there too.

Each of those moves to a worker thread. Reading ``UploadFile.file`` off-loop
is safe: it is the plain SpooledTemporaryFile, never the async API. The
provider index itself already ran through an executor, and the remaining
small JSON writes are left inline rather than paying a thread hop each.
2026-08-07 21:09:20 +08:00
Bingxi Zhao (Frank)
b28a1a7b01 fix(chat): reject tool calls whose required arguments never arrived (#779)
Under a large tool surface and long history, providers intermittently emit
a native function call with empty ``arguments`` even though the schema marks
fields required. The call was dispatched anyway, so the tool did the
rejecting: ``exec`` raised "requires a non-empty command", ``write_note``
answered "Unknown mode ''". Neither reads as "an argument is missing", so
the model re-emitted the same malformed call until the loop budget ran out
— one report saw 5 of 7 write_note calls arrive empty and retry 5-7 times.

A guard in front of dispatch turns that into one self-correcting round: the
call never runs, and the role=tool body names the missing arguments and
their accepted values (including enums, which is what turns "Unknown mode
''" into a one-round fix).

The rules stay narrow so nothing that used to work stops working: a
parameter carrying a default is not required, empty collections are left
alone, server-injected kwargs count as supplied, and an unknown tool name
still reaches the registry that owns that error. Every required argument
across the builtin tools is one the tool would have raised on anyway.
2026-08-07 21:09:05 +08:00
Bingxi Zhao (Frank)
847d2e7fff test(question): stop the mimic websocket test from depending on import order
The fixture replaced the whole deeptutor.services.config package with a
two-attribute stub. That was enough for the router's own import, but the
websocket handler lazily imports deeptutor.api.routers.auth, which reads
other loaders out of the same package — so the test only passed when an
earlier test had already cached that module and the lazy import never
reached the stub. On its own it failed with ImportError, and any change
to test ordering could have flipped the full run red.

Defer everything not deliberately overridden to the real module (PEP 562
module __getattr__), so the fake stays two lines wide and cannot rot as
the auth path grows dependencies.
2026-08-07 03:18:38 +08:00
wayblink
be14c3ef23 feat: separate UI and model response languages (#758)
* 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>
2026-08-07 03:13:04 +08:00
Huoran
6cd55939a4 fix(api): expose GET /api/v1/settings/ui without auth for pre-session language bootstrap (#763)
* fix(api): expose GET /api/v1/settings/ui without auth for pre-session language bootstrap

The app shell bootstraps the interface language from GET /api/v1/settings/ui
(added in #730), but auth pages (/register, /login) have no session, so the
request hit the router-level _auth dependency and returned 401. The bootstrap
silently bailed out and auth pages stayed English even with the persisted
language set to zh (#760).

Move the anonymous read to a public_router mounted before the gated settings
router. The payload is non-sensitive UI preferences (theme/language) only;
PUT /ui and every other settings endpoint remain auth/admin-gated.

Adds regression tests: anonymous GET returns 200, and the gated router no
longer carries GET /ui.

Closes #760

* fix(api): narrow the public UI read to theme and language

The endpoint was returning the whole saved `ui` blob to anonymous
callers, which also carries sidebar_nav_order, enabled_optional_tools
and chat_response_timeout — configuration that describes the deployment,
not the visitor. Project it down to the two fields a page can actually
need before it knows who is asking; the rest stays behind auth on
GET /settings.

Also fixes the gated-router assertion, which compared "GET" against a
list of method *sets* and so would have passed even with GET /ui still
mounted on the auth-gated router.

---------

Co-authored-by: Huoran559 <huoran559@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-06 22:25:13 +08:00
GMyhf
0021c4d207 fix: make prompt loading and capability failures terminal (#738)
* fix: make prompt loading and capability failures terminal

* fix: handle remote knowledge base file listings

* fix: proxy uploads to LightRAG servers

* fix: show remote LightRAG document status

* fix: clarify knowledge upload confirmation

* fix(knowledge): hide reindex for connected bases

* refactor: narrow this branch to the prompt-resource fix

Split out of the original PR so #737's two halves land separately:

- The terminal-failure change to runtime/orchestrator.py is already on dev
  via #732, which shipped the same turn_terminal/status metadata. Dropped
  here rather than merged twice.
- The LightRAG Server upload forwarding and remote document listing belong
  to #755, not #737. Preserved on origin/keep/738-lightrag-server for a
  follow-up PR against that issue.
- Dropped the third prompt fallback that read the adjacent YAML with
  pathlib+yaml directly. With the cache no longer poisoned by a miss,
  reload_prompts() recovers on its own, and PromptManager stays the only
  thing that knows how to locate a prompt file.

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-06 22:20:11 +08:00
Matt Van Horn
4f15fec152 fix: stop Partner responses with Escape (#783)
* 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>
2026-08-06 22:11:15 +08:00
szzhoujiarui
47b713d36e fix(research): mount read-only Obsidian tools instead of rag for vault KBs (#756)
* fix(research): mount read-only Obsidian tools instead of rag for vault KBs

When the selected knowledge base is a connected Obsidian vault, the
research block loop now:

- resolves KB metadata at construction and records the server-side vault
  path (no RAG usage audit);
- suppresses the rag auto-mount (has_kb=False) and exposes the three
  read-only Obsidian tools obsidian_search / obsidian_read / obsidian_list;
- injects _vault_path server-side, overwriting any model-supplied value;
- treats the Obsidian tools as citable so their evidence feeds the
  citation manager and Phase 4 reporting;
- renders an Obsidian-specific system note (en/zh) instructing read-only
  vault retrieval instead of rag.

Indexed KBs, no-KB, and unresolvable references keep their existing
behaviour. Closes #752

* fix(research): preserve Obsidian citation context

---------

Co-authored-by: szzhoujiarui-sketch <szzhoujiarui-sketch@users.noreply.github.com>
2026-08-06 22:07:26 +08:00
Bingxi Zhao (Frank)
9af5f890f4 fix(runtime): spell the server-side backend address as the IPv4 loopback everywhere
#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.
2026-08-06 19:30:49 +08:00
Kevin Xia
115a78ae1b fix: recognize Qwen3.8-Max vision support 2026-08-06 19:25:17 +08:00
Chirag Gupta
6c7ee227bb feat: mark Kimi K3 as vision capable 2026-08-06 19:24:40 +08:00
Chirag Gupta
4f3243228a fix: match Claude model ids in vision capability overrides (#764) 2026-08-06 19:21:36 +08:00
PenaFong
a8534ed336 fix: keep knowledge-base listing linear (#778)
Reuse the reconciled manager snapshot while building one knowledge-base list response so each item does not reload configuration and rescan every index.

Constraint: Preserve fresh config reads for standalone callers and target the upstream dev branch.

Rejected: Raise the proxy timeout | it masks repeated full-index scans and leaves list cost quadratic.

Confidence: high

Scope-risk: moderate

Directive: Do not reuse manager snapshots across await boundaries or write operations.

Tested: 53 focused pytest cases; Ruff check and format; 58-KB read-only benchmark completed in 2.114 seconds.

Not-tested: Full repository pre-commit suite.

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-08-06 19:19:53 +08:00
szzhoujiarui
525a171e10 fix(web): resolve optimistic edit refresh race (#753)
Co-authored-by: szzhoujiarui <311234381+szzhoujiarui@users.noreply.github.com>
2026-08-06 19:19:45 +08:00
s4kura
110dd90274 fix: use IPv4 loopback for frontend proxy (#784) 2026-08-06 19:19:38 +08:00
NoxsMedia
1f37e859b9 fix(codex): preserve context window metadata (#774) 2026-08-06 19:19:30 +08:00
Bingxi Zhao (Frank)
37c3db6df7 release: v1.5.9
Providers. Gemini's native Embedding 2 endpoint, a per-model reasoning-effort
control, and a Novita AI gateway — plus the paths that were quietly wrong
underneath them.

- Gemini embedding profiles default to the native
  `.../models/<model>:batchEmbedContents` endpoint with gemini-embedding-2 and
  x-goog-api-key, and the URL follows the selected model (through a gateway
  prefix too). Existing gemini-embedding-001 profiles stay on the
  OpenAI-compatible path on purpose: the native route sends a taskType and
  L2-normalizes its output, so moving them would change document vectors and
  invalidate the index built from them.
- Retrieval embeddings carry a role. LlamaIndex tags queries search_query and
  passages search_document, LightRAG maps its context hint the same way, and
  adapters opt in via SUPPORTS_INPUT_TYPE so a backend that never sent a role
  keeps not sending one. Only Cohere changes today (it requires the field and
  already defaulted to search_document) — document vectors untouched, no
  re-index.
- A per-model default reasoning effort sits next to the context window, offered
  only where the provider supports one and labelled in that provider's own
  vocabulary. Two Anthropic bugs surfaced while wiring it: `none` turned
  thinking on with a 4096-token budget, and a stored `adaptive` sent to an
  older family drew a 400 instead of the default budget.
- Novita AI joins the LLM gateways. MiniMax defaults to the global platform
  (api.minimax.io) rather than the mainland-China one whose keys are not
  interchangeable; minimax-m3 / m2.7 context windows are recorded and detection
  reads a context_size field.
- docker-compose.ghcr.yml mounts all of ./data. It bind-mounted only
  data/user, data/memory and data/knowledge_bases, so data/system (JWT signing
  secret, accounts, grants, per-owner Codex tokens), data/users, data/partners
  and data/cli-apps lived in the container's writable layer and were discarded
  on recreate. Existing Compose users must copy that state out before the next
  `up -d` — see CONTAINERIZATION.md.
- Codex sign-in works in a local container via a temporary
  compose.codex-oauth.yaml overlay that publishes 1455/1457 only during
  sign-in, with teardown.
- A capability that raised, or a request for one that does not exist, ended the
  stream with no verdict and persisted the turn as completed with an empty
  answer. The error is now terminal and carried through DONE, so the turn is
  stored as failed with its message.
- The saved interface language is honored on first load (it lived in the
  backend ui settings that only the Settings route read); Visualize drops an
  off-enum render_type / visual_genre instead of aborting; credential-like
  query parameters are redacted in printed endpoints.

Release content: assets/releases/ver1-5-9.md, __version__ 1.5.9, the README
Releases row, and the 10 translated READMEs synced for the Codex OAuth bridge
paragraph.
v1.5.9
2026-08-04 16:34:01 +08:00
Bingxi Zhao (Frank)
fb04addbfa test(embedding): pin the Gemini endpoint rule for both model families
The catalog test still asserted the native endpoint for gemini-embedding-001,
which is the behavior 2ad3640c deliberately dropped: only Embedding 2 defaults
there, so an existing 001 index keeps matching the vectors it was built from.
2026-08-03 21:51:07 +08:00
Dongyu
bf76ccfd83 fix(web): honour the saved interface language on first load (#730)
The interface language is persisted in the backend's ui settings, but only the settings route ever read it into state — so /home and every other page started in English until the user picked the language again in that browser.

The app shell now adopts the saved value once after mount, and only when the browser has recorded no choice of its own, so a local selection still wins. It goes through apiFetch (works with auth enabled), leaves the routes statically prerendered, and keeps the zh locale a lazy chunk.

Also replaces the duplicated "New conversation" sentinel check with a shared helper — the chat header showed the untranslated English sentinel the same way the sidebar did — and adds three composer aria-label keys that were referenced but missing from both catalogs.

Closes #729.
2026-08-03 21:45:40 +08:00
Geonwoo Jeong
2ad3640cd1 feat(embedding): support Gemini Embedding 2 over the native API (#744)
Adds a Gemini embedding adapter that speaks the native :batchEmbedContents endpoint, so Embedding 2's retrieval-role prompt instructions and configurable output dimensionality are available, and threads a retrieval role (query vs document) from both RAG pipelines down to the client.

The role is opt-in per adapter: Jina and the OpenAI-compatible backends keep sending exactly what they sent before, because adding a task hint changes the vectors and would invalidate indexes already built. For the same reason only Embedding 2 defaults to the native endpoint — an existing gemini-embedding-001 profile stays on the OpenAI-compatible path unless its endpoint is set to the native URL explicitly.

Also redacts credential-like query parameters from endpoint values shown in errors and diagnostics.
2026-08-03 21:31:29 +08:00
Dongyu
74004c4125 feat(settings): add a per-model reasoning effort selector (#736)
Models → LLM now exposes a per-model reasoning-effort default, persisted on the catalog entry and honored by the existing ResolvedLLMConfig path. Options are provider- and family-specific because the adapters do not share one enum, and a value already stored stays listed even when the table excludes it, so a profile sending a rejected value can be reset to Auto.

Also fixes two Anthropic request-building bugs the selector would have made reachable: an off-sentinel effort (`none`/`minimal`) used to fall through to the budget branch and turn thinking ON on pre-4.7 families, and `adaptive` was offered to families that only accept enabled+budget_tokens.

Closes #735.
2026-08-03 20:59:38 +08:00
Geonwoo Jeong
d824a7f9f1 fix(codex-auth): make the local container OAuth bridge temporary (#743)
Codex redirects the browser to fixed loopback ports 1455/1457, which the container network does not share with the host. Publishing them permanently would hold those ports hostage from every other Codex client, so they move into an opt-in compose.codex-oauth.yaml overlay applied only while signing in.

docker-compose.ghcr.yml now mounts the whole ./data tree like the other manifests. Its previous three-subtree mount left data/system — the JWT signing secret, accounts, grants, per-owner Codex tokens — in the container's writable layer, where a recreate discarded it. Upgrading an existing GHCR deployment needs a one-time copy out of the running container; CONTAINERIZATION.md documents the exact commands.
2026-08-03 20:50:55 +08:00
王子天
75c8ea9270 fix(visualize): stop an invented enum value from aborting generation (#748)
Models regularly answer the analysis stage with a visual_genre or render_type that is not in the prompt's list ("simulation", "diagram"). Both fields are enums, so validation aborted the render over a label no downstream stage strictly needs.

VisualizationAnalysis now degrades an unknown genre to "" and an unknown render_type to svg, logging the rejected value. Putting it on the model rather than at the one parse site also covers render_type, which is required with no default.
2026-08-03 20:46:51 +08:00
jax-novita
160f12ab24 feat(providers): add Novita AI as an LLM gateway (#746)
Registers Novita AI as an OpenAI-compatible gateway (https://api.novita.ai/openai, NOVITA_API_KEY) with base-URL detection and brand aliases.

Also teaches context-window detection about Novita's `context_size` metadata key — without it every Novita model, including the 1M-token ones, planned against the 16K-64K fallback.
2026-08-03 20:38:05 +08:00
Octopus
25c3cb34a5 fix(minimax): default to the global endpoint and record M3 context windows (#724)
MiniMax's global platform (api.minimax.io) is now the default base URL for both the OpenAI-compatible and Anthropic-compatible specs, and MiniMax-M3 / M2.7 get explicit context-window entries so planning stops falling back to a probe.

Existing profiles are unaffected — the settings UI persists base_url when the provider is selected. China-platform users must override base_url and use a China-platform key; the two platforms do not share credentials.
2026-08-03 20:31:34 +08:00