Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,37 @@

All notable changes are recorded here. Versions follow [SemVer](https://semver.org/).

## Unreleased
## v0.7.34 (2026-11-09)

**schema 17 → 18**;新增可选 `[github]` 段(`client_id` / `client_secret`,留空 = 未启用,端点答 503「未启用」而非 500);**GitHub 登录**(设备码流程 + 网页登录页「使用 GitHub 登录」+ 身份即账号,rant 2026-11-09T14:43:55);`cargo test` 590 → 605。
自 v0.7.33 起累计 **28 个提交(#411–#443)**。**schema 16 → 18**(两跳:#417 升到 17、#443 升到 18,两者都是幂等迁移 `ensure_column`,老库原地升级)。**这一版主要是一版「账」** —— #437 记录的七项金额修复全部随本版落地:一个仍跑 v0.7.33 的部署,到今天为止都按任何一项修复之前的算法计费。此外新增 **GitHub 登录**(桌面端/CLI/agent 一次拿到 API Key),并补上四家国际厂商与当季模型。`cargo test` **605/0**。

### 计费与定价(#437 的七项,全部在本版)

- **周末与配置的节假日不再按高峰价计费(#412,`ada9043`)** — `is_peak_hour` 对周末直接判空闲,并新增可缺省的 `[billing] holidays` 表(空表=只豁免周末;畸形日期启动即报错)⇒ 原来是**多收**。
- **四家目录价改对,补上 grok-4.7 / qwen3.8-flash(#413,`eadfb9f`)** — 其中一条缓存命中价原本被写成 `0`。
- **按输入长度选档,而不是一律按第一档结算(#417,`544cf86`)** — 长输入原被按最低档结算 ⇒ **少收**。
- **缓存写入(cache-creation)token 入账(#433,`357ab01`)** — 原来按 0 计,平台自己吸收那部分成本。
- **管理端模型编辑器接受 `cache_write_input_per_m`(#434,`41ca047`)** — 否则运维连「选择开启」都做不到。
- **Anthropic 流式不再把缓存命中量从 `input_tokens` 里减掉(#436,`a49f130`)** — 未命中的输入段因此被算成 0,缓存占比越高差得越多。
- **`config.toml` 可以表达分档价与缓存写入价(#416,`496a723`)** — 此前这两个字段在配置里**根本没有位置**。
- **#442(`405f078`)** 用端到端测试把「缓存写入 token 真的走到账本」钉住:两处缝各一条测试,变异后必红。

### 登录

- **支持 GitHub 登录注册,桌面端一次拿到 API Key(#443,`149297b`)** — 两条流程共用一个身份落库函数:无浏览器回调的客户端走**设备码**(`POST /api/auth/github/device/code` → `device/token`,中间态 202/429/410/403,pending 绝不发 key),网页登录页加「**使用 GitHub 登录**」走**授权码**(`GET /api/auth/github/authorize` → `POST /api/auth/github/exchange`,state 绑 HttpOnly cookie,不匹配答 400 且不打上游、不落库)。身份只认 GitHub 的**稳定数字 `id`**(`login` 可改名,认它会开第二个账号);已有 key 复用,成功响应与邮箱登录逐字同形(`api_key` + `user_id`)。**注册即已验证**:不走邮箱验证码、不依赖邮箱。配置项只有两个(`[github] client_id` / `client_secret`),留空答 **503「未启用」**而不是 500。`users` 增 `github_id` / `github_login`,`github_id` 上一条**部分唯一索引排除空串** ⇒ 纯邮箱账号不受影响。

### 目录与配置

- **四家国际厂商可在上架表单里选(#414,`983111c`)** — OpenAI / Anthropic / Google / xAI 各带一个按量 plan,上架集合 6 厂商 12 plan → **10 厂商 16 plan**。
- **补上当季模型(#415,`b7d19ea`)**。
- **`config.toml` 里拼错或不认识的键直接报错(#439,`db0160f`)** — 此前静默忽略,配置写了等于没写。
- **模型编辑不跨重启存活这件事被明说,且每次覆盖都记日志(#441,`a6588f8`)** — 设置页/编辑器与 `config.toml` 的关系不再靠猜。

### 文档

- **十五条文档提交(#411、#418–#431)** 把散文与实际代码对齐:档位计费口径、密钥选择顺序、认证端点名册与各自真实动词、SMTP 重试次数、UI 实际有几个视图、运营充值能力、上架密钥可编辑等。这一批的共同点是:**断言写在散文里,而代码已经走在前面**。

`cargo test` **605/0**(v0.7.33 为 590);`cargo fmt --check` 与 `cargo clippy --all-targets -- -D warnings` 干净;UI 资产令牌随改动词表的提交一并更新(`app.js?v=20261109-1`、`i18n.js?v=20261109-1`)。

## v0.7.33 (2026-10-15)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aitokenpool"
version = "0.7.33"
version = "0.7.34"
edition = "2021"
description = "AI Token 共享池 — 企业 key 池 + 公共共享市场"
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# AITokenPool — multi-stage release image (v0.7.33)
# AITokenPool — multi-stage release image (v0.7.34)
#
# Build: docker build -t aitokenpool:0.7.33 .
# Build: docker build -t aitokenpool:0.7.34 .
# Run: docker run -p 8080:8080 -v "$PWD/atp-data:/data" \
# -e ATP_MASTER_KEY="$(openssl rand -hex 32)" \
# aitokenpool:0.7.33
# aitokenpool:0.7.34
#
# Notes:
# - unified data dir (rant 2026-08-19T20:53:23): ATP_DATA_DIR=/data holds
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AITokenPool — Docker Compose 一键部署(v0.7.33)
# AITokenPool — Docker Compose 一键部署(v0.7.34)
#
# 快速开始:
# export ATP_MASTER_KEY=$(openssl rand -hex 32) # 必填,见下方说明
Expand All @@ -16,7 +16,7 @@
services:
aitokenpool:
build: .
image: aitokenpool:0.7.33
image: aitokenpool:0.7.34
ports:
- "8080:8080"
volumes:
Expand Down
Loading