通过 Telegram 命令管理 OpenAI Codex 配置文件,支持用量查询与 OAuth Token 刷新,并提供队列化安全应用(queued safe apply)及进度更新。
QQ 维护路径: 对所有 Codex 配置操作使用代码解析器.是一项面向实际任务的技能,主要用于Standone codex-usage 和 codex-auth 技能被贬损;此技能将两个脚本合并:. . scripts/codex usage.py.。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;
涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
✅ 维护路径:所有 Codex 档案操作统一使用
codex-profiler。 独立的codex-usage和codex-auth技能已弃用。
该技能整合了以下两个脚本:
scripts/codex_usage.py(用量/配额检查)scripts/codex_auth.py(用于启动/状态查询的 OAuth 辅助工具)对于认证/档案变更操作,本技能现统一采用网关原生命令:openclaw models auth ...。
auth-profiles.json 视为网关托管状态,在常规操作中禁止直接修改。openclaw models auth ...、openclaw models auth order ...),而非脚本级的文件写入。RISK.md。/codex_usage → 选择器(默认 / 全部 / 已发现的档案)/codex_usage /codex_auth → 选择器(档案列表)/codex_auth /codex_auth finish (仅限辅助用途;档案/顺序变更必须使用网关原生命令)对于 /codex_usage,需首先单独发送一条即时进度消息:
交付规则:
NO_REPLY。对于认证/档案/顺序变更操作,须明确提示用户:写入由网关统一管理,并强制执行“先应用、后验证”流程:
openclaw models auth ... 执行此操作,并随后使用 models status 和 auth order get 进行验证。”openclaw models auth order set ...),确保其永不被选中。针对认证/档案/顺序变更,必须严格遵循以下三步流程:
openclaw models status --json openclaw models auth order get --provider openai-codex --agent
openclaw models auth order set --provider openai-codex --agent# 或 openclaw models auth order clear --provider openai-codex --agent # 或提供方登录流程 openclaw models auth login --provider openai-codex
openclaw models status --json openclaw models auth order get --provider openai-codex --agent
验证步骤严禁跳过。若结果与预期不符,禁止手动编辑文件;应诊断问题并重新通过网关原生命令执行变更。
# 用量检查(只读) python3 skills/codex-profiler/scripts/codex_usage.py --profile all --timeout-sec 25 --retries 1 --debug python3 skills/codex-profiler/scripts/codex_usage.py --profile all --format text # OAuth 辅助工具(仅解析 callback / 查询状态) python3 skills/codex-profiler/scripts/codex_auth.py start --profile default python3 skills/codex-profiler/scripts/codex_auth.py status
curl|bash、wget|sh)。sudo / SSH / 系统级主机变更命令。chatgpt.com)。当被问及运行多个 Codex 账号/档案、轮换策略或备用方案时,请查阅:
references/multi-account-rotation.md快速聊天回答请使用简版模板;配置/排障请求请使用深度模板。
~/.openclaw/agents/main/agent/auth-profiles.json 的认证档案。auth-profiles.json;auth.json 仅为向后兼容遗留文件,不应作为主状态源使用。auth-profiles.json、残留的遗留文件、或陈旧的运行时冷却状态),再判断是否为模型回退缺陷。accountId 并非自动视为缺陷。在此环境中,多个标签可映射至同一 workspace/account 身份且仍正常运作。只要两个档案均通过认证验证并在 /codex_usage 中可用,即视为健康状态;仅当出现认证失败或路由失败时才需进一步排查。https://chatgpt.com/backend-api/wham/usage。401 错误归类为 auth_not_accepted_by_usage_endpoint 并给出清晰提示,同时仍返回本地档案健康状态。summary、formatted_profiles 和 suggested_user_message,便于更整洁地格式化 slash 命令响应。/codex_usage 的首选严格输出格式(每档案单行):🟢 %profile%` — 5h **%5h_left%** | week **%week_left%** | r5 **%5h_reset%** | rw **%week_reset%**`🟠,不可用或认证无效时使用 🔴。openclaw models auth ... / openclaw models auth order ...),且必须配合强制预检 + 验证流程。codex_auth.py status --profile 仍适用于按档案粒度的辅助状态检查。