SmartUp Developer
f659cc53a4
Localize key status labels
2026-07-06 11:02:51 +08:00
SmartUp Developer
41ef047b6e
Add repository contributor guide
2026-07-06 10:41:40 +08:00
SmartUp Developer and Claude Opus 4.8
72aa21aed2
docs: add guidance to read Go sources for upstream/downstream API context
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-07-06 10:40:42 +08:00
SmartUp Developer and Claude Opus 4.8
a4c7fd6290
docs: clarify sibling Go projects in CLAUDE.md
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-07-06 10:38:47 +08:00
SmartUp Developer and Claude Opus 4.8
f854146c9b
docs: add CLAUDE.md with project architecture and dev commands
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-07-06 10:37:41 +08:00
SmartUp Developer and Claude Opus 4.8
2262b6a564
feat: proactive Bearer token refresh with unified fallback
...
- Parse JWT 'exp' claim to track token expiry (token_expires_at)
- Proactively refresh Bearer tokens 1 hour before expiry in
ensure_authenticated()
- Refresh response without expires_in now falls back to JWT exp for
expiry derivation
- Support custom refresh_path via bearer auth_config whitelist
- Unify 401 fallback: all bearer types (including Sub2API) now go
through _refresh_bearer_token() instead of separate old path
- Remove dead _is_sub2api_bearer() / _refresh_sub2api_bearer_token()
- Add 2 new tests: refresh_path override + JWT exp backfill
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-07-06 10:31:29 +08:00
SmartUp Developer
5a20e792fe
Add SmartUp account pool parameter configuration
2026-07-04 11:59:21 +08:00
SmartUp Developer
0cce5d53fe
Improve website groups loading state
2026-07-04 00:25:01 +08:00
SmartUp Developer
1bba833291
Match finance dashboard dark design
2026-07-03 23:57:52 +08:00
SmartUp Developer
71455c7a94
Align finance dashboard visual style
2026-07-03 23:43:01 +08:00
SmartUp Developer
4dd4448970
Reapply "Redesign finance dashboard with period summaries"
...
This reverts commit da14ec5740 .
2026-07-03 23:25:47 +08:00
SmartUp Developer
da14ec5740
Revert "Redesign finance dashboard with period summaries"
...
This reverts commit 8d41956d88 .
2026-07-03 23:19:32 +08:00
SmartUp Developer
8d41956d88
Redesign finance dashboard with period summaries
2026-07-03 22:16:05 +08:00
SmartUp Developer
1670503720
fix finance balance delta recharges
2026-07-03 20:05:28 +08:00
SmartUp Developer
bb7ed5a7e0
Refactor finance reconciliation dashboard
2026-07-03 18:02:57 +08:00
SmartUp Developer
eba209395d
feat: persist finance daily summaries
2026-07-03 17:38:54 +08:00
SmartUp Developer
1a1a663b6a
fix: use user log stat endpoint for finance upstream costs
2026-07-03 15:59:47 +08:00
SmartUp Developer
a1e2c059b9
fix: reuse configured clients for finance stats
2026-07-03 15:42:29 +08:00
SmartUp Developer
5e99abcbc5
feat: 财务对账页面 — GET /api/finance/daily-summary + Finance.vue
2026-07-03 15:28:06 +08:00
SmartUp Developer
9997b9d56a
fix: restore api_key from local key_value when syncing upstream models for apikey accounts
2026-07-02 23:38:57 +08:00
SmartUp Developer
a0c96ed5da
fix: close platform-check silent-success loophole — raise WebsiteError on None list, missing account, or stale platform after update
2026-07-02 23:28:28 +08:00
SmartUp Developer
2c976f4d48
fix: add active check post account platform update to prevent silent ignore by remote backend
2026-07-02 23:06:38 +08:00
SmartUp Developer
445f33a6b0
style: remove temporary probe and fix scripts from repository
2026-07-02 23:01:09 +08:00
SmartUp Developer
fd2755d539
feat: resolve account platforms prioritizing structural snapshot values and correction on existing accounts
2026-07-02 22:58:15 +08:00
SmartUp Developer
1cb13e878e
style: remove trailing whitespace in website_sync.py
2026-07-02 21:45:02 +08:00
SmartUp Developer
fdbcca4d95
fix: delay binding.percent update until remote sync succeeds and update UI labels to 自动保底盈利
2026-07-02 21:27:52 +08:00
SmartUp Developer
0e77de31ae
feat: implement automatic margin pricing and margin reverse engineering in sync
2026-07-02 21:22:37 +08:00
SmartUp Developer
9011c68b9d
fix: use equal weight sharing for remaining 15% and quantize min_rate floor comparison to 2 decimal places
2026-07-02 20:45:40 +08:00
SmartUp Developer
8746068cd4
feat: implement priority_weighted_plus_percent pricing algorithm
2026-07-02 20:23:20 +08:00
SmartUp Developer
d07ab62772
test: fix trailing whitespaces and add symmetric compact_model_mapping assertions
2026-07-02 19:48:47 +08:00
SmartUp Developer
c20c9cfd26
fix: add stream close check, recover regression test assertions, and secure credentials type check
2026-07-02 19:18:10 +08:00
SmartUp Developer
ece11d66e6
feat: sync upstream models with real-time streaming updates
2026-07-02 18:11:55 +08:00
liumangmang
852bf84246
fix: 优化同步上游模型,过滤克隆载荷中的敏感 credentials 字段,规避重写导致脱敏密钥丢失/清空的事故风险
2026-07-02 17:05:44 +08:00
liumangmang
316ef24188
fix: 优化同步上游模型的写回载荷,克隆并保留远端返回的所有非敏感 credentials,避免丢失 compact_model_mapping 等其它配置
2026-07-02 17:02:37 +08:00
liumangmang
4645460ff9
fix: 一键同步模型接口同步修复并携带上游 base_url,防止 sub2api 账号 base_url 被清空或置为默认值
2026-07-02 16:56:45 +08:00
SmartUp Developer
59be00bd11
chore: remove obsolete wangwang888 endpoint script
2026-07-02 16:09:35 +08:00
liumangmang
3c1fff2491
fix: 优化上游模型同步的写回逻辑,采用增量 JSONB merge,避免脱敏的 credentials 覆盖或丢失原有敏感字段
2026-07-02 15:47:34 +08:00
liumangmang
63cbdf4dca
feat: 实现一键同步网站账号上游模型功能
2026-07-02 15:43:00 +08:00
SmartUp Developer
c70b68d814
refactor: clean up unused variables in external api logs router
2026-07-02 15:17:05 +08:00
SmartUp Developer
ea3fd64686
fix: optimize summary count query and refine row keys for external api logs
2026-07-02 15:07:32 +08:00
SmartUp Developer
e2129d3796
fix: 防止分页漏读和上游异常快照误标 orphaned
2026-07-02 14:21:09 +08:00
SmartUp Developer
00af34c487
fix: Sub2ApiWebsiteClient.list_accounts 支持分页拉取,避免只拿到默认第一页 20 条导致误建重复账号
2026-07-02 11:04:46 +08:00
SmartUp Developer
fe3f9f4a4c
feat: 一键整理强制对齐分组逻辑,移除旧托管分组并优化统计消息区分
2026-07-02 10:42:18 +08:00
liumangmang
c797aff773
fix: 修正设置并发数无候选时的文案拼写错误
2026-07-02 10:08:30 +08:00
liumangmang
274413bca7
fix: 优化并发数批量设置接口,引入 c.close() 资源管理并增加对 list_accounts() 返回 None 的拦截保护
2026-07-02 10:02:07 +08:00
liumangmang
608ef00920
feat: 实现设置账号并发数功能(支持 bulk-update 与 fallback 逐个更新)
2026-07-02 09:48:59 +08:00
SmartUp Developer and Claude Sonnet 4.6
a296525d4e
fix: 将 refresh_path 加入 login_password auth_config 白名单
...
自定义 refresh 路径会被 normalize_auth_config 丢弃,导致只有默认
/auth/refresh 生效。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-07-02 09:34:53 +08:00
SmartUp Developer and Claude Sonnet 4.6
c96d55665d
feat: 优化上游认证复用与 wangwang888 分组接口
...
## 上游认证优化
### 核心改进
- login_password 类型上游优先复用已保存 token,过期后自动 refresh,失败再重新登录
- 新增 ensure_authenticated() 方法替代直接调用 login(),减少不必要的登录请求
- 初始化时从 auth_config 自动加载已保存的 token 和 user_id
- 请求遇到 401 时自动尝试 refresh 或 login 并重试一次
### 实现细节
- UpstreamClient.__init__: 初始化时加载 auth_config 中的 token/new_api_user
- _is_login_password_with_refresh(): 判断是否支持 refresh
- _token_is_expired(): 检查 token 是否过期(提前 60 秒)
- _refresh_login_password_token(): 刷新 login_password 类型的 token
- ensure_authenticated(): 优先复用 token,过期后 refresh,失败再 login
- _send_request(): 401 时针对 login_password 类型先 refresh 再 login 并重试
### 调用点更新
- scheduler.py: _check_upstream, _sync_upstream_keys
- website_sync.py: reconcile_upstream_keys_full
- upstreams.py: list_generated_keys, generate_keys_by_groups, test_all, check_now
## wangwang888 分组接口优化
- 提供数据库更新脚本 update_wangwang888_groups_endpoint.py
- 将 wangwang888 的 groups_endpoint 从 /groups 改为 /groups/all
- 减少不必要的 /api/v1/admin/groups 统计开销
- website_client 已有 fallback 逻辑保证兼容性
## 测试
- 新增 test_upstream_login_password_refresh.py(7 个测试用例)
- 验证 token 复用、refresh、401 重试等逻辑
- 更新 test_upstream_key_sync.py 的 FakeClient 增加 ensure_authenticated
- 所有现有测试保持通过(87 passed)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-07-02 09:26:19 +08:00
liumangmang
9c9a4b3423
fix: 对齐 test_account 在 404 响应下的日志成功标志及错误类型口径,与标准接口行为一致
2026-07-02 00:28:34 +08:00
liumangmang
3b23f21ef3
fix: 优化清理失效账号执行响应的 success 标志,对 test_account/delete_account 引入外部 API 日志审计,并对账号 ID 进行安全转义
2026-07-02 00:25:24 +08:00