Commit Graph

13 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
ebcebd4723 Unify migration locks and plugin environments, and cover compatibility boundaries 2026-11-06 02:04:52 +08:00
Bingxi Zhao (Frank)
4958bab3a1 Merge #2345 from rudycelekli 2026-11-06 01:56:40 +08:00
yuleihaotong
9417f76f43 test(web_source): make the lease-renewal test assert renewal, not scheduling speed
`test_scheduler_renews_lease_during_a_long_sync` ran a 200 ms lease with a 40 ms
renewal and then compared the deadline against `time.time()`. On the Python 3.12
runner the event loop was delayed past the deadline and the assertion read
`1793772763914 > 1793772763951` — 37 ms short. The test was really asserting that
the runner schedules an asyncio task within 200 ms, which it does not promise.

The lease is now 5 s with a renewal every 0.5 s, and the check runs after 1.2 s
with the database left alone in between. That still proves the lease is extended
while a sync is running, and it cannot lose the race.

Reproduction before the change: 0/20 failures idle, 1/10 with four busy loops on a
2-vCPU box. After: 0/20 idle and 0/20 under the same load.

Found while debugging, deliberately not changed here: `_renew_lease()` does not
catch exceptions from `renew_lease()`, and the task's exception is swallowed by
`asyncio.gather(..., return_exceptions=True)` in `_run_job`'s `finally`. One
transient SQLite error therefore ends the renewal loop silently, and the sync
loses its lease with nothing logged. That deserves its own change and its own
test.
2026-11-05 01:55:44 +00:00
Rudy Celekli
fd7ef5e4c5 fix(web_source): recognize unlisted regional locales in URL language prefix
extract_url_language_and_stem tested the normalized language string with
'first_norm in SUPPORTED_LANGUAGE_PAIRS', but that constant is a set of
frozensets, so the clause was always False. A regional variant not listed
in _CANONICAL_LANGUAGES (e.g. /fr-be/, /en_US/) was therefore not treated
as a language and bilingual pairings were missed. Test the normalized
language against a flattened set of supported languages instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 00:36:55 -05:00
Bingxi Zhao (Frank)
dfeb2fb4f3 Merge dev into PR #1657 and preserve integrated behavior 2026-10-04 14:22:45 +08:00
XZH
d77ece9640 test(web-source): stabilize sync lease renewal 2026-09-29 07:23:33 -07:00
XZH
0e260130be feat(web-source): add bilingual source pairing (#902)
Add bilingual page pairing and language variant alignment for web sources:
- Detect page language variants via hreflang alternate links and URL language prefix patterns.
- Record pairing relations in durable SQLite repository and KB web-source metadata.
- Expose pairing relations via GET /api/knowledge-bases/{kb_name}/web-source/{source_id}/pairings and WebSourceInfo.
- Display bilingual pairing indicator in the KB web sources section with localization across en, zh, de, fr, uk.
- Add targeted tests for pairing detection, repository persistence, and API exposure.

Co-authored-by: multica-agent <github@multica.ai>
2026-09-28 14:58:51 -07:00
Bingxi Zhao (Frank)
46c9c885f7 Preserve failed web source scans and renew fenced sync leases after #1385 2026-09-23 10:47:52 +08:00
XZH
90b99187d1 feat(web-source): add durable sync scheduling 2026-09-10 17:31:03 -07:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +08:00
Bingxi Zhao (Frank)
64dff25792 style: format recent issue fixes 2026-08-30 16:42:43 +08:00
Bingxi Zhao (Frank)
3f3bf0b841 feat(reading): render safe versioned web snapshots 2026-08-30 16:01:40 +08:00
XZH
0d8b734a76 feat(knowledge): add web source sync 2026-08-26 02:26:58 +08:00