Repository navigation
Releases: Cody292/credential-priority
Releases · Cody292/credential-priority
Release list
v1.1.9
credential-priority v1.1.9
更新内容
中文
- 探针优化:更新了 Antigravity 配额探针的 User-Agent 标识,与官方客户端保持对齐。
- 影响:提升了 Antigravity 配额探测的稳定性与兼容性。
- 适用范围:仅影响 Antigravity;Codex、xAI 探针与规则保持不变。
- 无需修改配置:更新后自动生效,无需修改现有配置。
English
- Probe optimization: Updated the User-Agent identifier for the Antigravity quota probe to align with the official client.
- Impact: Improves the stability and compatibility of Antigravity quota probing.
- Scope: Affects Antigravity only; Codex and xAI probes and rules remain unchanged.
- No configuration change required: Takes effect automatically after update without modifying any configuration.
v1.1.8
credential-priority v1.1.8
更新内容
中文
- 行为变更:Antigravity 周配额耗尽判定不再仅对 Free/Unknown 套餐生效,而是对所有套餐统一生效。
- 影响:付费凭证在周限额耗尽时也会及时降级(优先级
-1并禁用),避免仍被选中导致请求失败。 - 适用范围:仅影响 Antigravity;Codex、xAI 规则不变。
- 无需修改任何配置,更新后新逻辑自动生效。
English
- Behavior change: Antigravity weekly-quota exhaustion no longer applies only to Free/Unknown plans — it now applies uniformly to all plan types.
- Impact: Paid credentials are demoted promptly when the weekly limit is exhausted (priority
-1and disabled), so they are not kept selected and cause request failures. - Scope: Affects Antigravity only; Codex and xAI rules are unchanged.
- No configuration change is required; the update takes effect automatically.
v1.1.7
credential-priority v1.1.7
更新内容
中文
- 优化:Antigravity 在同类型配额窗口中,优先选择剩余额度更小、重置时间更早的窗口,排序结果更稳定、可预期。
- 优化:长窗口判定调整为「不少于 5 天」;1 天 / 24 小时短窗口不再当作长窗口,配额重置与限额预估更精准。
- 适用范围:仅影响 Antigravity 凭证的配额窗口解读与排序依据;Codex、xAI 规则不变。
- 无需修改任何配置,更新后新逻辑自动生效。
English
- Improved: For Antigravity, when multiple quota windows share the same type, the plugin deterministically prefers the one with less remaining quota and an earlier reset, yielding more stable, predictable ordering.
- Improved: Long windows are now those lasting at least 5 days; 1-day / 24-hour short windows are no longer treated as long windows, so reset timing and limit estimates are more accurate.
- Scope: Affects only how Antigravity quota windows are interpreted for sorting; Codex and xAI rules are unchanged.
- No configuration change is required; the update takes effect automatically.
v1.1.6
credential-priority v1.1.6
更新内容
中文
- 优化:5 小时短窗口绝不进入 999 临近重置提权,避免短周期频繁抢占最高优先级。
- 优化:适用于 Antigravity 与 Codex 付费及免费路径的周或月长窗口,在重置前 24 小时内可正常参与 999 临近重置提权。
- 保持不变:各提供商优先级规则保持相互独立,互不影响。
- 优化:OAuth 付费 xAI 凭据现可在配置的 24 小时临近重置提权窗口内使用官方周度长窗口重置时间,而 xAI 免费账户依然不参与 999 临近重置提权。
- 无需修改任何配置,更新后新调度逻辑将自动生效。
English
- Improved: 5-hour short windows never enter the 999 near-reset boost, preventing short cycles from dominating top priority.
- Improved: Weekly and monthly long windows for applicable Antigravity and Codex paid or free tiers can participate in the 999 near-reset boost within 24 hours of reset.
- Unchanged: Provider priority rules remain independent and do not affect one another.
- Improved: OAuth paid xAI credentials can now use the official weekly long-window reset within the configured 24-hour near-reset boost window, while xAI Free still never receives the 999 near-reset boost.
- No configuration change is required; the update takes effect automatically.
v1.1.5
credential-priority v1.1.5
更新内容
中文
- 新增:生效基于 24 小时内实际额度刷新时间的调用偏好,优先调度即将重置的凭据。
- 优化:在同一模型提供商内,重置时间更近的凭据将获得更高的调度优先级。
- 保持不变:已启用且大于 0 的优先级数值保持唯一,并严格限制上限为 999。
- 保持不变:各提供商的优先级规则相互独立计算,互不影响。
- 保持不变:xAI 免费账户排除规则维持现状。
- 无需修改任何配置,更新后新调度策略将自动生效。
English
- New: Added an effective quota-reset-time-based 24-hour near-reset preference, prioritizing credentials that are expiring soon.
- Improved: Within the same provider, credentials with a nearer reset time now win the priority.
- Unchanged: Positive enabled priorities remain unique and are capped at 999.
- Unchanged: Provider priority rules remain independent.
- Unchanged: The xAI free account exclusion rule remains unchanged.
- No configuration change is required; the new scheduling strategy takes effect automatically upon update.
v1.1.4
credential-priority v1.1.4
更新内容
中文
- 起始优先级按配置生效:现在可以用扁平写法配置各提供商的起始优先级(例如
priority_rules.antigravity.start_priority),与嵌套写法效果一致。使用自定义起始优先级时,请打开priority_rules.enabled。 - 禁用凭证不再固定等 1 小时:额度用尽或被禁用的凭证,探测节奏改由「自动排序间隔」和「分批数量」控制,恢复更快、更跟手。
- 临近额度刷新时优先用完额度:距离额度刷新不足约 24 小时、且仍有剩余额度时,会把该凭证提到最高优先级。Antigravity 与 Codex 的免费凭证也适用;xAI 免费凭证不参与这项提权。
- 简化配置项:不再提供
cache_path/cache_ttl配置;探测缓存由插件内部自动处理。若旧配置里还写着这两项,会被忽略,不影响其它设置。 - 手动与自动排序一致:管理页手动执行与后台自动排序使用同一套优先级规则;手动执行仍会立即探测,不受自动间隔限制。
English
- Start priorities honor your config: Flat keys such as
priority_rules.antigravity.start_prioritynow work the same as nested YAML/JSON. Turn onpriority_rules.enabledto use custom start priorities. - No more fixed 1-hour wait for disabled accounts: Depleted or disabled credentials are re-probed using your auto-sort interval and batch size settings, so recovery follows the schedule you chose.
- Prefer accounts about to refresh: Within about 24 hours of a quota reset, credentials that still have remaining quota are boosted to the top priority. This applies to Antigravity and Codex free accounts; xAI free accounts are excluded.
- Fewer config knobs:
cache_pathandcache_ttlare no longer user settings; the plugin manages probe cache internally. Legacy keys in old configs are ignored safely. - Manual and automatic sorting stay aligned: Manual runs from the management UI and automatic background sorting share the same priority rules; manual runs still probe immediately and are not held back by the auto interval.
v1.1.3
credential-priority v1.1.3
相对 v1.1.2 的更新
行为变更:xAI Free 默认不参与优先级排序(opt-in)
- 新增配置
priority_rules.xai.free_participates_priority。 - 默认
false:xAI Free 凭证不参与正优先级提升、free-first 比较、provider uniqueness 重排。 - 仅当显式设置
priority_rules.xai.free_participates_priority: true时,才恢复既有 Free 高优 / free-first / uniqueness 行为。 - 关闭排序参与不影响 xAI Free 的 429 耗尽、冷却、401 硬禁用与成功恢复逻辑。
429 耗尽规则(与排序开关独立,默认仍生效)
- 30 分钟内累计 2 次 429 → free 额度耗尽:
priority=-1软禁用(free_depleted_disabled默认false,仅降 priority)。 - 成功 usage 清零失败计数;冷却锚点
first_success_at + 24h(无成功记录则用触发耗尽的失败时刻 + 24h)。 - 401 AuthInvalid(OAuth force 刷新后仍失效)→
priority=-1且disabled=true硬禁用;需重新登录恢复;不计入 free 失败次数。
隔离保证
- Codex、Antigravity 规则与写回路径不变。
- 显式
true时,v1.1.2 起的 Free 正优先级 / free-first 行为保持可用。
升级说明
- 替换
credential-priority.so(或对应平台动态库)后重启 CPA / CLIProxyAPI。 - 版本号仍为 1.1.3;若需要 Free 优先消耗,请在配置中显式设置:
priority_rules:
enabled: true
xai:
free_participates_priority: truev1.1.2
credential-priority v1.1.2
相对 v1.1.1 的更新
修复:JWT 数字 tier 识别 SuperGrok / paid(核心)
- 现网 SuperGrok 等付费账号 JWT 中
tier常为数字(如"tier": 1),encoding/json默认解成float64。 - v1.1.1 的
jwtTierClaim只接受 string,数字 tier 被静默丢弃 → 无法识别 paid → 回落default_unfetchable=free。 - 后果:付费号被假分类为 free,参与 free 高优排序,破坏「free 整体优先于 paid」策略。
本次改动(internal/provider/xai/plan.go)
anyToTierString:统一把 string / float64 / json.Number / int 等规范为 tier 字符串(整数避免"1.000000")。classifyTierToken:数字 tier≥1→ Paid(SuperGrok 等),0→ Free;负数忽略。jwtTierClaim/extractTierLike:走anyToTierString,settings/billing JSON 与 JWT 同源处理数字 tier。
行为影响
- SuperGrok / 数字 paid tier 正确标
paid,不再挤占 free 高优队列。 - free 可再次整体高于 paid 排序;unfetchable 默认 free 策略不变。
- 401 AuthInvalid 硬禁用、free 软禁用与 24h 锚点逻辑与 v1.1.1 一致。
升级说明
- 替换
credential-priority.so(或对应平台动态库)后重启 CPA / CLIProxyAPI。 - 无需改配置;若此前有付费号被误标 free,重启后下一轮 FetchPlan 会纠正套餐分类与排序。
v1.1.1
credential-priority v1.1.1
更新内容
xAI free 策略简化(核心)
- 停止 auto 路径用 chat 多模型探测额度:套餐识别改为
FetchPlan(settings / billing / JWT tier),无法获取套餐信息时默认 free;明确付费 tier 标记为 paid。 - free 高优排序:eligible free 凭证优先于其它 xAI 套餐,先消耗 free 额度。
- 业务失败驱动额度冷却:以 usage 旁路为主;连续 3 次额度类 429(free-usage-exhausted / rolling 24h tokens 等)→
priority=-1软禁用(不硬 disabled)。 - 24h 锚点 A:
next_eligible_at = first_success_at + 24h(无首次成功则用第三次失败时刻 +24h);到期后可恢复高优。 - free_depleted_disabled 默认 false:free 耗尽默认仅降权,不 PatchDisabled,避免 OAuth 刷新中断。
xAI 401 凭证失效硬禁用
- 识别 HTTP 401、CPA 文案(Invalid or expired credentials / no auth context)、本地 JWT/
expired已过期。 - OAuth force refresh 后仍失效 →
priority=-1+disabled=true(需重新登录),禁止再伪装成 free 正额度参与排序。 - 401 不计入 free 额度连续失败计数;与 free 软禁用语义分离。
OAuth 与探测节流
- xAI OAuth refresh(6h 节流 / 401 force):GetAuth + token_endpoint + SaveAuth。
- 手动 apply
forceProbe与自动 apply 规则共用、互不阻塞;AuthInvalid 强制 NeedsProbe。
其它
- 注册
usage_plugin/usage.handle作为业务主信号。 - 提供商规则保持独立(Codex / Antigravity 行为不变)。
- 管理页与诊断暴露 usage / auth_invalid 相关状态。
升级说明
- 替换
credential-priority.so后重启 CPA / CLIProxyAPI。 - 建议确认
priority_rules.xai.free_depleted_disabled为false(软禁用);若需硬禁用 free 耗尽可显式设为true。 - 已失效的 401 账号需重新登录获取 token 后才会恢复正序。
v1.1.0
credential-priority v1.1.0
更新内容
- 对齐宿主 ConfigFields 规范:通过 CPA 宿主
ConfigFields声明插件配置规则,支持在 CPA 宿主可视化插件配置面板或config.yaml/plugins.configs.credential-priority中集中配置。 - 优化 provider_scope 逻辑:简化为处理
all或以|分隔的提供商表达式(如antigravity|codex|xai),并向下兼容旧有的selected与selected_providers配置。 - 规范 Codex 规则语义:重命名为
priority_rules.codex.paid_depleted_disabled(默认false),保持语义一致性并对paid_depleted_keeps_enabled做兼容转换。 - 升级管理页面与看板:管理页(
/status静态 HTML 壳)仅保留 Management Key 校验、只读生效配置概览、执行记录(Run History)以及手动 Apply 触发,不在插件页内放置重复保存配置表单。 - 引入运行历史记录(Run History):内存中保留近 5 次自动/手动调度的执行状态、触发源、各 Provider 涉及数量与错误信息,便于实时诊断。
发布资产
- 自动构建并上传 darwin_amd64、darwin_arm64、freebsd_amd64、linux_amd64、linux_arm64、windows_amd64、windows_arm64 发布包。
- 发布包按 CPA 插件商店格式命名,动态库位于 zip 根目录。
- checksums.txt 提供所有发布包的 SHA256 校验值。