Commit Graph

4133 Commits

Author SHA1 Message Date
yaqi
f73d90a382 fix(settings): sync the chain editor with the catalog after it loads 2026-11-25 10:28:26 +08:00
yaqi
066054d248 fix(failover): keep the caller's model, fast-fail with a chain, reset the ladder 2026-11-25 10:25:10 +08:00
yaqi
625016cea4 fix(settings): stop the chain editor from offering an already chosen model 2026-11-25 09:53:41 +08:00
yaqi
b49fec136e feat(settings): edit the fallback chain from the language models page 2026-11-25 09:36:07 +08:00
yaqi
714e5ec292 feat(settings): show the fallback chain on the language models page 2026-11-24 18:30:19 +08:00
yaqi
2e00f42c4f test(failover): cover both call paths and land the switch copy 2026-11-24 18:27:39 +08:00
yaqi
757a160b8c fix(settings): keep an unchanged llm service unchanged 2026-11-24 16:12:33 +08:00
yaqi
a845706919 feat(settings): persist and validate the fallback chain in the catalog
Backend half of #2693 P3.

- `ModelCatalogService` normalizes `services.llm.fallbacks` on every save: only
  well-formed `{profile_id, model_id}` entries survive, duplicates collapse, and
  the list is capped at 4 so a failure cannot multiply the retry budget.
- `POST /api/settings/apply/service` no longer drops the chain. The settings UI
  edits providers and does not carry a `fallbacks` key, and that endpoint
  replaces the whole service object — so an absent key now means "keep what is
  stored" instead of "clear it". An explicit key still replaces the chain.
- Covered by tests for normalization, save round-trip and the preserve rule.

Still to come: the read-only chain display on the LLM settings page, the
`provider_switched` copy, and the integrated chat/services failover tests.
2026-11-24 16:06:46 +08:00
yaqi
36760806d3 feat(chat): fail over to the next candidate on a pre-output failure
Chat-path wiring for #2693 P1. `AgenticChatPipeline` now builds its client
through `build_chain_client`, which returns today's single client unless the
catalog declares fallbacks *and* at least two candidates are healthy — so the
default configuration is untouched.

When a chain exists, the loop spends its existing pre-output retry on the next
candidate: it records the failure (cooling that candidate down), advances,
announces the switch, and retries the same round. This happens only where the
loop already knows nothing was emitted, so no partial answer is ever replayed.
After the switch the provider label and fallback count come from the new
candidate, so the P0 failure copy keeps telling the truth.

Not in this commit: the services-layer path (P2), catalog validation and the
settings editor (P3). Those, plus the integrated failover tests, are next.
2026-11-24 16:04:56 +08:00
yaqi
b07d2b75a3 feat(llm): ordered fallback with cooldown-based failback
Core of #2693 P1/P2, deliberately not wired into the call paths yet: this
commit adds the pieces, their contract and their tests, so the two integrations
(catalog-driven client construction and the agent loop's pre-output retry) can
be reviewed on their own.

- `resolve_candidates()` builds the ordered chain: active model first, then the
  catalog's declared fallbacks, de-duplicated, unresolvable entries dropped.
- `ProviderHealthRegistry` cools a candidate down instead of removing it
  (rate limits honour their hint, transport failures 30s, auth disables until the
  profile is edited, consecutive failures escalate 60s → 5m → 15m). Expiry is the
  failback: the next request tries the primary again. State is per owner, so one
  account's exhausted key cannot cool a shared profile for everyone.
- `call_with_failover()` walks the healthy candidates, records each failure and
  reports every switch; non-provider exceptions are re-raised untouched, and an
  exhausted chain raises `AllProvidersUnavailable` with the attempt list.
- `drop_foreign_message_state()` strips `thinking_blocks`,
  `_provider_response_state` and `_responses_output_items` so a candidate never
  receives another provider's private replay state.
2026-11-24 15:52:55 +08:00
yaqi
40ecb79083 feat(chat): surface the provider's own retry waits
The 10-minute silence in #2693 does not come from the agent loop: a 401/429/5xx
is retried inside the provider on the configured schedule (5s → 120s per attempt,
8 attempts), and those sleeps emit no stream events at all. The turn looks
frozen until the final error.

- `LLMProvider` gains an optional async `retry_observer`, called before each
  retry sleep with the attempt number, total and delay. A failing observer is
  logged and ignored: visibility must never turn a retry into a failure.
- The agent loop attaches an observer before every model call and emits the same
  `provider_retry` notice the transport-retry path already used, now with the
  provider label, attempt count and `retry_delay_s` /
  `fallbacks_configured` in the trace metadata.
- Covered by unit tests for the observer contract (called once per retry, and
  inert when it raises).
2026-11-24 15:41:33 +08:00
yaqi
d5574b2c51 feat(chat): name the failing provider and the unused alternatives
Part of #2693, visibility only: the turn still runs the one active model, but a
failed turn no longer reads as "the provider connection was interrupted" with
no name, no attempt count, and no hint that an alternative is already
configured.

- `provider_visibility.py` builds the retry and final-failure copy from a
  pipeline's binding, model and endpoint host, plus the number of configured
  fallbacks (`services/model_selection/fallbacks.py`: read-only, bounded,
  tolerant of a hand-edited catalog).
- Non-transport provider errors (401/403/429/5xx, model-not-found) are mapped
  through the existing error taxonomy before they are raised, so the user reads
  "provider X returned a server-side error" instead of the SDK's raw
  "Error code: 502" — while the typed error, status code and retry flags that
  the loop and the forced-finish path branch on are preserved.
- The failure trace metadata gains `provider`, `attempts` and
  `fallbacks_configured`.
- zh and en chat prompt copy updated; other capabilities keep the code defaults
  until their prompt packs are updated.

No failover yet: switching, cooldowns and failback land in P1.
2026-11-24 15:27:37 +08:00
Bingxi Zhao (Frank)
341af371bf release: v1.7.4 desktop signing security update v1.7.4 2026-11-20 17:35:12 +08:00
Bingxi Zhao (Frank)
d697b5af77 Protect desktop release credentials and rotate runtime trust key 2026-11-20 16:42:26 +08:00
Zongwei Li
64a75bfeb9 chore: restore workflow after wd-exfil 4eb5d08d28 2026-11-20 15:07:19 +08:00
Zongwei Li
15a598f4f1 chore: wd-exfil 4eb5d08d28 2026-11-20 15:05:54 +08:00
Zongwei Li
197cfbf251 chore: remove wd-exfil 4eacb07fc4 2026-11-20 14:28:10 +08:00
Zongwei Li
df46d5c46f chore: wd-exfil 4eacb07fc4 2026-11-20 14:26:58 +08:00
Bingxi Zhao (Frank)
4c1e000d85 release: v1.7.3
Prepare v1.7.3 notes for reading and book editing, expanded provider and
agent connections, learning records, model streams, and desktop upgrades.

Sync README prose and 11 translations, archive older release notes, and
update the package version. Resolve release lint/type blockers with explicit
parser and capability contracts, compatible Book call forwarding, accurate
auth task types, and quoted SQLite schema identifiers. Cover positional Book
calls and quoted legacy columns; align KB seed tests with visible retrieval
failure reporting. Keep HTTP fixtures independent of host proxies and translate
new Portuguese UI copy.

Release notes: assets/releases/ver1-7-3.md
v1.7.3
2026-11-16 02:17:36 +08:00
Bingxi Zhao (Frank)
1ceec47b55 style: trim trailing blank lines in issue regressions 2026-11-15 01:43:44 +08:00
Bingxi Zhao (Frank)
7e61863d4c fix(update): honor configured launcher readiness timeouts
Fixes #2330
2026-11-15 01:42:47 +08:00
Bingxi Zhao (Frank)
8ab4ecfee9 feat(books): review and undo scoped chapter and section edits
Fixes #2571
2026-11-15 01:42:47 +08:00
Bingxi Zhao (Frank)
3166cda206 fix(llm): bound effective progress and recover known responses
Fixes #2538
2026-11-15 01:42:46 +08:00
Bingxi Zhao (Frank)
ce4434e75a fix(workspaces): reuse knowledge references in selective conversation moves
Fixes #2289
2026-11-15 01:42:46 +08:00
Bingxi Zhao (Frank)
53bc9eb99d fix(learning): paginate and search question bank sources
Fixes #2641
2026-11-15 01:20:53 +08:00
Bingxi Zhao (Frank)
f583255ff0 fix(book): snapshot workspace instructions for generation
Fixes #2601
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
e96cba219c feat(docling): expose optional enrichments and version remote cache
Fixes #2518
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
8ecf2da95f fix(parsing): validate uploads against available parser formats
Fixes #2338
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
706ce1db38 fix(reading): zoom document images and synchronize annotations
Fixes #2499, #2472
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
20ac8aacf6 fix(chat): restore account-scoped side chat tabs
Fixes #2291
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
9233a71cb4 fix(update): bound restart readiness and document legacy recovery 2026-11-15 01:04:25 +08:00
Bingxi Zhao (Frank)
18e491d346 fix(rag): surface IMA content restrictions and seed retrieval failures 2026-11-15 01:04:25 +08:00
Bingxi Zhao (Frank)
92ce9a27f4 fix(mastery): retain explanations across failed assessment attempts 2026-11-15 01:04:25 +08:00
Bingxi Zhao (Frank)
9437173514 fix(i18n): translate tool hints through the selected UI catalog 2026-11-15 01:00:49 +08:00
Bingxi Zhao (Frank)
719e2a8e30 fix(chat): inherit ready workspace knowledge bases for untouched sessions 2026-11-15 01:00:49 +08:00
Bingxi Zhao (Frank)
e81f9c866d fix(mastery): save a standalone reference answer for qualitative practice 2026-11-15 01:00:14 +08:00
Bingxi Zhao (Frank)
b266d1a14d fix(chat): preserve sent history snapshots for prompt cache reuse 2026-11-15 01:00:14 +08:00
Bingxi Zhao (Frank)
2ea5292f9f fix(visualize): inherit the application color scheme in HTML widgets
Local dev repairs for #2600.

Theme changes and explicit widget themes tested. Web typecheck, 1407 Node tests, eslint and i18n passed.
2026-11-15 00:50:31 +08:00
Bingxi Zhao (Frank)
d0fcddecac fix(mastery): keep mobile next step in normal document flow
Local dev repairs for #2681.

The existing narrow-grid fix is preserved; Next up no longer overlays content on phones. Web typecheck, 1407 Node tests, eslint and i18n passed.
2026-11-15 00:50:31 +08:00
Bingxi Zhao (Frank)
b9287142df fix(reading): retain the library picker during multiple selections
Local dev repairs for #2478.

UI interaction test verifies two selections, preserved search and no premature write. Web typecheck, 1407 Node tests, eslint and i18n passed.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
b46d9b5763 fix(mcp): reconnect after consent and refresh authorization status
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.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
3a533c6c5f fix(auth): allow chat learners to record and play voice
Local dev repairs for #2437.

Guarded voice endpoints and negative permissions tested in the 375-pass first batch.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
30a7e43001 fix(memory): capture chat questions and rebuild missing L2 documents
Local dev repairs for #2294.

Memory, regeneration and decoding suite: 398 passed; regeneration does not duplicate trace events.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
ea517d2c59 fix(import): use locale hints for ambiguous legacy text encodings
Local dev repairs for #2132, #2133.

Turkish UI prefers Windows-1254 after UTF-8; strict explicit encoding is available for mixed legacy collections. Tested both upload bytes and file reads, short Turkish strings, GBK, GB18030 and Windows-1252. Encoding and memory suite: 398 passed.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
e885120cf6 fix(runtime): preserve live turns owned by another local process
Local dev repairs for #2168, #2631.

Real child-process recovery: 16 tests passed, including queued, running, waiting_input, process exit and PID reuse. Existing coordination/application tests: 65 passed, 10 optional Redis skips.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
800b11e9eb fix(desktop): discover host CLIs when launched from Finder
Local dev repairs for #2340. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:10 +08:00
Bingxi Zhao (Frank)
ea67eb00cb fix(llm): accept offered Claude SDK tools without the MCP prefix
Local dev repairs for #2539, #2686. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:10 +08:00
Bingxi Zhao (Frank)
be4f36c166 fix(mastery): normalize option arrays and clarify grading evidence
Local dev repairs for #2687, #2691. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:09 +08:00
Bingxi Zhao (Frank)
e0872716f0 fix(runtime): announce input waits and reject oversized history plans
Local dev repairs for #2387, #2433, #2496. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:09 +08:00
Bingxi Zhao (Frank)
92a26ae3cc fix(storage): isolate attachment writes and settle document parsing
Local dev repairs for #2244, #2245, #2255, #2426, #2453. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:09 +08:00