10 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
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)
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)
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.
2026-08-07 22:28:33 +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
iwedo
4de4f5e9c9 fix: 系统性修复多用户数据隔离问题
核心问题:
1. HTTP请求的用户上下文仅依赖require_auth依赖,中间件层无保障
2. WebSocket端点(tutorbot/vision_solver/question/knowledge/book)缺少手动认证
3. CoWriterStorage在__init__中固定path_service,单例后路径不再变化
4. get_path_service()静默降级到默认实例,无日志

修复内容:
- 添加user_context_middleware中间件,确保每个HTTP请求都正确设置用户ContextVar
- 添加ws_require_auth()统一WebSocket认证函数,所有WS端点使用
- 修复tutorbot/vision_solver/question/knowledge/book的WebSocket认证
- 统一chat/solve/unified_ws的WebSocket认证为ws_require_auth()
- CoWriterStorage改为@property延迟获取path_service + 按workspace缓存
- get_path_service()降级时输出warning日志
2026-05-12 15:32:57 +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
Bingxi Zhao (Frank)
9c18bf0705 codebase cleanup and decoupled, introduce cli operation 2026-03-13 20:42:16 +08:00