mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 18:37:46 +08:00
feat(claude-code): 增加动态 CLI 客户端画像并按官方发布刷新版本
- 将 Claude Code 传输身份拆分为带版本的静态模板(Stainless/运行时/beta 策略)与动态 CLI 画像(cli_version / User-Agent),请求按快照读取保证 UA 与 billing cc_version 一致 - 将 codex_profile 泛化为 cli_client_profile,Codex 与 Claude Code 共享发布校验、缓存恢复、防回退与每日刷新逻辑 - Claude Code 跟随 npm latest,要求 8 个平台包版本与主包一致;支持 AETHER_CLAUDE_CODE_CLIENT_PROFILE_REFRESH 与 AETHER_CLAUDE_CODE_CLIENT_VERSION - 新增定时任务 maintenance.claude_code.client.profile,启动时与 Codex 画像并发预热 - 额度查询 User-Agent 改用动态画像,移除硬编码 CLAUDE_CODE_USAGE_USER_AGENT
This commit is contained in:
@@ -11,7 +11,6 @@ use crate::quota_refresh::ProviderPoolQuotaRequestSpec;
|
||||
pub const CLAUDE_CODE_OAUTH_USAGE_URL: &str =
|
||||
"https://api.anthropic.com/api/oauth/usage?cedar_ember=1&skip_spend=1";
|
||||
pub const CLAUDE_CODE_OAUTH_BETA: &str = "oauth-2025-04-20";
|
||||
pub const CLAUDE_CODE_USAGE_USER_AGENT: &str = "claude-cli/2.1.284 (external, cli)";
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct ClaudeCodeProviderPoolAdapter;
|
||||
@@ -62,7 +61,7 @@ pub fn build_claude_code_pool_quota_request(
|
||||
("x-app".to_string(), "cli".to_string()),
|
||||
(
|
||||
"user-agent".to_string(),
|
||||
CLAUDE_CODE_USAGE_USER_AGENT.to_string(),
|
||||
aether_provider_transport::claude_code::claude_code_client_user_agent(),
|
||||
),
|
||||
]);
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ pub use chatgpt_web::{
|
||||
pub use claude_code::ClaudeCodeProviderPoolAdapter;
|
||||
pub use claude_code::{
|
||||
build_claude_code_pool_quota_request, CLAUDE_CODE_OAUTH_BETA, CLAUDE_CODE_OAUTH_USAGE_URL,
|
||||
CLAUDE_CODE_USAGE_USER_AGENT,
|
||||
};
|
||||
pub use codex::CodexProviderPoolAdapter;
|
||||
pub use codex::{
|
||||
|
||||
Reference in New Issue
Block a user