Commit Graph

24 Commits

Author SHA1 Message Date
CaIon
a69f166e9e feat: add SaveWithoutKey method to Channel and update status saving logic 2025-08-25 11:20:16 +08:00
Calcium-Ion
87d0d12d39 Merge pull request #1647 from aotsukiqx/main
fix: update channel.go fix #1641
2025-08-25 10:25:06 +08:00
aotsuki
3b50fcb72b Update channel.go 2025-08-24 11:39:38 +08:00
Xyfacai
9055698b4f feat: 显式指定 error 跳过重试 2025-07-30 22:35:31 +08:00
CaIon
8e11b67ece feat(channel): enhance channel status management 2025-07-10 17:49:53 +08:00
CaIon
4a9ca4209a refactor: Introduce standardized API error
This commit refactors the application's error handling mechanism by introducing a new standardized error type, `types.NewAPIError`. It also renames common JSON utility functions for better clarity.

Previously, internal error handling was tightly coupled to the `dto.OpenAIError` format. This change decouples the internal logic from the external API representation.

Key changes:
- A new `types.NewAPIError` struct is introduced to serve as a canonical internal representation for all API errors.
- All relay adapters (OpenAI, Claude, Gemini, etc.) are updated to return `*types.NewAPIError`.
- Controllers now convert the internal `NewAPIError` to the client-facing `OpenAIError` format at the API boundary, ensuring backward compatibility.
- Channel auto-disable/enable logic is updated to use the new standardized error type.
- JSON utility functions are renamed to align with Go's standard library conventions (e.g., `UnmarshalJson` -> `Unmarshal`, `EncodeJson` -> `Marshal`).
2025-07-10 15:02:40 +08:00
CaIon
f14f4eaf1a feat: refactor environment variable initialization and introduce new constant types for API and context keys 2025-07-03 13:10:25 +08:00
CaIon
822ed681de feat(channel): add handling for pre_consume_token_quota_failed error type 2025-06-17 16:46:52 +08:00
1808837298@qq.com
783c60ee4d feat: Enhance channel status update with success tracking and dynamic notification #812 2025-03-06 17:46:03 +08:00
1808837298@qq.com
7cec111b1f fix: error NotifyRootUser #812 2025-03-06 15:56:42 +08:00
1808837298@qq.com
da79af07d2 refactor: Extract operation-related settings into a separate package 2025-03-04 18:52:08 +08:00
1808837298@qq.com
83e161a1d4 refactor: Simplify root user notification and remove global email variable
- Remove global `RootUserEmail` variable
- Modify channel testing and user notification methods to use `GetRootUser()`
- Update user cache and notification service to use more consistent user base type
- Add new channel test notification type
2025-02-18 15:59:17 +08:00
1808837298@qq.com
025b6d1226 feat: Add automatic channel disabling based on configurable keywords
- Introduce AutomaticDisableKeywords setting to dynamically control channel disabling
- Implement AC search for matching error messages against disable keywords
- Add frontend UI for configuring automatic disable keywords
- Update localization with new keyword-based channel disabling feature
- Refactor sensitive word and AC search logic to support multiple keyword lists
2025-02-13 16:39:17 +08:00
1808837298@qq.com
dbc638101f feat: update auto disable 2024-10-08 23:15:57 +08:00
CalciumIon
62359ce2f0 fix: channel auto ban #443 2024-08-24 17:23:24 +08:00
FENG
8baaa7e92e fix: http code is not properly disabled 2024-07-14 01:21:05 +08:00
CalciumIon
35b2a49eb8 fix: channel auto ban 2024-07-04 22:46:43 +08:00
1808837298@qq.com
400be9a2af fix: auto ban 2024-06-18 11:03:24 +08:00
1808837298@qq.com
e5225230f0 feat: auto ban 403 2024-06-16 15:45:41 +08:00
1808837298@qq.com
3085e512cd feat: 记录自动禁用原因 (close #300) 2024-06-15 01:11:03 +08:00
CaIon
a03cfe9ed5 feat: 只自动启用被自动禁用的渠道 (close #224) 2024-05-12 19:29:25 +08:00
CaIon
0180f51f51 feat: automatically ban channels that exceeded quota 2024-04-07 22:22:27 +08:00
CaIon
fb992eeeac feat: 本地重试 2024-04-04 16:35:44 +08:00
1808837298@qq.com
1735981217 feat: 初步重构 2024-02-29 01:08:18 +08:00