Codex
v1.0.1Profile Orchestrator 在 OpenClaw 内管理多个 OpenAI Codex OAuth 配置,无需 AI 决策循环。适用于需要确定性、始终在线的账户编排场景。
详细分析 ▾
运行时依赖
版本
修复个人配额报告,明确展示剩余 5 小时和每周的百分比,而非仅显示已用百分比。
安装命令
点击复制技能文档
# Codex Profile Orchestrator 用此技能替代临时故障转移脚本,实现确定性账户编排循环。 ## 功能 - 从 auth-profiles.json 发现配置 - 检测同邮箱工作区变体并创建 ws2/ws3 别名 - 基于固定阈值的配额感知配置选择 - 无效配置隔离,重复失败后可自动移除 - 主会话与后台会话同步 - 通过 OpenClaw 原生消息层发送简短 Telegram 通知 - 守护进程模式持续轮询 ## 推荐流程 1. 阅读 references/flow.md、references/state-model.md 和 references/naming-rules.md。 2. 使用 scripts/install_codex_profile_orchestrator.py 安装配置。 3. 执行试运行并检查 JSON 输出。 4. 执行一次应用模式。 5. 启动守护进程模式。 ## 命令 ### 安装配置 ``bash python3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target ` 可选额外会话目标: `bash python3 scripts/install_codex_profile_orchestrator.py \ --workspace /path/to/workspace \ --telegram-target \ --session-target agent:main:worker-a \ --session-target agent:main:worker-b ` ### 试运行 `bash python3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json ` ### 应用 `bash python3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json ` ### 守护进程 `bash nohup python3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --daemon >> /path/to/workspace/state/codex-profile-orchestrator.log 2>&1 & ` ## 核心规则 - 先发现当前活跃配置,若为新配置则注册。 - 若当前配置高于阈值,继续使用。 - 若当前配置低于阈值且存在更优可用配置,切换至最健康者。 - 若所有可用配置均低于阈值,继续使用当前配置直至其不可用,再切换。 - 同邮箱 + 同 user_id + 同 account_id 视为重复。 - 同邮箱 + 不同 account_id 视为新工作区变体。 - 立即将 401/403 类配置移出活跃池。 - 仅当失效连续次数达到设定阈值后才删除无效配置。 ## 通知 通知须简短且聚焦事件: - 发现新账户 - 发现新工作区变体 - 忽略重复 - 活跃配置已切换 - 配置已隔离 - 配置已移除 ## 参考 - references/flow.md - references/state-model.md - references/naming-rules.md - references/telegram-notify-rules.md`