Follow-up refinements on top of #579 (deny MCP tools until explicitly
granted), tightening decoupling and front/back consistency:
- Decouple: extract the duplicated `metadata.source == "partner"` check
(deferred-tools, exec gate, tool composition, cron owner routing) into a
single `AgenticChatPipeline._is_partner_turn` helper, so the partner
authority-via-metadata contract has one definition instead of four
inline copies.
- Frontend parity: the backend now denies MCP for non-admin users when the
grant omits `mcp_tools`, but GrantEditor still showed `null` as
"Default · all" / "all MCP". Make ModeSwitch's default-mode label
caller-supplied, label the MCP section "Default · none" / "no MCP", and
add a one-line rationale so admins are not misled into granting nothing.
Built-in optional tools keep `null = all`; only MCP tools fail closed.
Tests: ruff clean; pytest multi_user/mcp/partners/chat (545 passed);
web tsc + eslint clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up nits on the #573 profile/avatar work:
- UserAvatar: validate an icon marker's icon/color against the known sets and
fall back to the deterministic avatar for unknown values. The backend
_ICON_MARKER_RE accepts any [a-z0-9-] color, so a hand-set marker like
"icon⭐bogus" previously rendered an invisible avatar
(AVATAR_COLORS[unknown] === undefined).
- ProfileLink: pass role to UserAvatar so admins get the amber ring in the
sidebar, matching the "amber ring at every size" intent.
- useAuthStatus: share one in-flight /api/v1/auth/status request across the
hook's consumers (sidebar Admin/Logout/Profile links) so a page load makes a
single call instead of one per consumer; cleared once settled so a later
mount (after login/logout) refetches.
Verified: tsc, eslint, web node tests (142).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Self-service /profile page (account info, icon/image avatar, sign out)
implementing the profile half of #553. Contributed by @IliaAvdeev.
Integration performed during merge onto current dev:
- Migrate ProfileLink and the profile page off the removed AUTH_ENABLED
build-time export to runtime auth status (auth.ts was refactored on dev
by #577). ProfileLink reads the full status via fetchAuthStatus (it needs
username/avatar, which the useAuthStatus hook does not expose); the page
gates on status.enabled.
- Resolve en/zh locale conflicts as a union of dev and PR keys.
- Honor EXIF orientation in createImageBitmap so the primary decode path
matches the <img> fallback.
- Drop an unreachable AUTH_ENABLED render guard in the profile page.
Verified locally: tsc, eslint, ruff, web node tests (142), pytest
tests/multi_user (81 passed).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two gaps in the PR's frontend changes:
1. Client auth awareness was permanently false. api.ts/auth.ts read
process.env.DEEPTUTOR_AUTH_ENABLED in browser code, but Next.js only inlines
NEXT_PUBLIC_ vars into the bundle — so the Sign-out / Admin affordances never
rendered and apiFetch's 401 -> /login redirect never fired when auth was on.
Resolve auth state at runtime from the backend instead: fetchAuthStatus()
records it via setRuntimeAuthEnabled(), and components observe it through the
new useAuthStatus() hook. Works on Docker (read-only rootfs), PyPI, and dev
with no build-time baking. (The server-side gate in proxy.ts is unaffected.)
2. KB document uploads >10MB were truncated. All /api/* now flows through the
proxy, whose body buffer defaults to 10MB while the backend accepts 100MB
(DocumentValidator.MAX_FILE_SIZE). Raise experimental.proxyClientMaxBodySize
to 110MB so uploads aren't silently cut off.
Adds a regression test that a 401 does NOT redirect when auth is disabled.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Settings polish and a Mastery -> Question Bank link:
- Search settings show only the connection fields the selected provider uses
- Connection profiles can be renamed and auto-name after their provider
- Graded Mastery Path questions sync into the session Question Bank
- Fix untranslated Settings-tour Tools step (en/zh) + guard test
- Refresh README / translated READMEs for the current v1.4.6+ UI
Bump __version__ to 1.4.9, add assets/releases/ver1-4-9.md, restore the
v1.4.7/v1.4.8 README rows dropped by an earlier docs-update commit, and
compress every README release row to <=30 words.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Partners become consultable agents and gain their own memory.
- My Agents now lists your Partners next to local Claude Code / Codex;
connect one and the turn runs on `consult_subagent` against the
partner's own chat loop, streaming its trace live. Every consult in a
DeepTutor chat threads into one archived partner session.
- Partners get a split memory model via three always-on tools that
replace chat's read_memory/write_memory on partner turns:
partner_read (owner shared + own), partner_memorize (own only),
partner_search (own history). The per-Partner memory toggles are gone.
- A `partner:` history reference resolves a partner transcript
(admin-only) into a DeepTutor chat as third-party context.
Release-prep fixes for a clean CI parity run:
- partner.py: replace mypy-misparsed `# type:` dict-entry comments with
a proper variable annotation.
- claude_models.py: `# nosec B606 B607` on the PATH-resolved `os.execvp`
in the forked PTY child (no shell; pre-existed since v1.4.7).
Bump __version__ to 1.4.8, add assets/releases/ver1-4-8.md, README row.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The frontend no longer bakes the backend URL into the bundle at build
time and mutates it with sed on every container start. Instead:
* web/lib/api.ts: apiUrl and wsUrl become one-line pass-throughs, so
the browser fetches relative paths through the frontend
(:3782/api/...). All existing call sites keep working unchanged.
* web/proxy.ts: catches /api/* and /ws/* and rewrites them to
DEEPTUTOR_API_BASE_URL at request time, reading
DEEPTUTOR_AUTH_ENABLED for the auth-redirect check.
* web/lib/auth.ts: switches from NEXT_PUBLIC_AUTH_ENABLED (build-time)
to DEEPTUTOR_AUTH_ENABLED (set by the entrypoint on every start).
* Dockerfile: drops the .env.local placeholder block, the sed -i in
start-frontend.sh, and the runtime API-base fallback chain. Adds
gosu, bakes a non-root 'deeptutor' user (UID 1000), and has the
entrypoint chown /app/data and export DEEPTUTOR_API_BASE_URL and
DEEPTUTOR_AUTH_ENABLED from data/user/settings/*.json on every
start. supervisord is now invoked under 'gosu deeptutor'.
* web/tests/api-resolve-base.test.ts: deleted (its 8 tests reference
resolveBase / isApiBasePlaceholder, both gone; apiUrl/wsUrl are
now pass-throughs so the rest is meaningless). The auth-redirect
test is updated to prime DEEPTUTOR_AUTH_ENABLED instead.
A broad consolidation release across four product surfaces.
- Learning Space: Space becomes a learning dashboard; My Agents imports
local Claude Code / Codex chat history into resumable agents (with an
objective explore_context briefing so the tutor never role-plays the
user); Memory is promoted to a top-level /memory route; Partner
conversations flow into Memory; EduHub skills install inline.
- Knowledge Center: /knowledge rebuilt as a console with per-engine
detail pages; GraphRAG / PageIndex / LightRAG engines join LlamaIndex;
linked-KB read-only mounts; Obsidian live-vault capability.
- Settings: pluggable document parsing (MinerU / Docling / MarkItDown)
with a content-addressed cache and MinerU cloud/local backends; voice
TTS/STT; image & video generation; rebuilt settings navigation.
- Platform: per-user capability gating by assigned model; Solve rebuilt
on the chat loop with a per-step gate and mid-run failure fallback;
username login + inline errors; CLI skill publish/update; picker
polish; math-before-citation render fix.
Docs were split out to a standalone site, so site/ is now landing-page
only. Bumps __version__ to 1.4.6 and adds assets/releases/ver1-4-6.md.
Folds in mypy fixes surfaced by pre-commit (mineru/local Path typing,
knowledge/manager no-redef, explore_context token kwargs, CLI
set_dist_tag capability probe) plus prettier reformatting of
previously-committed web files.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The turn path (chat/partners/mastery via turn_runtime) already enforces
LLM-grant access at its single enforcement point and surfaces a clear
terminal "no model assigned" rejection — so require_llm_access was never
wired to any endpoint and only duplicated that logic. Drop it (and its
guard-only tests) and have turn_runtime reuse has_capability_access, giving
the gate one source of truth shared with the frontend lock.
Frontend fixes kept from the original PR plus two corrections:
- capabilityForPath now matches on a path-segment boundary, so a sibling
route like /booket can't be swallowed by the /book prefix (+ regression).
- fix the misleading Knowledge sidebar comment — Knowledge needs no
per-user grant and is never gated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Guided Learning is rebuilt on the chat agent loop: the bespoke stage
machine is gone, replaced by a tutor chat driving a hard, per-type mastery
gate, with the /learning page reworked into a status dashboard. Existing
learning progress loads unchanged.
A new loop-plugin framework (deeptutor/loop_plugins/) makes the chat loop
extensible — mastery is the first plugin, contributing its tools, system
block, and server-owned kwargs without the pipeline hard-coding it — and
the loop gains context-checkpoint folding. Partner Chat/Archive
conversations gain Markdown export + save-to-notebook (one shared
serializer), and every chat turn now signals done the moment the answer is
saved so the composer/clock free up before title generation.
Bump __version__ to 1.4.5, add assets/releases/ver1-4-5.md, archive notes
older than two weeks into past_releases/ (fixing the one cross-link that
crosses the boundary), and add the README release row.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A focused cut on top of v1.4.3:
- Skill hub: install community skills from ClawHub (and any compatible
registry via settings/skill_hubs.json) — provider abstraction in
services/skill/hub.py, new `deeptutor skill search/install/list/remove`
CLI, admin-only install endpoint for multi-user (install ≠ assign).
Every import runs a security gate: hub verdict check, zip-slip/zip-bomb
guards, text/script suffix whitelist, `always:` frontmatter stripped,
provenance recorded in .hub-lock.json.
- KB previews: new /knowledge/{kb}/file-preview-text/{filename} endpoint
serving extracted plain text; KB Files tab renders real in-browser
DOCX/XLSX previews; DOCX previewer scales pages to fit narrow panels.
- Markdown previews allow safe raster data:image URLs on <img src>
(react-markdown strips all data: URLs by default); script-capable
schemes stay blocked.
- All ten localized READMEs re-synced with the English README.
- Docs (deeptutor.info): `deeptutor skill` reference, hub-install notes on
Space and multi-user pages, KB file routes in the server API table
(en + zh).
- CLI docs contract test updated for partner/skill subcommands.
Release notes: assets/releases/ver1-4-4.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- telegram: send_delta via progressive edit_message_text (throttled,
flood-control retry, HTML final render, mid-stream overflow split)
- discord: send_delta via REST POST/PATCH with rate-limit retry; send()
now raises on failure so the manager retry applies
- feishu: send_delta via CardKit streaming cards (create → sequenced
stream updates → close streaming_mode, regular-card fallback)
- registry: discover_all_with_errors keeps import-failed channels
diagnosable; schema API marks them available:false with the reason;
UI grays them out and shows the missing-dependency message instead
of silently dropping them (the "why is X missing?" class of bugs)
- 10 new streaming contract tests; 343 partner tests green; tsc clean
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fullscreen was broken for every render type, two root causes stacked:
- The overlay used position:fixed but rendered inside the message bubble,
whose ancestors (streaming animation transforms, chat scroll root) break
fixed positioning — inset-0 resolved against the bubble and the composer
stacked above the overlay. Render via createPortal(document.body).
- Content was fit to width only, so figures outgrew the viewport
vertically, and items-center + overflow made the top edge unreachable.
Now: m-auto centering (small content centers, oversized content scrolls
from its start edge); svg (ours + mermaid) clamps max-height and
letterboxes via the default preserveAspectRatio; Chart.js caps the
wrapper WIDTH so its own 2:1 aspect scaling lands within the viewport
(CSS-clamping the canvas would squish the bitmap). The chart wrapper's
inline maxHeight moved to .dt-chart-wrap so fullscreen can override it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Finishes the visualize overhaul (517c90b backend + b499ba7 frontend).
- Book figure/interactive now share the chat path: deterministic local
validate_visualization, one targeted repair on failure (figure), and
GenerationFailure on residual invalidity so the book engine retries
instead of baking a broken figure/placeholder into the book.
- Delete the now-dead open-ended LLM review: pipeline.run_review and the
review prompts (review_agent.yaml keeps only repair_system/
repair_user_template). ReviewAgent's process() IS the repair pass now
(BaseAgent.process is abstract, so repair was renamed, not stubbed).
- Prompts: drop the 'split into an overview plus a detail figure' wording
that contradicted the single-<svg> policy; add a text vertical-centering
rule (y = box center, host centers via CSS) and a visual_genre fallback
line. en + zh kept in sync.
- svg-theme.css: dominant-baseline: central on .dt-svg-root text — the
host guarantees vertical centering so the model never has to emit (or
misspell) dominant-baseline itself.
- tests: replace the stale FakeReview/run_review fake with a valid-svg
no-repair path in test_capabilities_runtime.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- SvgRenderer: <img> data-URI -> sanitized inline DOM. Dependency-free
sanitizeSvg strips script/foreignObject/on*/js-urls and scopes element ids +
url()/href/aria refs so multiple inlined svgs don't collide. Multi-<svg>
content is split into independent figures.
- svg-theme.css: themed class system (t/ts/th, box/node/arr, c-* 9-ramp)
following light/dark via CSS vars and the app Geist font; svg sized width:100%
by viewBox to avoid the 300x150 inline collapse.
- HtmlRenderer: iframe height auto-fit + receives the widget's sendPrompt.
- iframe-html.ts: inject the sendPrompt bridge + a ResizeObserver height report.
Frontend visualize only — the chat page.tsx composer-prefill listener is left in
the working tree alongside the unrelated chat changes there.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>