Skip to content

feat: migrate Key Policy Plus to native CPA keys#2

Draft
konbakuyomu wants to merge 68 commits into
neteroster:mainfrom
konbakuyomu:codex/codexcont-executor-migration
Draft

feat: migrate Key Policy Plus to native CPA keys#2
konbakuyomu wants to merge 68 commits into
neteroster:mainfrom
konbakuyomu:codex/codexcont-executor-migration

Conversation

@konbakuyomu

Copy link
Copy Markdown

Summary

  • migrate CPA Key Policy+ into a passive policy layer over CPA/CPAMP native keys
  • remove Plus-side raw key lifecycle controls from the admin UI
  • add native-key sync, alias lookup, quota denial decisions, and user portal native-key login
  • record production deployment evidence and CPA executor ABI status/header limitation in Trellis/specs

Validation

  • go test ./... in cpa_key_policy_plus_plugin/go
  • git diff --check
  • Trellis task validate
  • production: cpa health 200, cpa-usage root 200, public admin paths 404
  • production: native key session/me/usage/events/codexcont all 200
  • production: /v1/models 200 and /v1/responses completed
  • production: temporary 5H quota returns OpenAI-compatible rate_limit_exceeded body, then restored

konbakuyomu added 30 commits July 1, 2026 12:19
konbakuyomu added 30 commits July 2, 2026 19:49
修复 Key Policy+ 管理页的新建 Key、保存、清零 API 通路,改为通过 admin management alias 写入。

新增模型目录安全投影、结构化模型/价格编辑器、移动端布局修正,并沉淀 Plus 管理路由与部署契约。
- add executor-only CPA plugin routing and CPAMP monitor
- keep Key Policy Plus as usage portal owner with executor summaries
- document production cutover and retire old sidecar chain
背景/目的:
- Plus 管理页需要跟随 CPAMP 官方原生 Key 列表,避免旧 cpa_ / legacy 行继续混在策略表里。
- Codex 客户端请求 gpt-5.5 时,executor 需要稳定映射到当前可用的上游 Codex 模型。

主要改动:
- 管理端 key 列表读取前强制同步 CPA config 与 CPAMP alias DB,并默认只返回当前存在的 native_cpa 行。
- 前端“显示官方已移除”改为重新请求 include_removed 诊断视图,普通表格不再靠本地过滤旧数据。
- CPAMP alias hash 兼容裸 SHA256 和大小写 sha256: 前缀。
- executor 默认加入 gpt-5.4 / gpt-5.5 到 gpt-5.3-codex-spark 的上游映射,并保持下游可见模型不变。
- 新增 Plus / executor 回归测试,并把本轮生产验收边界写回 Trellis spec 与任务文档。

影响/兼容性:
- 历史 legacy/native removed 行仍保留在 SQLite 中,默认管理表不展示;不会删除历史账单。
- 若上游 Codex OAuth token 已失效,请求仍会返回 auth_unavailable,需要重新登录或替换 CPA auth 文件。

测试:
- go test ./... in cpa_key_policy_plus_plugin/go
- go test ./... in cpa_codexcont_executor_plugin/go
- git diff --check
- python ./.trellis/scripts/task.py validate .trellis/tasks/07-03-07-03-native-key-sync-auth-availability
- 生产部署 smoke:Plus 默认 key API 返回 4 个 native_cpa;cpa-usage 首页 200;public admin/resource paths 404;gpt-5.5 请求进入 host callback 后因 invalidated OAuth token 被上游拒绝。
- add SQLite busy timeout and single-writer store discipline for Plus

- make native CPA keys default enabled while warning on missing limits

- keep Plus admin table as current official key mirror

- record production smoke evidence in Trellis task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant