20d2268546
fix: close P10 audit items — P10-1 sources API admin guard, P10-2 scope prefix strip, P10-3 runtime source timeout w/ stream-safe clients
...
- api.go: handleSourcesAPI now requires admin role (GET leaks upstream api_keys, POST/DELETE mutate routing)
- chat.go: hasScopeModel made a Gateway method that strips source-model/:// prefix strictly via Registry.EffectiveModel (only when the prefix names a real source serving the bare model) so dash-bearing ids like deepseek-v4-flash-free are never corrupted; +TestHasScopeModelWithSourcePrefix
- config.go: DefaultSourceTimeout/QueueTimeout/Concurrency constants shared by YAML ApplyDefaults and runtime sources
- core.go: mergedSources applies the same defaults to runtime sources (JSON never persisted timeout fields); a dead upstream can no longer hold a concurrency slot forever
- provider.go: split non-streaming client{Timeout} vs stream client{} sharing a Transport with ResponseHeaderTimeout, so long SSE bodies are not cut by client.Timeout; ChatStream uses doRawStream
- plan.md: mark P4-4/5/6 done, record P4-7/8 (tier-order, audit export, UI key view, zen upstream diagnosis)
- online verified: user key -> /api/sources 403 (GET+POST), admin 200, AUTO stream/non-stream healthy
2026-08-11 15:22:20 +08:00
854b3e2e37
fix: AUTO tier order ascending + stats/CSV export completeness + UI key-view toggle & exit affordance
...
- scheduler: BuildChain sorts tiers ascending so tier 1 (highest priority) is tried first; previously descending inverted the chain (P10-1..P10-5)
- stats/api: handleStatsAPI limit→20000; CSV reads full audit via new Stats.AuditRecords (includes *.old rotation); key_names mapped by keyID() masked key; non-admin filter and keys-csv use masked keys
- server: ring buffer NewStats(10000)
- ui: dash-row card scroll area moved to table container (fix overflow below card); key view toggle (re-click same key returns to global) + kpi-exit affordance; rec-exit span
- chat: chain-failure record now surfaces first failed tier; AUTO comment sync
2026-08-11 13:36:23 +08:00
32e2fd521a
update: 2026-08-11 code review findings + WebUI crash fix & 41s delay analysis (P10-1..P10-5, P4-1..P4-6)
2026-08-11 10:30:58 +08:00
7647b7dff8
fix: WebUI chat crashes on streaming reasoning — sendChat never passed the reason flag to addMsg, so .think/.tk-hint were null and first reasoning_content chunk threw 'Cannot set properties of null'; pass reason=true and hide the empty box until thinking arrives
2026-08-11 09:52:12 +08:00
e8ef73321c
fix: restart wipes stats history — LoadAudit replayed only the last 3000 lines (92% of which are 3s access events) and fed access rows into aggregates; now replays every real request into totals/quota windows, skips event rows, tolerates >64KB lines; +TestLoadAuditFullReplay
2026-08-11 08:42:13 +08:00
6221502adc
fix: right-click ctx menu never closes — showCtx appended the menu but never stored it in ctxEl, so hideCtx (item click / outside press) was always a no-op; priority page and keys page affected
2026-08-11 00:15:16 +08:00
88802f9ef6
feat: AUTO chain rewrite — silent failover+busy skip+pref round-robin+503 tier summary; chain edits reset slot cooldowns (P0/P1); stats by_status + audit jsonl rotation; UI priority-page health badges & status-code card; ctx-menu capture-phase close (outside-press guard); main.go ops warnings; local bundled-Lua verified tests (3 latent bugs fixed); plan.md
2026-08-11 00:03:11 +08:00
397af36fbb
update: 更新文件 README.md
...
Signed-off-by: JianFeeeee <2198972886@qq.com >
2026-08-10 15:13:13 +08:00
63c2b13b4b
fix: WebUI 密钥用量导出 CSV + 修复 Stats API key 过滤 bug
...
- api.go: 非 admin 用户过滤改用完整 key;keyNames 映射用完整 key;keys-csv 导出支持 key 查询参数过滤,安全类型断言
- stats.go: 新增 StatsRow 类型和 rows() 函数供导出使用
- server.go: handleStatusAPI 返回当前用户 key(已存在逻辑)
- index.html: 密钥用量卡片右上角添加导出 CSV 按钮(与请求记录一致)
2026-08-10 14:52:30 +08:00
41c9b0e14a
feat: source-model routing disambiguation (source-model/:/ prefix); same-tier round-robin load balancing; public_base_url for copy config; fmtTok(B/M/K) unit scaling; status column reorder (reachability first); drop emoji from seed-warn modal; fix tests for first-run adapter seeding; install lua5.1 dev lib
2026-08-10 12:55:22 +08:00
fe06e0861a
feat(seed-warn): dynamic seed key detection in UI modal; feat(https): TLS config (tls_cert_file/tls_key_file) with dynamic base_url; docs: rotate admin key reminder
2026-08-10 12:11:32 +08:00
a5c370018c
docs: remind to rotate the admin key after first start (seed key lives in plaintext config.yaml)
2026-08-10 11:53:14 +08:00
f46b02089c
feat(delete): real deletes — adapters seeded once into adapter_dir (existing dir is authoritative), sources removed from config.yaml on delete; drop tombstone mechanism for both. Docs: multi-key architecture, gateway_keys as seed
2026-08-10 11:52:51 +08:00
e2dd4d9727
fix(ui): clipboard fallback for non-secure contexts; touch-friendly delete button on key scope blocks; append named model after AUTO when adding (+ docs sync: encrypted storage, AUTO chain, live probing, image endpoint)
2026-08-10 11:10:59 +08:00
62c8a07b88
fix(ui): sources page model tags wrap 4 per row (same grid as status page)
2026-08-10 10:37:57 +08:00
839f33ba01
feat(secrets): encrypt sensitive store fields (AES-GCM, master.key 0600, api_key_env) + fast models-endpoint probing (fix zen backlog + source status) + UI cleanup (drop redundant parens labels, grid models 4/row)
2026-08-10 10:33:03 +08:00
e0978db150
fix(ui): logout power icon was italic (<i> default style); hide it on wide screens, normalize font-style
2026-08-10 09:38:33 +08:00
fa65dcbe70
fix(ui): narrow-screen header (hide brand name, icon-only nav, scrollable), wrap wide tables for horizontal scroll, add favicon
2026-08-10 09:35:21 +08:00
597babe331
fix(stats): drop empty-model records from model aggregates; clean stale blank audit entries
2026-08-10 08:57:33 +08:00
d48b993010
feat(auto): AUTO-only priority chain with tiered slots + live source probing; CSV export w/ key names; audit persistence; fix prompt token accounting & deepseek thinking
2026-08-10 00:10:19 +08:00
859d310ad3
feat(auto): quota-aware AUTO slot scheduling (model tiers, hour/week/month resets) + key scope periods; fix key/slot create/delete UX
2026-08-09 11:07:38 +08:00
3408c9cb1f
feat(keys): role-based gateway keys with admin management UI and per-user model scope
2026-08-09 10:01:40 +08:00
dec03238dd
feat(stats): gateway request stats/audit API + polish scratch sort animations (link chain, reset, cleanup)
2026-08-08 13:34:40 +08:00
31eefe9288
feat(webui): scratch jigsaw-block canvas priority sorting (same-value prio, image excluded)
2026-08-08 11:41:46 +08:00
b0f8bc8ffd
feat(webui): scratch-style drag sorting of model priority per source
2026-08-08 11:34:57 +08:00
5d50b69153
fix: tool call anchor & wire format, streaming chunk passthrough, WebUI narrow-screen, docs bilingual
2026-08-08 11:26:58 +08:00
8e9de95274
docs: emphasize lightweight & add-source-without-recompile advantage
2026-08-07 13:43:16 +08:00
7f986ea0ce
docs: document LuaJIT build tag, AUTO routing, WebUI, multimodal & disable_thinking
2026-08-07 13:39:02 +08:00
ccbcede581
feat: LuaJIT worker-pool VM, multimodal/disable-thinking passthrough, WebUI redesign, DeepSeek V4
2026-08-07 13:34:16 +08:00
a0e6e6da90
docs: adopt ModelRouter title
2026-08-05 15:25:47 +08:00
f7f76e097d
feat: ModelRouter — unified OpenAI-compatible multi-source LLM gateway
...
- Lua adapters per upstream (transform_request/response/stream_chunk, build_headers signing hooks)
- AUTO priority routing with per-model kind (chat/image), explicit source/model routing
- Per-source concurrency caps with queueing, exponential backoff, AUTO failover
- OpenAI-compatible API: chat completions, SSE streaming, image generations, models
- Gateway key auth, web UI for adapter/source management, runtime persistence
- e2e test running the real binary against mocked upstreams
2026-08-05 15:25:47 +08:00
8631b08253
Initial commit
2026-08-05 15:23:38 +08:00