Local dev repairs for #2586.
OAuth owner isolation and refresh-token stability verified. Hook polls until connected, refreshes on focus and stops on unmount. Python rechecks: 56 passed; UI batch: 25 passed. Web typecheck, 1407 Node tests, eslint and i18n passed.
Combine Hungarian with Italian UI and Hindi reply-language registries; translate 49 newly integrated keys and add the Hungarian endonym to Italian. Regenerate router and frontend contracts. 33 Python locale tests, full Node suite and locale parity pass.
Make Italian quality tests compatible with CommonJS Node test compiler; accept Italiano as reply-language alias; translate 48 keys added by other integrated PRs; regenerate router index and format i18n. 26 Python locale tests and full Node suite pass.
Retain admission error text and localized model-access guidance; allow explicit retry to revalidate access instead of permanently blocking stored messages. No automatic retry on reload. Backend tests and both manual retry paths passed.
Validate chapter existence, spine presence, and protected overview deletion before claiming a revision; cover failed edits followed by valid retries (22 passed).
Adding the four chapter routes changed the router source fingerprint, so
the tracked lazy-routing index must be rebuilt via scripts/build_router_index.py
to keep test_repository_index_matches_router_sources green.
Add / rename / reorder / delete chapters after generation through REST
endpoints mirroring the block-CRUD handlers. New chapters are pending
shells; already-compiled pages are never recompiled or discarded. Each
edit carries the chapter's order/title onto its pages so the reader-visible
sequence follows, and delete prunes only its own pages plus the concept
graph, prerequisites, and progress refs.
Part of #2571
POST /api/space/mcp/servers/{name}/test discarded the path name, so a
probe of an OAuth-backed server built its token store with '' and every
Test answered "ValueError: Unsafe MCP server name for an OAuth store: ''"
— including for a server that was authorized and connected.
probe_server now takes a server_name (the name the saved connection
would address the grant under) and the space router passes the path
name for OAuth configs. A scratch name no grant could live under (an
unnamed draft) is answered the way an unauthorized server is instead of
the store's refusal; non-OAuth probes stay nameless as before.
Fixes#2587
Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
A rejected POST /api/books/{id}/refresh-fingerprints (force=false, stale
pages not yet recompiled) bumped and persisted book.revision before the
engine refused it, so the client's expected_revision went stale and the
force=true retry always lost the revision race (409 forever).
Run the engine's refusal check (new read-only preflight
check_refresh_kb_fingerprints -> ensure_can_refresh_fingerprints) before
_claim_content_mutation; a rejected dismissal is now side-effect free and
the force retry with the same expected_revision succeeds. Regenerate the
router index fingerprint.
Addresses Air R1/R2 review blockers on top of the opened PR head:
Settings GET/PUT /api/settings/web-fetch with UI control; DeepSeek fetch
uses identity encoding, raw bytes, and capacity checks before buffer extend;
provider-branding treats `local` as generic.
Air Codex R3 on MacBook Air: READY.
The authenticated-request dependency takes a shared lease on
workspace-activity.sqlite3 for the whole ASGI call, and the middleware
releases it when that call returns. A streaming response only returns when
the stream ends, so an indexing-progress SSE held the lease for as long as
its tab stayed open -- and when the indexed task never starts (see the
preceding commit) that is indefinitely.
Every exclusive workspace operation (KB move, registration update, data
migration) then answered 'Workspace data is busy' until the backend was
restarted, because acquire_activity() uses timeout=0 and a leaked shared
lock never expires.
Task-board events and the calendar stream were already excluded for this
reason; the knowledge-base task progress stream reads only in-memory task
state and is equally safe to exclude. A failing task therefore no longer
locks the workspace it cannot even reach.
Regenerate the router index for the changed router sources.
Fixes#2525
workspace_id_for_kb_base_dir() walks every registered workspace to find the
one that owns a KB directory, and it runs on every upload, folder sync and
reindex. A registration whose folder no longer exists (archived leftovers, a
directory the user moved) raises WorkspaceError on entry, which aborted the
whole lookup and dropped the storage scope from the background task.
Because WorkspaceError is a ValueError, the upload/sync routes then answered
404 'Knowledge base <name> not found' for a KB that exists, the background
task was never registered (the call sits in add_task's argument list), and
the KB kept the progress entry written just before it, so the UI showed an
endless 'scanning' state with no error on disk.
- skip registrations that cannot be entered instead of aborting the scan
- resolve the scope before copying files or marking the KB queued, so a
failure cannot leave a task-less progress entry behind
- surface WorkspaceError as 409 with its real message instead of a 404
Fixes#2524
Add Hindi (hi, हिन्दी) to the reply-language contract, following step 4
of docs-for-dev/I18N.md and the earlier Malay change (550268e1):
- SUPPORTED_RESPONSE_LANGUAGES, the settings router's ResponseLanguage,
the prompt-language label and the settings-spec reply choices;
- "hindi", "हिन्दी" and "हिंदी" aliases in the backend and web
normalizers (hi-IN and hi_IN resolve through the base code);
- the web ResponseLanguage type, isResponseLanguage() and
RESPONSE_LANGUAGE_OPTIONS, which the partner picker shares;
- regenerated frontend contracts, and tests mirroring the Malay change.
The interface language is unchanged: no web catalog or picker entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a complete Hungarian (hu) locale alongside the existing catalogs, wired
through every seam a language has to pass so none of them silently serves
English to a Hungarian reader.
Frontend: the hu catalog covers all 6,584 English keys with matching
interpolation placeholders, registered in the locale registry, the lazy bundle
loader, Intl date/number formatting (hu-HU) and the reply-language picker.
`language.hungarian` ("Magyar") is added to every existing catalog so the
endonym is shown whatever the current interface language is.
Backend: "hu" is accepted by the launch, interface and reply-language
normalizers and offered in both settings choice lists, named in the prompt
language labels, and carries the Hungarian copy of the CLI-app, MCP and
sandbox messages, the quiz-judge prompt, the book export labels, the book
overview front page and the voice language list.
Scope: the CLI installer banner (`deeptutor/runtime/banner.py`) keeps its
English text for hu and falls back through `_pick_language`; it is terminal
setup copy unused in server deployments and is left for a follow-up.
Evidence:
- `python -m pytest tests/i18n/test_hungarian_locale.py` — 33 passed
- `npm run test:node` — 1353 passed (adds hungarian-locale-quality.test.ts)
- `npm run typecheck` — clean
- `node scripts/i18n_parity.mjs` — OK
- `node scripts/i18n_audit.mjs` — hu: 4529/4529 used keys (100.0%), strict
- `node scripts/generate-contracts.mjs --check` — no drift
- `ruff format --check` / `ruff check` on the touched Python files — clean
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The quiz judge stripped the data: prefix from a submitted answer image and
re-guessed the MIME from the filename, so a JPEG photo sent as
data:image/jpeg with the default answer.png filename was relabelled
image/png and rejected by strict vision providers. Parse the media type
from the data URL and prefer it over the filename guess (an explicit
mime_type field still wins); same fix for the legacy single-image branch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
safe_extract_zip refuses to replace a document the knowledge base
already holds, but _save_zip_archive let the FileExistsError escape, so
the upload failed with "Validation failed for file 'course.zip':
[Errno 17] File exists: '<absolute server path>/raw/chapter1.md'": an
OS error instead of a reason, and the server's directory layout handed
to the client.
Catch it next to the other archive rejections and say which member
clashes and what to do; still 400, the existing file still untouched.
Immersive Reading extracts documents synchronously — an EPUB walks its whole
spine and a PDF renders every page through PyMuPDF — but the router called that
work directly from its async handlers. The API runs one event loop per worker,
so a document being opened or uploaded parked every other request: the session
title and transcript of the conversation being switched to, progress polling
and cancellation all waited behind the parse (#2054).
Run the upload extraction and the material detail build through
asyncio.to_thread, matching how the rest of this router and
capabilities/reading/tools.py already call the same store API.
Also load the outline once. _detail() read it, then render_outline() read it
again; for an EPUB whose stored rows still lack publisher anchors each read can
re-parse the whole package through _upgrade_epub_outline. Rendering is split
into format_outline(manifest, entries) so the rows already loaded are reused,
and render_outline() keeps its signature for existing callers.
Regenerated the router index fingerprint for the changed router source.