71 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
6bbcc00c55 Merge dev into preview, preserving preview features
Integrate dev fixes with preview's Python/TypeScript schedulers, chat queue, learning navigation, and live turn persistence.
2026-10-27 01:16:58 +08:00
Bingxi Zhao (Frank)
ab34b71d42 fix(auth): respect learner grants in learning navigation (#1987) 2026-10-19 01:52:23 +08:00
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
dajiaohuang
149343c414 fix(storage): close SQLite connections after helper operations 2026-10-15 12:08:30 +08:00
Yongliang
b19a837457 feat(cli): add GitHub Copilot device login to init (#1277)
* Save uncommitted changes

* fix: isolate Copilot credentials and honor model routing

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: normalize Copilot Responses history replay

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: correct Copilot model discovery and response language

Honor Astra temperature restrictions, synchronize response language preferences, and preserve system prompts in Responses requests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Keep Copilot integration focused on owner authentication and runtime

---------

Co-authored-by: Yongliang Wang <yonwa@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:50:55 +08:00
Bingxi Zhao
2f62ab1d71 Merge pull request #1625 from evan188199-tech/codex/fix/workspace-subagents
fix(workspace): preserve shared subagent access (#1613)
2026-10-04 14:17:27 +08:00
XZH
c90fe4d047 feat(learner): expose assigned interactive books
Closes #1650
2026-09-29 02:14:47 -07:00
XZH
1240d5e294 fix(workspace): preserve shared subagent access 2026-09-28 08:17:00 -07:00
Bingxi Zhao (Frank)
a824e4b01f fix(knowledge): preserve moved KB retrieval and scoped jobs 2026-09-27 11:04:33 +08:00
Bingxi Zhao (Frank)
b0385a315d feat(knowledge): choose storage and move individual bases 2026-09-27 11:04:33 +08:00
polaris-smart
5357e0c29d refactor(auth): gate learner-only paths on "non-admin" instead of "exactly user"
Align the five remaining two-value gate idioms with the "only 'admin'
elevates" invariant that #1556 now documents: self-service learner-profile
access (_require_local_learner), the admin-managed learner-profile
GET/PUT target checks, the identity-layer set_learner_profile writer, and
device-credential activation (_active_account) admit every non-admin role
instead of only "user".

While the admitted vocabulary is still {"admin", "user"} this is
behavior-preserving; once "teacher"/"student" exist, ordinary accounts
keep learner profiles and device logins instead of being silently
excluded. Admins stay excluded everywhere, including admins carrying a
learner preset.

Tests: a teacher with a learner preset manages their own profile through
the self-service endpoints and via an admin actor; admins (even with a
learner preset) stay rejected at the self-service, admin-managed,
storage, and device-credential layers; a device credential issued for a
teacher logs in and reports the teacher role, while issuance for an admin
still fails closed.
2026-09-24 08:19:39 +08:00
polaris-smart
85c6cad6b2 feat(auth): admit "teacher" and "student" role values in the single role whitelist
Extend the role vocabulary admitted by the single source of truth
(VALID_ROLES + normalize_role + the Role literal) that #1556 introduced.
Authorization stays least-privilege: only "admin" elevates, defaults are
unchanged, unknown values still degrade to "user", and the diff is fully
revertible one line per value. Capability wiring for the new roles stays
deployment policy; "parent" is deliberately out of scope.

Tests: parametrized passthrough over the four documented roles, set_role
round-trip for the new values, non-elevation assertions, and a "parent"
negative control proving the whitelist decides.
2026-09-24 08:19:39 +08:00
Bingxi Zhao (Frank)
8880529c65 Merge PR batch with local follow-up fixes
Preserve precise learner KB route guards, combine UI and response language domains, carry normalized EPUB extraction, and regenerate frontend contracts.

Update locale fallback coverage for the completed Ukrainian translation bundle.
2026-09-23 12:01:14 +08:00
Bingxi Zhao (Frank)
21b9307031 fix(reading): enforce current learner grants on saved sources and tabs 2026-09-23 11:27:03 +08:00
Bingxi Zhao (Frank)
baa3263a7a fix(auth): forward requested handoff host and avoid shared quota lockout 2026-09-23 11:25:53 +08:00
Bingxi Zhao (Frank)
c0d19dae04 fix(multi-user): preserve newer grant writes during preset rollback 2026-09-23 11:15:47 +08:00
Bingxi Zhao (Frank)
7730fd0c5f fix(grants): persist atomically and fail closed on corrupt data 2026-09-23 11:15:42 +08:00
Bingxi Zhao (Frank)
3d58ba5253 Rotate handoff tickets with a controlled invalid-token error 2026-09-23 10:51:14 +08:00
Bingxi Zhao (Frank)
e5598a72c5 Harden trusted handoff proxy and ticket lifetime; normalize CSV rows 2026-09-23 10:47:53 +08:00
Bingxi Zhao (Frank)
915a5ae57b Merge commit 'refs/pr/1482' into codex/evan-backend-prs-20260923
# Conflicts:
#	deeptutor/api/routers/auth.py
#	tests/services/config/test_runtime_settings.py
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-09-23 10:29:26 +08:00
Hermes
3f621d403a refactor(auth): converge all role whitelists on normalize_role, add set_role tests
- models.py: add VALID_ROLES + normalize_role as the single source of truth
- identity.py: route _canonical_record/_migrate_legacy_users/load_users/set_role through normalize_role
- context.py: token payload role mapping via normalize_role
- services/auth.py + api/routers/auth.py: set_role guards validate against VALID_ROLES
- tests/multi_user/test_role_normalization.py: 16 tests, first set_role coverage in repo

Zero behavior change: legal roles pass through; unknown values keep the
same least-privilege degrade path; only guard error strings derived from
sorted(VALID_ROLES) differ.
2026-09-23 01:21:17 +08:00
NoxsMedia
ac8cc4a97d fix: preserve selected embeddings in confirmed LightRAG rebuilds 2026-09-21 02:57:39 +00:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
XZH
352897cd4e feat(auth): add secure public session handoff (#1467) 2026-09-15 19:17:37 -07:00
NoxsMedia
446b3aab7e feat(lightrag): configure independent role models and pinned vision indexing 2026-09-06 09:58:42 +00:00
NoxsMedia
9cd1912c14 feat: add LightRAG indexing model controls and provenance (#1174)
* feat(knowledge): add LightRAG indexing model controls

* fix(knowledge): close NOX-21 review findings

* fix(knowledge): resolve NOX-21 review blockers

* fix(knowledge): identify unpublished LightRAG builds

* style: format LightRAG indexing changes

* fix(knowledge): align indexing controls with LightRAG model

* fix(knowledge): close indexing UI review blockers

* style: format knowledge router
2026-09-03 15:56:55 +08:00
Bingxi Zhao (Frank)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
Bingxi Zhao (Frank)
90351189a1 feat(learner): complete guardian management flows 2026-09-01 01:52:13 +08:00
Bingxi Zhao (Frank)
58271301b4 Merge pull request #1129 from evan188199-tech/codex/feat-guardian-account-ui
# Conflicts:
#	deeptutor/multi_user/guardians.py
#	deeptutor/multi_user/router.py
#	tests/multi_user/conftest.py
#	tests/multi_user/test_guardians.py
#	web/lib/settings-nav.ts
2026-08-31 22:07:03 +08:00
Bingxi Zhao (Frank)
cc52496e96 Merge pull request #1126 from evan188199-tech/codex/feat-learner-self-profile-v2
# Conflicts:
#	deeptutor/multi_user/identity.py
#	tests/multi_user/test_learner_profile.py
2026-08-31 20:50:37 +08:00
Bingxi Zhao (Frank)
15c31267cc Merge pull request #1124 from evan188199-tech/codex/feat-learner-profile-controls
# Conflicts:
#	deeptutor/multi_user/identity.py
#	deeptutor/services/session/turn_runtime.py
2026-08-31 20:39:42 +08:00
Bingxi Zhao (Frank)
15c79a055f Merge pull request #1122 from evan188199-tech/codex/feat-device-credentials
# Conflicts:
#	deeptutor/api/routers/auth.py
#	tests/multi_user/conftest.py
2026-08-31 20:33:29 +08:00
Bingxi Zhao (Frank)
bac45240be Merge pull request #1113 from evan188199-tech/codex/feat-guardian-authorization
# Conflicts:
#	deeptutor/multi_user/router.py
2026-08-31 20:25:49 +08:00
Bingxi Zhao (Frank)
e06b366f69 Merge pull request #1112 from evan188199-tech/codex/feat-learner-account-presets
# Conflicts:
#	deeptutor/services/session/turn_runtime.py
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-08-31 20:21:34 +08:00
XZH
7b65b9a35e fix(learner): restore profile reads 2026-08-31 01:58:19 -07:00
XZH
1fafdf48ac feat(learner): add guardian authorization 2026-08-30 23:56:02 -07:00
XZH
93d1a80310 feat(learner): add account-scoped learner profiles 2026-08-30 17:15:01 -07:00
XZH
7d9adea30b fix(learner): preserve audit root compatibility 2026-08-30 17:02:38 -07:00
XZH
b0ff5f18b7 feat(learner): add revocable device login credentials (#1116) 2026-08-30 16:59:36 -07:00
XZH
3f62d85997 feat(learner): add guardian authorization 2026-08-30 07:07:29 -07:00
XZH
8ea83989a6 feat(learner): add server-enforced account presets (#1111) 2026-08-30 06:47:11 -07:00
Bingxi Zhao (Frank)
ce7c2dc2dc release: v1.6.1 — one key, one navigator, one sidebar you arrange
Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. This release splits that
in two — a **connection** holds one vendor credential and links it down
to every service that vendor can serve, and a **task model** takes the
calls nobody asks for (naming a conversation, writing the composer's
starting points) off the model picked for actual reasoning. Both are
opt-in; existing per-service profiles resolve exactly as before.

Around that: Settings drops the card grid for a persistent searchable
navigator whose landing page answers "what state am I in" instead of
repeating the directory; Mastery Path files study conversations under
their topic and opens them in the tutor rather than dropping them on
/home; the sidebar folds features into More and reorders by drag; the
reading companion is rebuilt from /home's own chat components; and the
LightRAG engine talks to the SDK directly, so its extra no longer drags
MinerU in transitively.

Also back-merges PR #1041 (Anthropic SDK 1.x temperature via extra_body)
and PR #741 (owner-only auth secret/token files), which had been merged
straight into main and never flowed back to dev.

Release notes: assets/releases/ver1-6-1.md
Gates: pre-commit 15/15, ruff clean, pytest 5802 passed, web 450 node
tests, eslint 0 errors, docs build clean.
2026-08-30 13:19:42 +08:00
Bingxi Zhao
3f6e82405e Merge pull request #741 from lukiod/fix/secret-file-permissions 2026-08-29 11:27:40 +08:00
Bingxi Zhao (Frank)
bd9f6a7625 release: v1.6.0 — connected learning workspaces
Release notes: assets/releases/ver1-6-0.md

Ship source-faithful reading, Courses and Little Tutor, Ask Questions,
bounded web-source sync, and shared Books with private reader state.
2026-08-27 22:03:09 +08:00
Bingxi Zhao (Frank)
bd80a4d28a release: v1.5.17
Partners stop being a deployment-wide admin resource and become
per-user: three nested rights (manage / use / neither) replace the
blanket admin gate on the router, each member can build and own their
own, and every person's conversations with a partner stay private to
their account. Grants keep working and now offer only admin-managed
partners. Channel runtime state moves from one directory per channel to
one per partner — copied, not moved, and only when its owner is
unambiguous — so two partners can finally run the same channel.

Around that: a knowledge base can track GitHub repositories and re-sync
their Markdown (#903); Antigravity CLI joins My Agents now that Gemini
CLI is retired (#828); personal WeChat signs in from a QR code drawn in
the browser instead of the server log (#951); a chat account can be
linked to a DeepTutor account with /link; containers re-apply the extras
they declare instead of losing them at compose down (#762); and
`deeptutor doctor` answers whether a workspace is ready to run (#959).

Reliability, largely from community PRs: embeddings survive a
rate-limited provider through key rotation, a retry budget and a global
throttle (#962); MinerU parsing and code execution work on Windows
(#844, #964); indexing fails bounded instead of hanging (#946); MinerU
page-layout blocks stop being indexed as content (#949); voice uploads
carry a MIME the transcription API accepts (#945); and reasoning effort
can be overridden per conversation (#641).

Release plumbing: notes in assets/releases/ver1-5-17.md, v1.5.13
archived, __version__ 1.5.17, README Releases row and all eleven
translations synced.

Two defects found by the release gate and fixed here:

- Six partner routes — the four channel-onboarding endpoints and both
  WeChat QR endpoints — kept the _auth-only mount they had inherited
  from the blanket admin gate, so any signed-in account could start a
  QR login for someone else's partner and write a bot token into its
  channel config. All six now declare _MANAGEABLE, and a sweep test
  asserts no {partner_id} route is left ungated.
- A configured api_key became `str | list[str]` when key rotation
  landed, but ten call sites pass it somewhere that takes one key; a
  list would have rendered into an Authorization header verbatim.
  keypool.primary_api_key reduces at each boundary.

Gates: pre-commit (all 15 hooks), ruff check + format, pytest
5276 passed, web 605 node tests, docs build.
2026-08-25 02:24:35 +08:00
Souptik Chakraborty
a5879735b7 fix: Keep env-bootstrapped admin usable and unpromoted (#851)
The identity store had two bugs that combined into a lockout for
deployments whose admin comes from auth.json rather than /register.

load_users() returned the bootstrap admin only when the store was empty,
so writing the first real account dropped it and the operator's login
started returning 401. save_user() then decided first-admin promotion
from load_users() called with no env arguments, an env-blind view, so
with an empty store the first account an admin created from /admin/users
was silently promoted to admin even though that endpoint documents
role="user". Together: create one student account, the student is the
only admin, the operator is locked out.

load_users() now merges the bootstrap admin whenever it is configured; a
stored record with the same username still wins, so the account can be
adopted into the store. The merge stays in memory because no write path
passes the env arguments, so a rotation of auth.json is never shadowed by
a stale persisted hash. save_user() counts a configured bootstrap admin
as an existing account, except when saving that same username, which is
an adoption and keeps the admin role.

The genuinely-empty deployment is unchanged: with no bootstrap
credentials the first /register user is still promoted. A username
configured with an empty hash cannot authenticate and so does not count,
which matters because that is the shipped default.

Fixes #849
2026-08-16 19:07:52 +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
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