Commit Graph
72 Commits
Author SHA1 Message Date
wangweiandCopilot 29f79d7434 feat: seed and periodically persist model usage stats to Postgres
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 14:32:21 +08:00
wangweiandCopilot 5d132981ad feat: add PostgresModelUsageStore and ModelUsageTracker.seed()
- Add seed() method to ModelUsageTracker for bulk-loading persisted entries at startup
- Create PostgresModelUsageStore for persistence of model usage counters to Postgres
- Store only current cumulative snapshots (no historical time-series)
- Use standard CREATE TABLE IF NOT EXISTS idiom matching other Postgres stores
- Add comprehensive mocked unit tests for both components

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 14:18:22 +08:00
wangweiandCopilot 4f6cc4812e revert: disable Cross-Encoder reranker
Live verification via POST /status/models/ping (after confirming the
gateway itself is reachable -- embedding role succeeded, 1.5s latency)
shows http://6.86.80.4:30080/v1/rerank returns a fast, reproducible
'503 Service Unavailable' -- not a timeout/fluke. The gateway's model
catalog (19 models: deepseek-*, glm-*, kimi-*, qwen3*, text-embedding-v3/4)
contains no cross-encoder/rerank-capable model, confirming no reranker
service is deployed behind this gateway today. Leaving RERANKER_ENABLED=true
would be a permanent no-op (graceful fallback to unranked order every call)
plus a misleading permanent error badge on the Status page. Revert until a
reranker model is actually deployed on the gateway.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 14:09:33 +08:00
wangweiandCopilot 2547d04b9d chore: enable Cross-Encoder reranker
Sandbox verification via /status/models/ping was inconclusive: the gateway
(6.86.80.4:30080) is unreachable from this environment entirely (embedding
role failed with the identical connection-timeout pattern, which is a
feature that definitely works in real deployment) -- not evidence that
/rerank specifically is unsupported. Reranker code already has graceful
TEI/Cohere fallback + falls back to unranked order on any failure, so this
is zero-risk to retrieval even if misconfigured. Please verify via
POST /status/models/ping in an environment with real gateway access;
revert RERANKER_ENABLED to false if that shows a genuine error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 14:03:43 +08:00
wangweiandCopilot 7adc050968 feat: record streaming token usage in TrackedLLMClient.stream_chat
Implement manual generator driving using next()/StopIteration to capture
the return value (trailing usage dict) from inner stream_chat() implementations,
enabling token tracking for streaming LLM calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 13:42:33 +08:00
wangweiandCopilot f2bd0deeb3 feat: capture streaming token usage in QwenClient and QwenVLClient
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 13:19:23 +08:00
wangweiandCopilot 81a6d54fff feat: capture streaming token usage in DeepSeekClient.stream_chat
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-23 11:24:31 +08:00
wangwei beddc2d976 Merge pull request 'main-ruqi' (#1) from main-ruqi into main
Reviewed-on: #1
2026-07-02 22:05:17 +08:00
wangwei 52e67b0e7b Add LLM token 2026-07-02 22:03:39 +08:00
wangweiandCopilot e3afb8a07a fix: normalize LLM provider key lookup and skip disabled HyDE ping (final review)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 21:24:22 +08:00
wangweiandCopilot 6a7fe48c4c fix: use dedicated error message for AI Models card load failure (Task 9 review)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 20:03:27 +08:00
wangweiandCopilot 0edbee07d5 fix: add distinct error state for AI Models card load failure (Task 9 review)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 18:01:04 +08:00
wangweiandCopilot 2ce4c8a289 feat: add AI Models card to Status page with connection test button
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 17:38:33 +08:00
wangweiandCopilot 39a51c9e83 feat: add ModelUsageEntry types and status API client functions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 17:23:43 +08:00
wangweiandCopilot 049da2297b feat: add i18n keys for AI Models card and fix missing .status.error CSS
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 17:06:13 +08:00
wangweiandCopilot d83286edd4 fix: honor hyde_enabled toggle and record ping failures before client creation (Task 6 review)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 16:42:58 +08:00
wangweiandCopilot 169911ab46 feat: add GET/POST /status/models routes for AI model connection status
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 16:20:35 +08:00
wangweiandCopilot 66fc388bfb feat: record reranker call outcome into ModelUsageTracker
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 15:42:20 +08:00
wangwei 41096369d3 feat: record embedding call usage into ModelUsageTracker 2026-07-02 15:15:03 +08:00
wangwei 4fea159f5b feat: wrap LLM clients with TrackedLLMClient in LLMFactory 2026-07-02 15:03:12 +08:00
wangweiandCopilot d460397dda fix: add missing test comment for backend commenting standard (Task 2 review)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 14:57:55 +08:00
wangweiandCopilot 37ea27fcbe feat: add TrackedLLMClient decorator for transparent usage recording
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 14:49:06 +08:00
wangwei 74f327c85e feat: add ModelUsageTracker for per-model token/connection tracking 2026-07-02 14:41:21 +08:00
wangweiandCopilot 4b451ef97c docs: add implementation plan for System Status AI model usage tracking
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 14:13:58 +08:00
wangweiandCopilot 55ba922250 docs: add design spec for System Status AI model connection/token usage panel
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 13:39:43 +08:00
wangwei 9212747e1b update for 1. 优化 2.中英切换 2026-06-10 11:10:36 +08:00
wangwei e7963b267e fix somethings 2026-06-08 11:16:28 +08:00
wangwei 9fea9c6a53 1. Add 登陆功能
2. 调整字体大小
3. 新增部分功能
2026-06-05 18:00:31 +08:00
wangwei 06e0967128 add 2026-06-05 09:00:36 +08:00
wangwei 746513cc54 fix 2026-06-04 15:43:44 +08:00
wangweiandClaude Sonnet 4.6 ac490d851a chore: delete dead code, fix tailwind dark mode, fix title and start.sh port
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 10:29:28 +08:00
wangwei bc8ccc1143 feat: complete frontend redesign — all 6 pages implemented per prototype specs
Fix UI components (Badge, Button, Card, Input, ProgressBar, ScoreBar,
ChatPanel) to use CSS variables instead of old theme object pattern.
Clean up barrel exports (common/index.ts, layout/index.ts) and remove
stale router/tabs import from shell-config.ts. Build: tsc zero errors,
Vite production build succeeds (1760 modules, 270 kB JS, 22 kB CSS).
2026-06-03 18:42:42 +08:00
wangwei 6414d67b3b feat: implement Regulation Q&A chat page with history pane, streaming, citation rail 2026-06-03 17:58:38 +08:00
wangwei 9f15e40bbb feat: implement Compliance Analysis three-column workspace with findings and stages 2026-06-03 17:50:55 +08:00
wangweiandClaude Sonnet 4.6 65ba1b214d feat: implement Document Management page with filterable table and batch actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 17:45:14 +08:00
wangweiandClaude Sonnet 4.6 7cd7a10bea feat: implement Regulatory Signals page with two-pane split and SSE streaming
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 17:35:37 +08:00
wangwei 235de65975 feat: implement System Status page with stats grid, panel grid, KPI strip 2026-06-03 17:26:22 +08:00
wangwei 07ccf055ab feat: implement Overview launcher page with hero, workflow steps, screen grid 2026-06-03 17:22:25 +08:00
wangweiandClaude Sonnet 4.6 3dc12b0bfe feat: add AppShell + Topbar + 6-route AppRouter with stub pages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 17:16:00 +08:00
wangweiandClaude Sonnet 4.6 08461215b0 feat: add Sidebar component with nav groups, badges, and theme toggle
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 17:05:05 +08:00
wangwei dcda7e0423 @
chore: delete old layout/common/tabs components before redesign
@
2026-06-03 16:58:35 +08:00
wangweiandClaude Sonnet 4.6 f3dbdc7e3f feat: update ThemeContext to use data-theme attribute, simplify to light/dark
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 16:39:33 +08:00
wangwei 932e2c7792 feat: rewrite globals.css with prototype design tokens, layout, and all page CSS 2026-06-03 16:14:47 +08:00
wangwei 22ab39fed2 docs: add frontend redesign spec based on prototype analysis 2026-06-03 14:58:24 +08:00
wangwei 2080da87aa feat: complete team-report PPT - slides 8-10 roadmap, assignments, QA 2026-05-27 18:30:02 +08:00
wangwei dd850f1023 feat: team-report PPT slides 6-7 architecture and value 2026-05-27 18:27:16 +08:00
wangwei 91651682a3 feat: team-report PPT slides 4-5 feature demos 2026-05-27 18:24:56 +08:00
wangwei c02c5cec0c feat: team-report PPT slides 2-3 background and progress overview 2026-05-27 18:22:09 +08:00
wangwei 4addda9182 feat: add team-report PPT generator - slide 1 cover 2026-05-27 18:19:00 +08:00
wangwei 0398fa3fb0 docs: add team-report PPT implementation plan 2026-05-27 18:16:19 +08:00