Skip to content

v1.1.1

Choose a tag to compare

@github-actions github-actions released this 01 Aug 15:53

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 后才会恢复正序。