fengsilin
ce40bfe92f
feat(chinamobile): support doubao-seedance-2-0-mini-260615 billing model
Register the Seedance mini model in the matrix usage capability table
(both native name and doubao-seedance-2.0 alias) and keep
SupportsAnyMatrixUsageBillingModel in sync so the model bills via
matrix usage on the ChinaMobile Seedance channel.
Co-Authored-By: ZCode <noreply@anthropic.com>
před 17 hodinami
fengsilin
0b79e4ee07
fix(db): skip logs AutoMigrate for pg_partman-managed PostgreSQL tables
On PostgreSQL the logs table is a RANGE-partitioned table on created_at
owned by pg_partman; GORM AutoMigrate would alter its composite primary
key (id, created_at) and create redundant per-partition indexes,
breaking startup. Extract ensureLogTable() to skip AutoMigrate on
PostgreSQL (existence check only) while keeping the original behavior
on SQLite/MySQL. The dedicated LOG_SQL_DSN PostgreSQL branch follows
the same rule. Ship the matching postgres-partman image (Dockerfile +
01-partition.sql) that creates and maintains the partitioned table via
pg_partman + pg_cron.
Co-Authored-By: ZCode <noreply@anthropic.com>
před 17 hodinami
fengsilin
17c12fd41e
feat: harden services and add video channel bindings
Co-Authored-By: Codex <noreply@anthropic.com>
před 3 týdny
fengsilin
cd35e66b33
feat(chinamobile): add channel asset credentials
Co-Authored-By: Codex <noreply@anthropic.com>
před 3 týdny
fengsilin
50ce4f7541
feat(tianyiyun): add Seedance asset support
Co-Authored-By: Codex <noreply@anthropic.com>
před 4 týdny
fengsilin
fedd394e79
fix(task-billing): persist settlement and merge paged logs
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
c67d8c409e
feat(chinamobile): add Seedance channel and isolated asset library
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
fcb1c2a8ba
fix: prevent webhook bypass via empty secret and cross-gateway callback attacks
Add two layers of defense:
1. Webhook availability guard (controller/payment_webhook_availability.go):
- isStripeWebhookEnabled() checks StripeWebhookSecret != "" before processing
- isCreemWebhookEnabled(), isWechatPayWebhookEnabled(), isAlipayWebhookEnabled()
- isEpayWebhookEnabled() with similar checks for all payment webhooks
- Applied to: StripeWebhook, CreemWebhook, WechatPayWebhook, AlipayPayWebhook,
EpayNotify, SubscriptionEpayNotify
2. PaymentProvider field (model/topup.go):
- New PaymentProvider field on TopUp to identify which gateway created the order
- Recharge() checks PaymentProvider == PaymentProviderStripe
- rechargeByQRCodePayment() checks PaymentProvider matches wechat/alipay
- RechargeCreem() checks PaymentProvider == PaymentProviderCreem
- All payment controllers set PaymentProvider when creating orders
Root cause: When StripeWebhookSecret was empty, ComputeSignature used
an empty HMAC key, allowing attackers to forge valid signatures and
complete orders from any payment gateway without actually paying.
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
6891b11e09
chore: ignore local tmp artifacts
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
bde79b7259
fix(kling): persist proxy fallback asset binding
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
4533c24fa1
merge: dynamic video asset channel selection
před 1 měsícem
fengsilin
f6321b3910
feat(channel): support dynamic video asset channel selection
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
3fbf48313a
feat(pricing): support usage billing and endpoint fixes
Add KlingAiping usage-token settlement from upstream final_unit_deduction and duration fallback handling.
Normalize model endpoint config persistence and convert model pricing values between stored USD and display currency in the editor.
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
dd14839996
merge: tianyiyun seedance channel
před 1 měsícem
fengsilin
678add297f
feat(channel): add tianyiyun seedance channel
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
f100f9e409
docs: design tianyiyun seedance channel
před 1 měsícem
fengsilin
ffb3991654
Merge branch 'feat/kling-aiping'
před 1 měsícem
fengsilin
49ca8a6ae7
fix(kling): 修复原生路由和展示价格保存
- 避免仅编辑展示价格时写入默认真实计费规则
- 将 video-extend 纳入 KlingAiping 原生渠道约束
- 补充相关保存决策、渠道约束和计费展示测试
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
6f805a6177
refactor: update aiping doubao upstream API paths to multimodal/sd endpoints
- Asset: /api/v1/volcengine/asset → /api/v1/multimodal/sd/assets
- Create video task: /api/v1/videos → /api/v1/multimodal/sd/videos/contents/generations/tasks
- Query video task: /api/v1/videos/{id} → /api/v1/multimodal/sd/videos/contents/generations/tasks/{id}
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
56400b6c61
feat: KlingAiping 渠道适配 + 展示价格管理后台
- 新增 KlingAiping 渠道 (ChannelTypeKlingAiping = 59)
- 新增 KlingAiping 原生路由 (text2video/image2video/omni-video 等)
- 新增 KlingAiping adaptor (relay/channel/task/kling/aiping/)
- 前端模型定价页面新增「真实计费 / 展示价格」Tab 切换
- 新增 DisplayPricing 组件,支持模型展示价格的增删改
- 新增 displayPricingConfig 工具函数及测试
- 修复 KlingAiping 路由路径匹配与 task 错误响应
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
a61ca078fc
fix: localize display pricing units
před 1 měsícem
fengsilin
fee9504107
feat: render display pricing on pricing page
před 1 měsícem
fengsilin
cc97834e5b
feat: add display pricing frontend helpers
před 1 měsícem
fengsilin
ced4d7f323
feat: expose model display pricing
před 1 měsícem
fengsilin
de117ac932
feat: add model display pricing admin api
před 1 měsícem
fengsilin
18a3495968
feat: add model display pricing settings
před 1 měsícem
fengsilin
302987989b
docs: expand display pricing frontend spec
před 1 měsícem
fengsilin
6dd8c19ea8
docs: clarify model display pricing design
před 1 měsícem
fengsilin
6dd9bc6dec
docs: add model display pricing design
před 1 měsícem
fengsilin
c9988af52b
feat: 用户创建同步到从节点及 i18n 翻译
新建用户时异步同步到海外 slave 节点,确保跨区域用户数据一致。
补充前两个 commit 全部新功能的中英文翻译字符串。
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
84d364d76a
feat: 使用日志计费详情展开与 completion_tokens 修复
前端新增 UsageLogExpandedDetail 点击展开面板和 BillingDetailSummary
hover 计费详情,后端修复 per_1m_tokens 任务结算日志的 completion_tokens
从零值改为写入 total_tokens 实际值。新增 taskBillingLogMerge 合并
任务预扣/结算日志。
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
2e40bab478
feat: 模型定价矩阵价格取中位数展示
前端模型定价配置 UI 增强(Editor/GeneratorModal/PreviewPanel/PricingGrid),
后端新增 representativeMatrixPrice 取矩阵定价表中位数作为展示价格,
替代原来的 model_price=0 导致的价格展示为空问题。
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
ec7c76f221
merge: feat/video-pricing-table-codex into master
- feat: video multidimensional matrix pricing system
- feat: doubao aiping video channel support
- feat: relay capture JSON storage with header redaction
- feat: SSE stream error handling (Gemini/OpenAI/Responses)
- test: E2E test infrastructure (Playwright + Chromium)
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
0e3b98efe0
chore: commit relay SSE error handling fixes and E2E mock server
- relay: SSE stream error exposure improvements (Claude/Gemini/OpenAI)
- test: add mock capture server for E2E relay capture testing
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
139b6a6075
feat: store relay capture records as json
před 1 měsícem
fengsilin
65551e8003
refactor: prepare relay capture json helpers
před 1 měsícem
fengsilin
19d55dc255
docs: design relay capture json storage
před 1 měsícem
fengsilin
1d01c4cd64
feat: 增强流式响应错误处理,SSE内嵌错误正确曝光为API错误
- Gemini stream: 捕获 promptFeedback.blockReason 后停止流并返回 OpenAPI 错误
- OpenAI stream: 检测 SSE 帧中的 error 响应,在首帧写入前转换为 API 错误
- Responses stream: 处理 response.error / response.failed / error 类型帧
- 新增 ClearEventStreamHeadersIfNotWritten 工具方法,错误转换时清除流式头
- 新增 streamOpenAIErrorFromData,从 SSE data 帧提取 OpenAPI 错误结构
- 上游错误体会截断后存入 UpstreamBody 供排障
Co-Authored-By: Claude <noreply@anthropic.com>
před 1 měsícem
fengsilin
696c549a66
feat(video): add doubao aiping video pricing support
Co-Authored-By: Codex <noreply@anthropic.com>
před 1 měsícem
fengsilin
99168a9660
test: stabilize model pricing e2e runtime
před 2 měsíci
fengsilin
aeff58b122
test: stabilize model pricing generator e2e
před 2 měsíci
fengsilin
5451d801f3
test: cover model pricing e2e workflow
před 2 měsíci
fengsilin
a4b824952f
test: make model pricing tab selector clickable
před 2 měsíci
fengsilin
32014dde92
test: add model pricing e2e selectors
před 2 měsíci
fengsilin
eaae02e767
test: ignore e2e artifacts
Co-Authored-By: Codex <noreply@anthropic.com>
před 2 měsíci
fengsilin
75285bcabd
test: align playwright runtime with chromium
Co-Authored-By: Codex <noreply@anthropic.com>
před 2 měsíci
fengsilin
b976b486af
test: avoid shell by default in e2e process helper
Co-Authored-By: Codex <noreply@anthropic.com>
před 2 měsíci
fengsilin
568a91dfcf
test: harden e2e helper error handling
Co-Authored-By: Codex <noreply@anthropic.com>
před 2 měsíci
fengsilin
eb285055ac
test: harden e2e process cleanup
před 2 měsíci
fengsilin
32603ba385
docs(test): video pricing table test plan with mock server design
Co-Authored-By: Claude <noreply@anthropic.com>
před 2 měsíci