9 Commits

Author SHA1 Message Date
evan188199-tech
0802510450 fix: log silently swallowed failures in five services (#1707)
* fix(codex): log a warning when token revocation fails during logout

Logout previously swallowed revocation failures silently, leaving the
remote token possibly valid with no operator trace. Log only the error
kind and HTTP status (never credential material) and keep clearing the
local credentials as before.

* fix(llm): warn when CodeBuddy tool-call interrupt or drain fails

A silent except-pass after receiving tool_calls let the SDK keep
generating in the background when interrupt() failed, quietly draining
quota. Log a warning (exception type + short reason) for interrupt and
drain failures; return value semantics unchanged.

* fix(memory): log corrupt snapshot files instead of skipping silently

read_notebook_entities / read_cowriter_entities / read_book_entities
swallowed (OSError, json.JSONDecodeError) with a bare continue, so a
corrupt notebook file or manifest silently dropped content from the
memory snapshot. Each skip now logs a warning with the file path and
reason (no file content); snapshot results are otherwise unchanged.

* fix(notebook): log unreadable files instead of skipping them silently during index rebuild

* fix(question): log failed error-event delivery in mimic websocket

The mimic generation error handler swallowed secondary failures of the
error send_json with a bare 'except Exception: pass', so a delivery
failure left the frontend without any reason and nothing in the logs.
Split the handler: closed/disconnecting clients (RuntimeError,
WebSocketDisconnect) stay debug-level, any other send failure is logged
as a warning with traceback. Cleanup paths keep their best-effort
narrow handling. Focused tests cover both branches.

* test(codebuddy): make credential fixture expiry relative to now

test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.

Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:37:27 +08:00
evan188199-tech
d7a8610731 test(question): pin mimic websocket error-path and stdout interceptor failure contracts (#1741)
* test(question): pin mimic websocket error-path and stdout interceptor failure contracts

Failure-injection characterization tests for the two DT-22 HIGH findings on
websocket_mimic_generate: the outer error broadcast swallow and the
StdoutInterceptor terminal-write swallow (ex-TeeWrite). Pins that send/write
failures stay isolated, process stdout is always restored, and the websocket
still closes. 现状豁免 recorded in docstrings: the swallows are silent by
design today; surfacing them is a code change outside this test-only card.

* style(tests): reformat question router mimic websocket test for ruff format

---------

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:12:37 +08:00
Bingxi Zhao (Frank)
6e6e56aedb release: v1.6.3
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.

Release notes: assets/releases/ver1-6-3.md
2026-09-02 04:09:11 +08:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +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
Bingxi Zhao (Frank)
2c4769a96f prepare v1.3.8 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-08 02:36:24 +08:00
Bingxi Zhao (Frank)
824bf778df fix: lint & logging system 2026-05-01 01:39:08 +08:00
Yizuki_Ame
d84505ea22 fix: add missing imports for mimic websocket router
Signed-off-by: Yizuki_Ame <yinzimike@gmail.com>
2026-04-07 02:19:22 +08:00