- 06 Feb, 2026 14 commits
-
-
将散落在多个文件中的预扣费/结算/退款逻辑抽象为统一的 BillingSession 生命周期管理: - 新增 BillingSettler 接口 (relay/common/billing.go) 避免循环引用 - 新增 FundingSource 接口 + WalletFunding / SubscriptionFunding 实现 (service/funding_source.go) - 新增 BillingSession 封装预扣/结算/退款原子操作 (service/billing_session.go) - 新增 SettleBilling 统一结算辅助函数,替换各 handler 中的 quotaDelta 模式 - 重写 PreConsumeBilling 为 BillingSession 工厂入口 - controller/relay.go 退款守卫改用 BillingSession.Refund() 修复的 Bug: - 令牌额度泄漏:PreConsumeTokenQuota 成功但 DecreaseUserQuota 失败时未回滚 - 订阅退款遗漏:FinalPreConsumedQuota=0 但 SubscriptionPreConsumed>0 时跳过退款 - 订阅多扣费:subConsume 强制为 1 但 FinalPreConsumedQuota 不同步 - 退款路径不统一:钱包/订阅退款逻辑现统一由 FundingSource.Refund 分派
CaIon committed -
CaIon committed
-
- Change ESCAPE character from '\' to '!' for compatibility with MySQL/PostgreSQL/SQLite - Adjust sanitization logic to escape '!' and '_' correctly, improving input validation for search queries
CaIon committed -
CaIon committed
-
fix: harden token search with pagination, rate limiting and input validation
Calcium-Ion committed -
- Add configurable per-user token creation limit (max_user_tokens) - Sanitize search input patterns to prevent expensive queries - Add per-user search rate limiting (by user ID) - Add pagination to search endpoint with strict page size cap - Skip empty search fields instead of matching nothing - Hide internal errors from API responses - Fix Interface2String float64 formatting causing config parse failures - Add float-string fallback in config system for int/uint fields
CaIon committed -
feat: add claude-opus-4-6
Calcium-Ion committed -
🔒 fix(security): sanitize AI-generated HTML to prevent XSS in playgroundCalcium-Ion committed -
🔒 Mitigate XSS vulnerabilities in the playground where AI-generated content is rendered without sanitization, allowing potential script injection via prompt injection attacks. MarkdownRenderer.jsx: - Replace dangerouslySetInnerHTML with a sandboxed iframe for HTML preview - Use sandbox="allow-same-origin" to block script execution while allowing CSS rendering and iframe height auto-sizing - Add SandboxedHtmlPreview component with automatic height adjustment CodeViewer.jsx: - Add escapeHtml() utility to encode HTML entities before rendering - Rewrite highlightJson() to process tokens iteratively, escaping each token and structural text before wrapping in syntax highlighting spans - Escape non-JSON and very-large content paths that previously bypassed sanitization - Update linkRegex to correctly match URLs containing & entities These changes only affect the playground (AI output rendering). Admin- configured content (home page, about page, footer, notices) remains unaffected as they use separate code paths and are within the trusted admin boundary.
t0ng7u committed -
https://github.com/prnake/new-apiPapersnake committed
-
Papersnake committed
-
Papersnake committed
-
Papersnake committed
-
Papersnake committed
-
- 05 Feb, 2026 12 commits
-
-
CaIon committed
-
Update .gitattributes to enhance text file handling and mark additional file types for LF normalization and binary detection
CaIon committed -
CaIon committed
-
CaIon committed
-
- Add support for custom OAuth providers, including creation, retrieval, updating, and deletion. - Introduce new model and controller for managing custom OAuth providers. - Enhance existing OAuth logic to accommodate custom providers. - Update API routes for custom OAuth provider management. - Include i18n support for custom OAuth-related messages.
CaIon committed -
CaIon committed
-
- Introduce Provider interface pattern for standard OAuth protocols - Create unified controller/oauth.go with common OAuth logic - Add OAuthError type for translatable error messages - Add i18n keys and translations (zh/en) for OAuth messages - Use common.ApiErrorI18n/ApiSuccessI18n for consistent responses - Preserve backward compatibility for existing routes and data
CaIon committed -
remove: drop support for claude-2 and claude-1 series models
Calcium-Ion committed -
- Remove claude-instant-1.2, claude-2, claude-2.0, claude-2.1 from model lists - Remove /v1/complete endpoint support (legacy completion API) - Remove RequestModeCompletion and related code paths - Simplify handler functions by removing requestMode parameter - Update all channel adaptors that referenced claude handlers
CaIon committed -
fix: charge local input tokens when Gemini returns empty response
Calcium-Ion committed -
Seefs committed
-
fix: optimize Codex relay
Seefs committed
-
- 04 Feb, 2026 14 commits
-
-
dahetaoa committed
-
feat: backend i18n
Calcium-Ion committed -
feat: 支持基于Go Regex规则和全量的请求体透传
Calcium-Ion committed -
fix: map Responses reasoning stream to chat completion deltas
Calcium-Ion committed -
🐛 fix: sidebar scroll on mobile dynamic viewportCalcium-Ion committed -
✨ fix: Improve subscription payment handling and card layout consistencyCalcium-Ion committed -
Seefs committed
-
🐛 Use dynamic viewport height to prevent sidebar scroll lock in mobile browsers Harden sidebar scroll container with min-height and momentum scrolling
t0ng7u committed -
✨ Unify Epay subscription response format with top-up flow, and harden frontend error handling to avoid object-to-string issues. Refine subscription plan cards layout to be wider, left-aligned, and visually consistent across breakpoints.
t0ng7u committed -
The i18n middleware runs before UserAuth, so user settings weren't available when language was detected. Now GetLangFromContext checks user settings first (set by UserAuth) before falling back to the language set by middleware or Accept-Language header.
CaIon committed -
Seefs committed
-
- Change default language fallback to English instead of Chinese - Add ErrRedeemFailed typed error for model layer translation - Migrate remaining hardcoded messages in controller/user.go - Add translation keys: redeem.failed, user.create_default_token_error, common.uuid_duplicate, common.invalid_input
CaIon committed -
fix: default summary = detailed fix ReasoningContent fix ReasoningContent fix ReasoningContent fix ReasoningContent Revert "fix ReasoningContent" This reverts commit 45a88f78b91ce2376bca68745d19374bb9e95e88. fix ReasoningContent fix ReasoningContent
Seefs committed -
- Add go-i18n library for internationalization - Create i18n package with translation keys and YAML locale files (zh/en) - Implement i18n middleware for language detection from user settings and Accept-Language header - Add Language field to UserSetting DTO - Update API response helpers with i18n support (ApiErrorI18n, ApiSuccessI18n) - Migrate hardcoded messages in token, redemption, and user controllers - Add frontend language preference settings component - Sync language preference across header selector and user settings - Auto-restore user language preference on login
CaIon committed
-