Try merge upstream main - #2527
Conversation
Document differences between the current implementation and Newapi, detailing features such as model health monitoring, rate limiting, API call caching, user call statistics, random code generation, and role conversion.
…demptions, role mapping)
DashboardListModels now returns a flattened model list in data and keeps grouped data separately. Add regression test.
…wildcard mapping; improve UI load
- ModelHealthHourly: 模型选择下拉框改用独立 Select 组件 - RecentCalls: limit 下拉框改用独立 Select 组件 - UserHourlyCallsRank: limit 下拉框改用独立 Select 组件 Semi Design 的 Form.Select 在受控模式(value属性)下与动态 optionList 配合时存在显示问题
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a comprehensive monitoring and observability system with health tracking, recent calls caching, user hourly call rankings, per-channel model role mappings, and enhanced rate-limit exemptions. It includes new database models, async event processing, API endpoints, frontend pages, and an updated CI workflow for GHCR publishing. The VERSION is bumped to v0.1.29. Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant R as Relay Handler
participant RC as RecentCallsCache
participant E as Event Queue
participant H as HealthWriter
participant DB as Database
C->>R: POST /v1/chat/completions
R->>RC: BeginFromContext(c)
RC->>RC: Create RecentCallRecord
R->>R: Apply role mappings
R->>R: Process request
alt Streaming Response
R->>RC: EnsureStreamByContext
loop Each chunk
R->>RC: AppendStreamChunkByContext(chunk)
end
R->>RC: FinalizeStreamAggregatedTextByContext
else Error Path
R->>RC: UpsertErrorByContext(error)
else Success Path
R->>RC: UpsertUpstreamResponseByContext(response)
end
R->>E: RecordModelHealthEventAsync(event)
E->>H: Worker processes event
H->>DB: UpsertModelHealthSlice5m
R->>E: RecordUserCallHourlyEventAsync(event)
par Async Processing
E->>DB: UpsertUserCallHourly
end
C->>RC: GET /api/debug/recent_calls
RC-->>C: Return cached records
sequenceDiagram
participant Admin as Admin UI
participant API as Controller
participant Service as Service Layer
participant Cache as Redis/Memory
participant DB as Database
Admin->>API: GET /api/model_health/hourly
API->>Service: GetModelHealthCache
alt Cache Miss
Service->>DB: GetModelHealthHourlyStats
DB-->>Service: Hourly stats
Service->>Cache: Store with 5min TTL
else Cache Hit
Cache-->>Service: Return cached data
end
Service-->>API: Response
API-->>Admin: Hourly health data + chart
Public->>API: GET /api/public/model_health/hourly_last24h
API->>Cache: Check 24h cache
alt Cache Miss
API->>DB: GetAllModelsHealthHourlyStats
API->>Cache: Store last 24h
end
Cache-->>API: Cached data
API-->>Public: JSON response
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (68)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Apologies for the noise. I accidentally opened this PR due to a local git configuration error (mis-pushed my downstream branch to the upstream repo). I have closed the PR and deleted the branch. Sorry for the inconvenience! |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.