{"id":"cbdbe374-5c27-41ce-a195-dcbc2e1ccec9","entityType":"agent","slug":"clawhub-ugurinanc12-codex-profile-orchestrator","name":"Codex Profile Orchestrator","canonicalUrl":"https://www.xpersona.co/agent/clawhub-ugurinanc12-codex-profile-orchestrator","canonicalPath":"/agent/clawhub-ugurinanc12-codex-profile-orchestrator","generatedAt":"2026-10-13T00:15:14.769Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-12T02:23:43.832Z","emptyReason":null},"description":"deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra... Skill: Codex Profile Orchestrator Owner: ugurinanc12 Summary: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra... Tags: latest:2.1.1 Version history: v2.1.1 | 2026-04-21T20:55:18.757Z | user Prevent repeated low-limit Telegram alerts until threshold recovers v2.1.0 | 2026-04-21T19:53:58.304Z | user Refined Win","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 955 downloads reported by the source. Last updated 10/12/2026.","installCommand":"clawhub skill install s17e43s5845fkkyca9jkhccm3x84zzdk:codex-profile-orchestrator","sourceUrl":"https://clawhub.ai/ugurinanc12/codex-profile-orchestrator","homepage":"https://clawhub.ai/ugurinanc12/skills/codex-profile-orchestrator","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/ugurinanc12/codex-profile-orchestrator","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/ugurinanc12/skills/codex-profile-orchestrator","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:23:43.832Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:23:43.832Z","emptyReason":null},"stars":null,"forks":null,"downloads":955,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"2.1.1","tractionLabel":"955 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:23:43.820Z","emptyReason":null},"lastUpdatedAt":"2026-10-12T02:23:43.832Z","lastCrawledAt":"2026-10-12T02:23:43.820Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-13T02:23:43.820Z","lastVerifiedAt":null,"highlights":[{"version":"2.1.1","createdAt":"2026-04-21T20:55:18.757Z","changelog":"Prevent repeated low-limit Telegram alerts until threshold recovers","fileCount":7,"zipByteSize":13621},{"version":"2.1.0","createdAt":"2026-04-21T19:53:58.304Z","changelog":"Refined Windows profile orchestration with safer output handling, stable Telegram notifications, gap-aware workspace aliases, and machine-agnostic command resolution. Removed machine-specific fallback paths and polished failover behavior for cleaner publishing and safer multi-account rotation.","fileCount":6,"zipByteSize":11715},{"version":"1.0.5","createdAt":"2026-04-20T18:21:31.039Z","changelog":"codex-profile-orchestrator 1.0.5 - Added scripts/codex_profile_report.py to the repository. - Minor formatting updates in SKILL.md for improved readability. - No changes to core logic or behavior.","fileCount":11,"zipByteSize":18894},{"version":"1.0.4","createdAt":"2026-04-19T21:12:07.888Z","changelog":"Harden workspace variant recovery, add Telegram threshold and switch alerts, enrich new-account notifications, fix notification delivery timeout","fileCount":11,"zipByteSize":16491},{"version":"1.0.3","createdAt":"2026-04-19T20:51:13.675Z","changelog":"Fix workspace variant recovery, add threshold and switch Telegram alerts, enrich new account notifications, sanitize tests","fileCount":11,"zipByteSize":16343},{"version":"1.0.2","createdAt":"2026-04-19T19:59:42.043Z","changelog":"Harden failover logic for exhausted 5h quotas, improve daemon resilience, and add regression tests for profile selection/account separation.","fileCount":11,"zipByteSize":14936},{"version":"1.0.1","createdAt":"2026-04-19T15:10:07.165Z","changelog":"Fix profile quota reporting to expose 5-hour and weekly remaining percentages explicitly instead of only used percentages.","fileCount":10,"zipByteSize":12386},{"version":"1.0.0","createdAt":"2026-04-19T15:03:21.131Z","changelog":"Initial English release. Adds deterministic discovery, registration, quarantine, cleanup, session sync, and native Telegram notifications for OpenClaw Codex account orchestration.","fileCount":10,"zipByteSize":12140}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17e43s5845fkkyca9jkhccm3x84zzdk:codex-profile-orchestrator","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-13T00:15:14.768Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ugurinanc12-codex-profile-orchestrator/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-12T02:23:43.832Z","emptyReason":null},"readme":"Skill: Codex Profile Orchestrator\n\nOwner: ugurinanc12\n\nSummary: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra...\n\nTags: latest:2.1.1\n\nVersion history:\n\nv2.1.1 | 2026-04-21T20:55:18.757Z | user\n\nPrevent repeated low-limit Telegram alerts until threshold recovers\n\nv2.1.0 | 2026-04-21T19:53:58.304Z | user\n\nRefined Windows profile orchestration with safer output handling, stable Telegram notifications, gap-aware workspace aliases, and machine-agnostic command resolution. Removed machine-specific fallback paths and polished failover behavior for cleaner publishing and safer multi-account rotation.\n\nv1.0.5 | 2026-04-20T18:21:31.039Z | auto\n\ncodex-profile-orchestrator 1.0.5\n\n- Added scripts/codex_profile_report.py to the repository.\n- Minor formatting updates in SKILL.md for improved readability.\n- No changes to core logic or behavior.\n\nv1.0.4 | 2026-04-19T21:12:07.888Z | user\n\nHarden workspace variant recovery, add Telegram threshold and switch alerts, enrich new-account notifications, fix notification delivery timeout\n\nv1.0.3 | 2026-04-19T20:51:13.675Z | user\n\nFix workspace variant recovery, add threshold and switch Telegram alerts, enrich new account notifications, sanitize tests\n\nv1.0.2 | 2026-04-19T19:59:42.043Z | user\n\nHarden failover logic for exhausted 5h quotas, improve daemon resilience, and add regression tests for profile selection/account separation.\n\nv1.0.1 | 2026-04-19T15:10:07.165Z | user\n\nFix profile quota reporting to expose 5-hour and weekly remaining percentages explicitly instead of only used percentages.\n\nv1.0.0 | 2026-04-19T15:03:21.131Z | user\n\nInitial English release. Adds deterministic discovery, registration, quarantine, cleanup, session sync, and native Telegram notifications for OpenClaw Codex account orchestration.\n\nArchive index:\n\nArchive v2.1.1: 7 files, 13621 bytes\n\nFiles: agents/openai.yaml (124b), references/state-model.md (873b), scripts/codex_profile_orchestrator.py (37331b), scripts/install_codex_profile_orchestrator.py (2871b), skill-card.md (2324b), SKILL.md (1731b), _meta.json (145b)\n\nFile v2.1.1:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegram session sync, network outage protection, and install helpers. use when chatgpt needs to stabilize or rebuild multi-account codex switching, inspect auth-profiles.json, select the healthiest account, or package a safer replacement for fragile profile rotation logic.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to manage multiple Codex OAuth profiles without a fuzzy AI loop.\n\n## Core resources\n\n- `scripts/codex_profile_orchestrator.py` contains the full orchestrator, reporting, and self-test flow.\n- `scripts/install_codex_profile_orchestrator.py` writes a Windows-friendly config and starter script into an OpenClaw workspace.\n- `references/state-model.md` explains how identities, variants, duplicates, and invalid streaks are tracked.\n\n## Recommended workflow\n\n1. Install the config into the target workspace.\n2. Run a dry run first and inspect the JSON payload.\n3. Apply once.\n4. Start daemon mode only after the dry run looks correct.\n\n## Rules\n\n- Treat internet or ChatGPT reachability failures as transport incidents, not as broken accounts.\n- Quarantine only 401, 403, 400, missing-token, or clearly expired-token profiles.\n- Keep weekly availability as a hard gate. Keep five-hour remaining as the primary tie-breaker for switching.\n- Detect same email plus same user plus same account as a duplicate.\n- Detect same email plus same user plus different account as a workspace variant and register it as `ws2`, `ws3`, and so on.\n- Sync Telegram and other OpenClaw session overrides to the selected profile.\n\nFile v2.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"2.1.1\",\n  \"publishedAt\": 1776804918757\n}\n\nFile v2.1.1:references/state-model.md\n\n# State Model\n\n## Identity key\n\nEach discovered profile is normalized to:\n- email\n- user id\n- account id\n\nThe tuple `email|user_id|account_id` is the exact identity key.\n\n## Canonical ids\n\n- primary identity: `openai-codex:<email-slug>`\n- workspace variants: `openai-codex:<email-slug>-ws2`, `-ws3`, and so on\n\n## Health rules\n\n- network outage: do not quarantine, do not delete, prefer staying on the current profile\n- invalid profile: 400, 401, 403, missing token, token expired\n- usable profile: weekly remaining above zero and five-hour remaining above zero\n\n## Selection rules\n\n1. keep the current profile if it is still healthy and its five-hour remaining stays above threshold\n2. otherwise switch to the healthy profile with the best five-hour remaining\n3. use weekly remaining as a second tie-breaker\n4. prefer primary over workspace variant when the score is tied\n\nFile v2.1.1:skill-card.md\n\n## Description:\n\nDeterministic OpenClaw Codex profile failover for Windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, Telegram session sync, network outage protection, and install helpers.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[ugurinanc12](https://clawhub.ai/user/ugurinanc12)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and operators use this skill to stabilize multi-account Codex profile switching in OpenClaw workspaces, inspect OAuth profile state, select a healthier account, and install a repeatable profile orchestration workflow.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can copy token-bearing Codex profile data into workspace registry or backup files.\n\nMitigation: Run dry-run first, keep the workspace state directory private, and protect or remove registry and backup files that may contain credentials.\n\nRisk: Apply or daemon mode can rewrite authentication profile order, session overrides, and remove invalid profiles after the configured streak.\n\nMitigation: Inspect the dry-run JSON before enabling apply or daemon mode, and use conservative invalid-streak settings.\n\nRisk: Telegram and other OpenClaw session sync can move session overrides to the selected profile.\n\nMitigation: Limit configured session targets and verify the selected profile before enabling notifications or session sync.\n\n## Reference(s):\n\n- [State Model](references/state-model.md)\n- [ClawHub skill page](https://clawhub.ai/ugurinanc12/skills/codex-profile-orchestrator)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with JSON payloads, shell commands, and configuration files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can produce dry-run reports, apply-mode changes, daemon startup commands, and installation configuration.]\n\n## Skill Version(s):\n\n2.1.1 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v2.1.1:agents/openai.yaml\n\ninterface:\n  display_name: \"Codex Profile Orchestrator\"\n  short_description: \"stabilize codex account rotation in openclaw\"\n\nArchive v2.1.0: 6 files, 11715 bytes\n\nFiles: agents/openai.yaml (124b), references/state-model.md (873b), scripts/codex_profile_orchestrator.py (33952b), scripts/install_codex_profile_orchestrator.py (2871b), SKILL.md (1731b), _meta.json (145b)\n\nFile v2.1.0:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegram session sync, network outage protection, and install helpers. use when chatgpt needs to stabilize or rebuild multi-account codex switching, inspect auth-profiles.json, select the healthiest account, or package a safer replacement for fragile profile rotation logic.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to manage multiple Codex OAuth profiles without a fuzzy AI loop.\n\n## Core resources\n\n- `scripts/codex_profile_orchestrator.py` contains the full orchestrator, reporting, and self-test flow.\n- `scripts/install_codex_profile_orchestrator.py` writes a Windows-friendly config and starter script into an OpenClaw workspace.\n- `references/state-model.md` explains how identities, variants, duplicates, and invalid streaks are tracked.\n\n## Recommended workflow\n\n1. Install the config into the target workspace.\n2. Run a dry run first and inspect the JSON payload.\n3. Apply once.\n4. Start daemon mode only after the dry run looks correct.\n\n## Rules\n\n- Treat internet or ChatGPT reachability failures as transport incidents, not as broken accounts.\n- Quarantine only 401, 403, 400, missing-token, or clearly expired-token profiles.\n- Keep weekly availability as a hard gate. Keep five-hour remaining as the primary tie-breaker for switching.\n- Detect same email plus same user plus same account as a duplicate.\n- Detect same email plus same user plus different account as a workspace variant and register it as `ws2`, `ws3`, and so on.\n- Sync Telegram and other OpenClaw session overrides to the selected profile.\n\nFile v2.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"2.1.0\",\n  \"publishedAt\": 1776801238304\n}\n\nFile v2.1.0:references/state-model.md\n\n# State Model\n\n## Identity key\n\nEach discovered profile is normalized to:\n- email\n- user id\n- account id\n\nThe tuple `email|user_id|account_id` is the exact identity key.\n\n## Canonical ids\n\n- primary identity: `openai-codex:<email-slug>`\n- workspace variants: `openai-codex:<email-slug>-ws2`, `-ws3`, and so on\n\n## Health rules\n\n- network outage: do not quarantine, do not delete, prefer staying on the current profile\n- invalid profile: 400, 401, 403, missing token, token expired\n- usable profile: weekly remaining above zero and five-hour remaining above zero\n\n## Selection rules\n\n1. keep the current profile if it is still healthy and its five-hour remaining stays above threshold\n2. otherwise switch to the healthy profile with the best five-hour remaining\n3. use weekly remaining as a second tie-breaker\n4. prefer primary over workspace variant when the score is tied\n\nFile v2.1.0:agents/openai.yaml\n\ninterface:\n  display_name: \"Codex Profile Orchestrator\"\n  short_description: \"stabilize codex account rotation in openclaw\"\n\nArchive v1.0.5: 11 files, 18894 bytes\n\nFiles: _meta.json (145b), references/flow.md (780b), references/naming-rules.md (431b), references/state-model.md (363b), references/telegram-notify-rules.md (389b), scripts/codex_profile_orchestrator.py (35457b), scripts/codex_profile_report.py (5086b), scripts/codex_profile_runtime.py (5122b), scripts/install_codex_profile_orchestrator.py (2556b), scripts/test_codex_profile_orchestrator.py (13967b), SKILL.md (3416b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: Manage multiple OpenAI Codex OAuth profiles inside OpenClaw without using an AI decision loop. Use when you need a deterministic, always-on account orchestrator that discovers newly added Codex profiles, registers same-email workspace variants as ws2/ws3 aliases, quarantines or removes broken profiles that return 401/403-style errors, selects the healthiest profile by quota rules, synchronizes session authProfileOverride targets, and emits short Telegram notifications about account events.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to replace ad hoc failover scripts with one deterministic account orchestration loop.\n\n## What it provides\n\n- profile discovery from `auth-profiles.json`\n- same-email workspace variant detection and ws2/ws3 alias creation\n- quota-aware profile selection using a fixed threshold\n- invalid profile quarantine and optional auto-removal after repeated failures\n- session synchronization for main and background sessions\n- short Telegram notifications sent through OpenClaw's native messaging layer\n- daemon mode for continuous polling\n\n## Recommended workflow\n\n1. Read `references/flow.md`, `references/state-model.md`, and `references/naming-rules.md`.\n2. Install the config with `scripts/install_codex_profile_orchestrator.py`.\n3. Run a dry run and inspect the JSON output.\n4. Run apply mode once.\n5. Start daemon mode.\n\n## Commands\n\n\n### Install config\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>\n```\n\nOptional additional session targets:\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b\n```\n\n### Dry run\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json\n```\n\n### Apply\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json\n```\n\n### Daemon\n\n```bash\nnohup 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 &\n```\n\n## Core rules\n\n- Discover the currently active profile first, then register it if it is new.\n- If the current profile is above the threshold, keep using it.\n- If the current profile is below the threshold and a better usable profile exists, switch to the healthiest one.\n- If every usable profile is below the threshold, keep using the current one until it becomes unusable, then switch.\n- Treat same email + same user_id + same account_id as a duplicate.\n- Treat same email + different account_id as a new workspace variant.\n- Remove 401/403-style profiles from the active selection pool immediately.\n- Delete invalid profiles only after the configured invalid streak threshold is reached.\n\n## Notifications\n\nNotifications must stay short and event-focused:\n- new account found\n- new workspace variant found\n- duplicate ignored\n- active profile switched\n- profile quarantined\n- profile removed\n\n## References\n\n- `references/flow.md`\n- `references/state-model.md`\n- `references/naming-rules.md`\n- `references/telegram-notify-rules.md`\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1776709291039\n}\n\nFile v1.0.5:references/flow.md\n\n# Flow\n\n## Per cycle\n\n1. Detect the currently active profile.\n2. Scan the auth store.\n3. Register the active profile first if it is missing from the registry.\n4. Create a ws alias when the same email appears with a different account/workspace id.\n5. Fetch usage and compute health.\n6. Quarantine invalid profiles.\n7. Remove profiles whose invalid streak crosses the configured threshold.\n8. Choose the best profile using the threshold rule.\n9. Synchronize target sessions.\n10. Send short Telegram notifications.\n\n## Threshold rule\n\n- If the current profile is above the threshold, keep it.\n- If the current profile is below the threshold and a better usable profile exists, switch.\n- If every usable profile is below the threshold, keep the current one until it becomes unusable.\n\nFile v1.0.5:references/naming-rules.md\n\n# Naming rules\n\n## Primary\n\nBase profile id:\n- `openai-codex:<email>`\n\n## Workspace variant\n\nWhen the same email appears with a different account/workspace id:\n- `openai-codex:<slug>-ws2`\n- `openai-codex:<slug>-ws3`\n\n## Duplicate\n\nIf email + user_id + account_id are identical, do not create a new alias.\n\n## Principle\n\nNaming must be deterministic.\nRunning discovery twice must not create a different alias for the same identity.\n\nFile v1.0.5:references/state-model.md\n\n# State model\n\nThe registry file stores:\n\n- `identities{}`\n- `knownProfileIds[]`\n- `lastPreferredProfileId`\n- `notificationState{}`\n- `updatedAt`\n\n## Identity record\n\n- `email`\n- `userId`\n- `accountId`\n- `canonicalId`\n- `kind`\n- `sourceProfileId`\n- `status`\n- `invalidStreak`\n- `lastInvalidReason`\n- `firstSeenAt`\n- `lastSeenAt`\n- `lastHealthyAt`\n- `profileBlob`\n\nFile v1.0.5:references/telegram-notify-rules.md\n\n# Telegram notify rules\n\nNotifications must stay short, specific, and single-event.\n\n## Examples\n\n- `New account found: foo@gmail.com`\n- `New workspace variant: ugur-ws2`\n- `Duplicate profile ignored: openai-codex:foo`\n- `Active profile switched: foo -> bar`\n- `Profile quarantined: foo (401)`\n- `Profile removed: foo`\n\n## Principle\n\n- no extra detail\n- short text\n- one event per message\n\nArchive v1.0.4: 11 files, 16491 bytes\n\nFiles: _meta.json (145b), references/flow.md (780b), references/naming-rules.md (431b), references/state-model.md (363b), references/telegram-notify-rules.md (389b), scripts/codex_profile_orchestrator.py (27523b), scripts/codex_profile_report.py (2369b), scripts/codex_profile_runtime.py (5122b), scripts/install_codex_profile_orchestrator.py (2556b), scripts/test_codex_profile_orchestrator.py (13967b), SKILL.md (3415b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: Manage multiple OpenAI Codex OAuth profiles inside OpenClaw without using an AI decision loop. Use when you need a deterministic, always-on account orchestrator that discovers newly added Codex profiles, registers same-email workspace variants as ws2/ws3 aliases, quarantines or removes broken profiles that return 401/403-style errors, selects the healthiest profile by quota rules, synchronizes session authProfileOverride targets, and emits short Telegram notifications about account events.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to replace ad hoc failover scripts with one deterministic account orchestration loop.\n\n## What it provides\n\n- profile discovery from `auth-profiles.json`\n- same-email workspace variant detection and ws2/ws3 alias creation\n- quota-aware profile selection using a fixed threshold\n- invalid profile quarantine and optional auto-removal after repeated failures\n- session synchronization for main and background sessions\n- short Telegram notifications sent through OpenClaw's native messaging layer\n- daemon mode for continuous polling\n\n## Recommended workflow\n\n1. Read `references/flow.md`, `references/state-model.md`, and `references/naming-rules.md`.\n2. Install the config with `scripts/install_codex_profile_orchestrator.py`.\n3. Run a dry run and inspect the JSON output.\n4. Run apply mode once.\n5. Start daemon mode.\n\n## Commands\n\n### Install config\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>\n```\n\nOptional additional session targets:\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b\n```\n\n### Dry run\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json\n```\n\n### Apply\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json\n```\n\n### Daemon\n\n```bash\nnohup 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 &\n```\n\n## Core rules\n\n- Discover the currently active profile first, then register it if it is new.\n- If the current profile is above the threshold, keep using it.\n- If the current profile is below the threshold and a better usable profile exists, switch to the healthiest one.\n- If every usable profile is below the threshold, keep using the current one until it becomes unusable, then switch.\n- Treat same email + same user_id + same account_id as a duplicate.\n- Treat same email + different account_id as a new workspace variant.\n- Remove 401/403-style profiles from the active selection pool immediately.\n- Delete invalid profiles only after the configured invalid streak threshold is reached.\n\n## Notifications\n\nNotifications must stay short and event-focused:\n- new account found\n- new workspace variant found\n- duplicate ignored\n- active profile switched\n- profile quarantined\n- profile removed\n\n## References\n\n- `references/flow.md`\n- `references/state-model.md`\n- `references/naming-rules.md`\n- `references/telegram-notify-rules.md`\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1776633127888\n}\n\nFile v1.0.4:references/flow.md\n\n# Flow\n\n## Per cycle\n\n1. Detect the currently active profile.\n2. Scan the auth store.\n3. Register the active profile first if it is missing from the registry.\n4. Create a ws alias when the same email appears with a different account/workspace id.\n5. Fetch usage and compute health.\n6. Quarantine invalid profiles.\n7. Remove profiles whose invalid streak crosses the configured threshold.\n8. Choose the best profile using the threshold rule.\n9. Synchronize target sessions.\n10. Send short Telegram notifications.\n\n## Threshold rule\n\n- If the current profile is above the threshold, keep it.\n- If the current profile is below the threshold and a better usable profile exists, switch.\n- If every usable profile is below the threshold, keep the current one until it becomes unusable.\n\nFile v1.0.4:references/naming-rules.md\n\n# Naming rules\n\n## Primary\n\nBase profile id:\n- `openai-codex:<email>`\n\n## Workspace variant\n\nWhen the same email appears with a different account/workspace id:\n- `openai-codex:<slug>-ws2`\n- `openai-codex:<slug>-ws3`\n\n## Duplicate\n\nIf email + user_id + account_id are identical, do not create a new alias.\n\n## Principle\n\nNaming must be deterministic.\nRunning discovery twice must not create a different alias for the same identity.\n\nFile v1.0.4:references/state-model.md\n\n# State model\n\nThe registry file stores:\n\n- `identities{}`\n- `knownProfileIds[]`\n- `lastPreferredProfileId`\n- `notificationState{}`\n- `updatedAt`\n\n## Identity record\n\n- `email`\n- `userId`\n- `accountId`\n- `canonicalId`\n- `kind`\n- `sourceProfileId`\n- `status`\n- `invalidStreak`\n- `lastInvalidReason`\n- `firstSeenAt`\n- `lastSeenAt`\n- `lastHealthyAt`\n- `profileBlob`\n\nFile v1.0.4:references/telegram-notify-rules.md\n\n# Telegram notify rules\n\nNotifications must stay short, specific, and single-event.\n\n## Examples\n\n- `New account found: foo@gmail.com`\n- `New workspace variant: ugur-ws2`\n- `Duplicate profile ignored: openai-codex:foo`\n- `Active profile switched: foo -> bar`\n- `Profile quarantined: foo (401)`\n- `Profile removed: foo`\n\n## Principle\n\n- no extra detail\n- short text\n- one event per message\n\nArchive v1.0.3: 11 files, 16343 bytes\n\nFiles: _meta.json (145b), references/flow.md (780b), references/naming-rules.md (431b), references/state-model.md (363b), references/telegram-notify-rules.md (389b), scripts/codex_profile_orchestrator.py (26905b), scripts/codex_profile_report.py (2369b), scripts/codex_profile_runtime.py (5122b), scripts/install_codex_profile_orchestrator.py (2556b), scripts/test_codex_profile_orchestrator.py (13967b), SKILL.md (3415b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: Manage multiple OpenAI Codex OAuth profiles inside OpenClaw without using an AI decision loop. Use when you need a deterministic, always-on account orchestrator that discovers newly added Codex profiles, registers same-email workspace variants as ws2/ws3 aliases, quarantines or removes broken profiles that return 401/403-style errors, selects the healthiest profile by quota rules, synchronizes session authProfileOverride targets, and emits short Telegram notifications about account events.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to replace ad hoc failover scripts with one deterministic account orchestration loop.\n\n## What it provides\n\n- profile discovery from `auth-profiles.json`\n- same-email workspace variant detection and ws2/ws3 alias creation\n- quota-aware profile selection using a fixed threshold\n- invalid profile quarantine and optional auto-removal after repeated failures\n- session synchronization for main and background sessions\n- short Telegram notifications sent through OpenClaw's native messaging layer\n- daemon mode for continuous polling\n\n## Recommended workflow\n\n1. Read `references/flow.md`, `references/state-model.md`, and `references/naming-rules.md`.\n2. Install the config with `scripts/install_codex_profile_orchestrator.py`.\n3. Run a dry run and inspect the JSON output.\n4. Run apply mode once.\n5. Start daemon mode.\n\n## Commands\n\n### Install config\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>\n```\n\nOptional additional session targets:\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b\n```\n\n### Dry run\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json\n```\n\n### Apply\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json\n```\n\n### Daemon\n\n```bash\nnohup 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 &\n```\n\n## Core rules\n\n- Discover the currently active profile first, then register it if it is new.\n- If the current profile is above the threshold, keep using it.\n- If the current profile is below the threshold and a better usable profile exists, switch to the healthiest one.\n- If every usable profile is below the threshold, keep using the current one until it becomes unusable, then switch.\n- Treat same email + same user_id + same account_id as a duplicate.\n- Treat same email + different account_id as a new workspace variant.\n- Remove 401/403-style profiles from the active selection pool immediately.\n- Delete invalid profiles only after the configured invalid streak threshold is reached.\n\n## Notifications\n\nNotifications must stay short and event-focused:\n- new account found\n- new workspace variant found\n- duplicate ignored\n- active profile switched\n- profile quarantined\n- profile removed\n\n## References\n\n- `references/flow.md`\n- `references/state-model.md`\n- `references/naming-rules.md`\n- `references/telegram-notify-rules.md`\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1776631873675\n}\n\nFile v1.0.3:references/flow.md\n\n# Flow\n\n## Per cycle\n\n1. Detect the currently active profile.\n2. Scan the auth store.\n3. Register the active profile first if it is missing from the registry.\n4. Create a ws alias when the same email appears with a different account/workspace id.\n5. Fetch usage and compute health.\n6. Quarantine invalid profiles.\n7. Remove profiles whose invalid streak crosses the configured threshold.\n8. Choose the best profile using the threshold rule.\n9. Synchronize target sessions.\n10. Send short Telegram notifications.\n\n## Threshold rule\n\n- If the current profile is above the threshold, keep it.\n- If the current profile is below the threshold and a better usable profile exists, switch.\n- If every usable profile is below the threshold, keep the current one until it becomes unusable.\n\nFile v1.0.3:references/naming-rules.md\n\n# Naming rules\n\n## Primary\n\nBase profile id:\n- `openai-codex:<email>`\n\n## Workspace variant\n\nWhen the same email appears with a different account/workspace id:\n- `openai-codex:<slug>-ws2`\n- `openai-codex:<slug>-ws3`\n\n## Duplicate\n\nIf email + user_id + account_id are identical, do not create a new alias.\n\n## Principle\n\nNaming must be deterministic.\nRunning discovery twice must not create a different alias for the same identity.\n\nFile v1.0.3:references/state-model.md\n\n# State model\n\nThe registry file stores:\n\n- `identities{}`\n- `knownProfileIds[]`\n- `lastPreferredProfileId`\n- `notificationState{}`\n- `updatedAt`\n\n## Identity record\n\n- `email`\n- `userId`\n- `accountId`\n- `canonicalId`\n- `kind`\n- `sourceProfileId`\n- `status`\n- `invalidStreak`\n- `lastInvalidReason`\n- `firstSeenAt`\n- `lastSeenAt`\n- `lastHealthyAt`\n- `profileBlob`\n\nFile v1.0.3:references/telegram-notify-rules.md\n\n# Telegram notify rules\n\nNotifications must stay short, specific, and single-event.\n\n## Examples\n\n- `New account found: foo@gmail.com`\n- `New workspace variant: ugur-ws2`\n- `Duplicate profile ignored: openai-codex:foo`\n- `Active profile switched: foo -> bar`\n- `Profile quarantined: foo (401)`\n- `Profile removed: foo`\n\n## Principle\n\n- no extra detail\n- short text\n- one event per message\n\nArchive v1.0.2: 11 files, 14936 bytes\n\nFiles: _meta.json (145b), references/flow.md (780b), references/naming-rules.md (431b), references/state-model.md (363b), references/telegram-notify-rules.md (389b), scripts/codex_profile_orchestrator.py (23294b), scripts/codex_profile_report.py (2369b), scripts/codex_profile_runtime.py (5122b), scripts/install_codex_profile_orchestrator.py (2556b), scripts/test_codex_profile_orchestrator.py (6043b), SKILL.md (3415b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: Manage multiple OpenAI Codex OAuth profiles inside OpenClaw without using an AI decision loop. Use when you need a deterministic, always-on account orchestrator that discovers newly added Codex profiles, registers same-email workspace variants as ws2/ws3 aliases, quarantines or removes broken profiles that return 401/403-style errors, selects the healthiest profile by quota rules, synchronizes session authProfileOverride targets, and emits short Telegram notifications about account events.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to replace ad hoc failover scripts with one deterministic account orchestration loop.\n\n## What it provides\n\n- profile discovery from `auth-profiles.json`\n- same-email workspace variant detection and ws2/ws3 alias creation\n- quota-aware profile selection using a fixed threshold\n- invalid profile quarantine and optional auto-removal after repeated failures\n- session synchronization for main and background sessions\n- short Telegram notifications sent through OpenClaw's native messaging layer\n- daemon mode for continuous polling\n\n## Recommended workflow\n\n1. Read `references/flow.md`, `references/state-model.md`, and `references/naming-rules.md`.\n2. Install the config with `scripts/install_codex_profile_orchestrator.py`.\n3. Run a dry run and inspect the JSON output.\n4. Run apply mode once.\n5. Start daemon mode.\n\n## Commands\n\n### Install config\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>\n```\n\nOptional additional session targets:\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b\n```\n\n### Dry run\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json\n```\n\n### Apply\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json\n```\n\n### Daemon\n\n```bash\nnohup 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 &\n```\n\n## Core rules\n\n- Discover the currently active profile first, then register it if it is new.\n- If the current profile is above the threshold, keep using it.\n- If the current profile is below the threshold and a better usable profile exists, switch to the healthiest one.\n- If every usable profile is below the threshold, keep using the current one until it becomes unusable, then switch.\n- Treat same email + same user_id + same account_id as a duplicate.\n- Treat same email + different account_id as a new workspace variant.\n- Remove 401/403-style profiles from the active selection pool immediately.\n- Delete invalid profiles only after the configured invalid streak threshold is reached.\n\n## Notifications\n\nNotifications must stay short and event-focused:\n- new account found\n- new workspace variant found\n- duplicate ignored\n- active profile switched\n- profile quarantined\n- profile removed\n\n## References\n\n- `references/flow.md`\n- `references/state-model.md`\n- `references/naming-rules.md`\n- `references/telegram-notify-rules.md`\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1776628782043\n}\n\nFile v1.0.2:references/flow.md\n\n# Flow\n\n## Per cycle\n\n1. Detect the currently active profile.\n2. Scan the auth store.\n3. Register the active profile first if it is missing from the registry.\n4. Create a ws alias when the same email appears with a different account/workspace id.\n5. Fetch usage and compute health.\n6. Quarantine invalid profiles.\n7. Remove profiles whose invalid streak crosses the configured threshold.\n8. Choose the best profile using the threshold rule.\n9. Synchronize target sessions.\n10. Send short Telegram notifications.\n\n## Threshold rule\n\n- If the current profile is above the threshold, keep it.\n- If the current profile is below the threshold and a better usable profile exists, switch.\n- If every usable profile is below the threshold, keep the current one until it becomes unusable.\n\nFile v1.0.2:references/naming-rules.md\n\n# Naming rules\n\n## Primary\n\nBase profile id:\n- `openai-codex:<email>`\n\n## Workspace variant\n\nWhen the same email appears with a different account/workspace id:\n- `openai-codex:<slug>-ws2`\n- `openai-codex:<slug>-ws3`\n\n## Duplicate\n\nIf email + user_id + account_id are identical, do not create a new alias.\n\n## Principle\n\nNaming must be deterministic.\nRunning discovery twice must not create a different alias for the same identity.\n\nFile v1.0.2:references/state-model.md\n\n# State model\n\nThe registry file stores:\n\n- `identities{}`\n- `knownProfileIds[]`\n- `lastPreferredProfileId`\n- `notificationState{}`\n- `updatedAt`\n\n## Identity record\n\n- `email`\n- `userId`\n- `accountId`\n- `canonicalId`\n- `kind`\n- `sourceProfileId`\n- `status`\n- `invalidStreak`\n- `lastInvalidReason`\n- `firstSeenAt`\n- `lastSeenAt`\n- `lastHealthyAt`\n- `profileBlob`\n\nFile v1.0.2:references/telegram-notify-rules.md\n\n# Telegram notify rules\n\nNotifications must stay short, specific, and single-event.\n\n## Examples\n\n- `New account found: foo@gmail.com`\n- `New workspace variant: ugur-ws2`\n- `Duplicate profile ignored: openai-codex:foo`\n- `Active profile switched: foo -> bar`\n- `Profile quarantined: foo (401)`\n- `Profile removed: foo`\n\n## Principle\n\n- no extra detail\n- short text\n- one event per message\n\nArchive v1.0.1: 10 files, 12386 bytes\n\nFiles: references/flow.md (780b), references/naming-rules.md (431b), references/state-model.md (363b), references/telegram-notify-rules.md (389b), scripts/codex_profile_orchestrator.py (20701b), scripts/codex_profile_report.py (2369b), scripts/codex_profile_runtime.py (4373b), scripts/install_codex_profile_orchestrator.py (2556b), SKILL.md (3415b), _meta.json (145b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: Manage multiple OpenAI Codex OAuth profiles inside OpenClaw without using an AI decision loop. Use when you need a deterministic, always-on account orchestrator that discovers newly added Codex profiles, registers same-email workspace variants as ws2/ws3 aliases, quarantines or removes broken profiles that return 401/403-style errors, selects the healthiest profile by quota rules, synchronizes session authProfileOverride targets, and emits short Telegram notifications about account events.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to replace ad hoc failover scripts with one deterministic account orchestration loop.\n\n## What it provides\n\n- profile discovery from `auth-profiles.json`\n- same-email workspace variant detection and ws2/ws3 alias creation\n- quota-aware profile selection using a fixed threshold\n- invalid profile quarantine and optional auto-removal after repeated failures\n- session synchronization for main and background sessions\n- short Telegram notifications sent through OpenClaw's native messaging layer\n- daemon mode for continuous polling\n\n## Recommended workflow\n\n1. Read `references/flow.md`, `references/state-model.md`, and `references/naming-rules.md`.\n2. Install the config with `scripts/install_codex_profile_orchestrator.py`.\n3. Run a dry run and inspect the JSON output.\n4. Run apply mode once.\n5. Start daemon mode.\n\n## Commands\n\n### Install config\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>\n```\n\nOptional additional session targets:\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b\n```\n\n### Dry run\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json\n```\n\n### Apply\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json\n```\n\n### Daemon\n\n```bash\nnohup 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 &\n```\n\n## Core rules\n\n- Discover the currently active profile first, then register it if it is new.\n- If the current profile is above the threshold, keep using it.\n- If the current profile is below the threshold and a better usable profile exists, switch to the healthiest one.\n- If every usable profile is below the threshold, keep using the current one until it becomes unusable, then switch.\n- Treat same email + same user_id + same account_id as a duplicate.\n- Treat same email + different account_id as a new workspace variant.\n- Remove 401/403-style profiles from the active selection pool immediately.\n- Delete invalid profiles only after the configured invalid streak threshold is reached.\n\n## Notifications\n\nNotifications must stay short and event-focused:\n- new account found\n- new workspace variant found\n- duplicate ignored\n- active profile switched\n- profile quarantined\n- profile removed\n\n## References\n\n- `references/flow.md`\n- `references/state-model.md`\n- `references/naming-rules.md`\n- `references/telegram-notify-rules.md`\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1776611407165\n}\n\nFile v1.0.1:references/flow.md\n\n# Flow\n\n## Per cycle\n\n1. Detect the currently active profile.\n2. Scan the auth store.\n3. Register the active profile first if it is missing from the registry.\n4. Create a ws alias when the same email appears with a different account/workspace id.\n5. Fetch usage and compute health.\n6. Quarantine invalid profiles.\n7. Remove profiles whose invalid streak crosses the configured threshold.\n8. Choose the best profile using the threshold rule.\n9. Synchronize target sessions.\n10. Send short Telegram notifications.\n\n## Threshold rule\n\n- If the current profile is above the threshold, keep it.\n- If the current profile is below the threshold and a better usable profile exists, switch.\n- If every usable profile is below the threshold, keep the current one until it becomes unusable.\n\nFile v1.0.1:references/naming-rules.md\n\n# Naming rules\n\n## Primary\n\nBase profile id:\n- `openai-codex:<email>`\n\n## Workspace variant\n\nWhen the same email appears with a different account/workspace id:\n- `openai-codex:<slug>-ws2`\n- `openai-codex:<slug>-ws3`\n\n## Duplicate\n\nIf email + user_id + account_id are identical, do not create a new alias.\n\n## Principle\n\nNaming must be deterministic.\nRunning discovery twice must not create a different alias for the same identity.\n\nFile v1.0.1:references/state-model.md\n\n# State model\n\nThe registry file stores:\n\n- `identities{}`\n- `knownProfileIds[]`\n- `lastPreferredProfileId`\n- `notificationState{}`\n- `updatedAt`\n\n## Identity record\n\n- `email`\n- `userId`\n- `accountId`\n- `canonicalId`\n- `kind`\n- `sourceProfileId`\n- `status`\n- `invalidStreak`\n- `lastInvalidReason`\n- `firstSeenAt`\n- `lastSeenAt`\n- `lastHealthyAt`\n- `profileBlob`\n\nFile v1.0.1:references/telegram-notify-rules.md\n\n# Telegram notify rules\n\nNotifications must stay short, specific, and single-event.\n\n## Examples\n\n- `New account found: foo@gmail.com`\n- `New workspace variant: ugur-ws2`\n- `Duplicate profile ignored: openai-codex:foo`\n- `Active profile switched: foo -> bar`\n- `Profile quarantined: foo (401)`\n- `Profile removed: foo`\n\n## Principle\n\n- no extra detail\n- short text\n- one event per message\n\nArchive v1.0.0: 10 files, 12140 bytes\n\nFiles: references/flow.md (780b), references/naming-rules.md (431b), references/state-model.md (363b), references/telegram-notify-rules.md (389b), scripts/codex_profile_orchestrator.py (20701b), scripts/codex_profile_report.py (1385b), scripts/codex_profile_runtime.py (4373b), scripts/install_codex_profile_orchestrator.py (2556b), SKILL.md (3415b), _meta.json (145b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: codex-profile-orchestrator\ndescription: Manage multiple OpenAI Codex OAuth profiles inside OpenClaw without using an AI decision loop. Use when you need a deterministic, always-on account orchestrator that discovers newly added Codex profiles, registers same-email workspace variants as ws2/ws3 aliases, quarantines or removes broken profiles that return 401/403-style errors, selects the healthiest profile by quota rules, synchronizes session authProfileOverride targets, and emits short Telegram notifications about account events.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to replace ad hoc failover scripts with one deterministic account orchestration loop.\n\n## What it provides\n\n- profile discovery from `auth-profiles.json`\n- same-email workspace variant detection and ws2/ws3 alias creation\n- quota-aware profile selection using a fixed threshold\n- invalid profile quarantine and optional auto-removal after repeated failures\n- session synchronization for main and background sessions\n- short Telegram notifications sent through OpenClaw's native messaging layer\n- daemon mode for continuous polling\n\n## Recommended workflow\n\n1. Read `references/flow.md`, `references/state-model.md`, and `references/naming-rules.md`.\n2. Install the config with `scripts/install_codex_profile_orchestrator.py`.\n3. Run a dry run and inspect the JSON output.\n4. Run apply mode once.\n5. Start daemon mode.\n\n## Commands\n\n### Install config\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>\n```\n\nOptional additional session targets:\n\n```bash\npython3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b\n```\n\n### Dry run\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json\n```\n\n### Apply\n\n```bash\npython3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json\n```\n\n### Daemon\n\n```bash\nnohup 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 &\n```\n\n## Core rules\n\n- Discover the currently active profile first, then register it if it is new.\n- If the current profile is above the threshold, keep using it.\n- If the current profile is below the threshold and a better usable profile exists, switch to the healthiest one.\n- If every usable profile is below the threshold, keep using the current one until it becomes unusable, then switch.\n- Treat same email + same user_id + same account_id as a duplicate.\n- Treat same email + different account_id as a new workspace variant.\n- Remove 401/403-style profiles from the active selection pool immediately.\n- Delete invalid profiles only after the configured invalid streak threshold is reached.\n\n## Notifications\n\nNotifications must stay short and event-focused:\n- new account found\n- new workspace variant found\n- duplicate ignored\n- active profile switched\n- profile quarantined\n- profile removed\n\n## References\n\n- `references/flow.md`\n- `references/state-model.md`\n- `references/naming-rules.md`\n- `references/telegram-notify-rules.md`\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776611001131\n}\n\nFile v1.0.0:references/flow.md\n\n# Flow\n\n## Per cycle\n\n1. Detect the currently active profile.\n2. Scan the auth store.\n3. Register the active profile first if it is missing from the registry.\n4. Create a ws alias when the same email appears with a different account/workspace id.\n5. Fetch usage and compute health.\n6. Quarantine invalid profiles.\n7. Remove profiles whose invalid streak crosses the configured threshold.\n8. Choose the best profile using the threshold rule.\n9. Synchronize target sessions.\n10. Send short Telegram notifications.\n\n## Threshold rule\n\n- If the current profile is above the threshold, keep it.\n- If the current profile is below the threshold and a better usable profile exists, switch.\n- If every usable profile is below the threshold, keep the current one until it becomes unusable.\n\nFile v1.0.0:references/naming-rules.md\n\n# Naming rules\n\n## Primary\n\nBase profile id:\n- `openai-codex:<email>`\n\n## Workspace variant\n\nWhen the same email appears with a different account/workspace id:\n- `openai-codex:<slug>-ws2`\n- `openai-codex:<slug>-ws3`\n\n## Duplicate\n\nIf email + user_id + account_id are identical, do not create a new alias.\n\n## Principle\n\nNaming must be deterministic.\nRunning discovery twice must not create a different alias for the same identity.\n\nFile v1.0.0:references/state-model.md\n\n# State model\n\nThe registry file stores:\n\n- `identities{}`\n- `knownProfileIds[]`\n- `lastPreferredProfileId`\n- `notificationState{}`\n- `updatedAt`\n\n## Identity record\n\n- `email`\n- `userId`\n- `accountId`\n- `canonicalId`\n- `kind`\n- `sourceProfileId`\n- `status`\n- `invalidStreak`\n- `lastInvalidReason`\n- `firstSeenAt`\n- `lastSeenAt`\n- `lastHealthyAt`\n- `profileBlob`\n\nFile v1.0.0:references/telegram-notify-rules.md\n\n# Telegram notify rules\n\nNotifications must stay short, specific, and single-event.\n\n## Examples\n\n- `New account found: foo@gmail.com`\n- `New workspace variant: ugur-ws2`\n- `Duplicate profile ignored: openai-codex:foo`\n- `Active profile switched: foo -> bar`\n- `Profile quarantined: foo (401)`\n- `Profile removed: foo`\n\n## Principle\n\n- no extra detail\n- short text\n- one event per message","readmeExcerpt":"Skill: Codex Profile Orchestrator Owner: ugurinanc12 Summary: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra... Tags: latest:2.1.1 Version history: v2.1.1 | 2026-04-21T20:55:18.757Z | user Prevent repeated low-limit Telegram alerts until threshold recovers v2.1.0 | 2026-04-21T19:53:58.304Z | user Refined Win","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>"},{"language":"bash","snippet":"python3 scripts/install_codex_profile_orchestrator.py \\\n  --workspace /path/to/workspace \\\n  --telegram-target <telegram-chat-id> \\\n  --session-target agent:main:worker-a \\\n  --session-target agent:main:worker-b"},{"language":"bash","snippet":"python3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --dry-run --json"},{"language":"bash","snippet":"python3 scripts/codex_profile_orchestrator.py --config /path/to/workspace/config/codex-profile-orchestrator.json --apply --json"},{"language":"bash","snippet":"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 &"},{"language":"bash","snippet":"python3 scripts/install_codex_profile_orchestrator.py --workspace /path/to/workspace --telegram-target <telegram-chat-id>"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: codex-profile-orchestrator\ndescription: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegram session sync, network outage protection, and install helpers. use when chatgpt needs to stabilize or rebuild multi-account codex switching, inspect auth-profiles.json, select the healthiest account, or package a safer replacement for fragile profile rotation logic.\n---\n\n# Codex Profile Orchestrator\n\nUse this skill to manage multiple Codex OAuth profiles without a fuzzy AI loop.\n\n## Core resources\n\n- `scripts/codex_profile_orchestrator.py` contains the full orchestrator, reporting, and self-test flow.\n- `scripts/install_codex_profile_orchestrator.py` writes a Windows-friendly config and starter script into an OpenClaw workspace.\n- `references/state-model.md` explains how identities, variants, duplicates, and invalid streaks are tracked.\n\n## Recommended workflow\n\n1. Install the config into the target workspace.\n2. Run a dry run first and inspect the JSON payload.\n3. Apply once.\n4. Start daemon mode only after the dry run looks correct.\n\n## Rules\n\n- Treat internet or ChatGPT reachability failures as transport incidents, not as broken accounts.\n- Quarantine only 401, 403, 400, missing-token, or clearly expired-token profiles.\n- Keep weekly availability as a hard gate. Keep five-hour remaining as the primary tie-breaker for switching.\n- Detect same email plus same user plus same account as a duplicate.\n- Detect same email plus same user plus different account as a workspace variant and register it as `ws2`, `ws3`, and so on.\n- Sync Telegram and other OpenClaw session overrides to the selected profile."},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn72fe6kqadg11zhbvc1xsjtah84zwec\",\n  \"slug\": \"codex-profile-orchestrator\",\n  \"version\": \"2.1.1\",\n  \"publishedAt\": 1776804918757\n}"},{"path":"references/state-model.md","content":"# State Model\n\n## Identity key\n\nEach discovered profile is normalized to:\n- email\n- user id\n- account id\n\nThe tuple `email|user_id|account_id` is the exact identity key.\n\n## Canonical ids\n\n- primary identity: `openai-codex:<email-slug>`\n- workspace variants: `openai-codex:<email-slug>-ws2`, `-ws3`, and so on\n\n## Health rules\n\n- network outage: do not quarantine, do not delete, prefer staying on the current profile\n- invalid profile: 400, 401, 403, missing token, token expired\n- usable profile: weekly remaining above zero and five-hour remaining above zero\n\n## Selection rules\n\n1. keep the current profile if it is still healthy and its five-hour remaining stays above threshold\n2. otherwise switch to the healthy profile with the best five-hour remaining\n3. use weekly remaining as a second tie-breaker\n4. prefer primary over workspace variant when the score is tied"},{"path":"skill-card.md","content":"## Description:\n\nDeterministic OpenClaw Codex profile failover for Windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, Telegram session sync, network outage protection, and install helpers.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[ugurinanc12](https://clawhub.ai/user/ugurinanc12)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and operators use this skill to stabilize multi-account Codex profile switching in OpenClaw workspaces, inspect OAuth profile state, select a healthier account, and install a repeatable profile orchestration workflow.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can copy token-bearing Codex profile data into workspace registry or backup files.\n\nMitigation: Run dry-run first, keep the workspace state directory private, and protect or remove registry and backup files that may contain credentials.\n\nRisk: Apply or daemon mode can rewrite authentication profile order, session overrides, and remove invalid profiles after the configured streak.\n\nMitigation: Inspect the dry-run JSON before enabling apply or daemon mode, and use conservative invalid-streak settings.\n\nRisk: Telegram and other OpenClaw session sync can move session overrides to the selected profile.\n\nMitigation: Limit configured session targets and verify the selected profile before enabling notifications or session sync.\n\n## Reference(s):\n\n- [State Model](references/state-model.md)\n- [ClawHub skill page](https://clawhub.ai/ugurinanc12/skills/codex-profile-orchestrator)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with JSON payloads, shell commands, and configuration files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can produce dry-run reports, apply-mode changes, daemon startup commands, and installation configuration.]\n\n## Skill Version(s):\n\n2.1.1 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."},{"path":"agents/openai.yaml","content":"interface:\n  display_name: \"Codex Profile Orchestrator\"\n  short_description: \"stabilize codex account rotation in openclaw\""}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra... Skill: Codex Profile Orchestrator Owner: ugurinanc12 Summary: deterministic openclaw codex profile failover for windows workspaces with duplicate detection, workspace variant aliases, quota-aware profile choice, telegra... Tags: latest:2.1.1 Version history: v2.1.1 | 2026-04-21T20:55:18.757Z | user Prevent repeated low-limit Telegram alerts until threshold recovers v2.1.0 | 2026-04-21T19:53:58.304Z | user Refined Win","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1240,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:23:43.832Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:23:43.832Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-13T00:15:14.769Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}