WeKnora/internal/router
wizardchen 98ad41cda4 fix(models): harden background concurrency governor
Follow-up hardening on the per-model background concurrency governor:

- limiter: heartbeat now refreshes the ZSET key's PEXPIRE alongside the
  lease score, so a semaphore that stays saturated with no slot turnover
  can't let the whole key expire (which would drop every lease and admit
  over the limit); reuse one poll timer instead of allocating time.After
  each iteration under contention.
- governor: extract the process-wide governor + Gate helper into the
  limiter package so chat and vlm share one limiter/limit without
  importing each other; add an in-process localLimiter for Lite mode.
- vlm: gate background multimodal (VLM) calls through the same governor;
  previously only chat was throttled.
- chat: ChatStream releases its slot when the consumer abandons the
  stream and cancels ctx (select on ctx.Done, drain inner), fixing a
  slot/goroutine leak.
- container/sync_task: install the local governor in Lite mode and tag
  SyncTaskExecutor runs as background; honour model.max_concurrency=0 as
  an explicit disable instead of falling back to the default.
- tests: cover the governor gating, local limiter, and stream release.
2026-07-09 20:40:51 +08:00
..
rbac.go Add API key member and space capabilities 2026-07-07 12:00:13 +08:00
rbac_selfcheck_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router.go Add knowledge base duplicate flow 2026-07-08 20:55:54 +08:00
router_api_key_capabilities_test.go Add knowledge base duplicate flow 2026-07-08 20:55:54 +08:00
router_api_key_management_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router_files_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router_presigned_test.go refactor(api-keys): remove API key reset endpoint and update documentation 2026-07-07 12:00:13 +08:00
router_wiki_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
sync_task.go fix(models): harden background concurrency governor 2026-07-09 20:40:51 +08:00
task.go feat(models): cap background LLM concurrency per model 2026-07-09 20:40:51 +08:00
task_inspector.go feat(wiki): dedicated worker pool with concurrent claim-based batching 2026-07-09 17:41:07 +08:00