[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M784S448ZG86SRRW2RQJH65N":3,"skill-same:01M784S448ZG86SRRW2RQJH65N":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":6,"updatedAt":45,"install":46,"resources":58},"01M784S448ZG86SRRW2RQJH65N","codex-healthcheck",null,"Use when checking whether the codex.plan.ai litellm proxy works (scheduled health check) or when it is reported broken — probe \u002Fv1\u002Fmodels + a tiny chat completion, classify the failure against the known layers, then fix it (container\u002Fconfig, fork+repin+deploy, auth) and verify.","planailabs\u002Fnixos-infra","planailabs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F261949590?v=4","01M784QMNK8YTQBDBX1G4QWPBZ","plan.ai Labs","01M784S1HQN2W6B9ZTXNA7N91T",1,"MIT","https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra\u002Fblob\u002Ftrunk\u002F.agents\u002Fskills\u002Fcodex-healthcheck\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codex-healthcheck\ndescription: Use when checking whether the codex.plan.ai litellm proxy works (scheduled health check) or when it is reported broken — probe \u002Fv1\u002Fmodels + a tiny chat completion, classify the failure against the known layers, then fix it (container\u002Fconfig, fork+repin+deploy, auth) and verify.\nversion: 1.0.0\nauthor: plan.ai\nlicense: MIT\nmetadata:\n  tags: [nixos, infrastructure, litellm, codex, healthcheck, deploy]\n  related_skills: [fix-codex-litellm, update-nixos]\nuser_invocable: true\n---\n\n# codex.plan.ai health check\n\nAnswer one question with evidence: **does `codex.plan.ai` serve its models right now**, and\nif not, repair it. `fix-codex-litellm` has the architecture map, the failure taxonomy and the\nfull repo\u002Ffork\u002Fdeploy mechanics — this skill is the *check* that decides whether that skill\nis needed. Run everything from the `nixos-infra` root.\n\n## 1. Probe (cheap first, stop at the first failure)\n\nProject commands run in a `nix develop`; this flake has no default devshell, so run shell\ntasks with `devshell: false`. `\u002Fetc\u002Flitellm.env` on the host holds `LITELLM_MASTER_KEY`.\n\n```bash\nBASE=https:\u002F\u002Fcodex.plan.ai\nKEY=$(ssh root@codex.plan.ai 'grep ^LITELLM_MASTER_KEY \u002Fetc\u002Flitellm.env | cut -d= -f2-')\n\n# a. reachability + advertised slugs (a non-empty list of codex slugs)\ncurl -sS -m 20 $BASE\u002Fv1\u002Fmodels -H \"Authorization: Bearer $KEY\"\n\n# b. one tiny chat completion through the custom provider (OAuth + request and\n#    response translation). Never stream at this hour — astreaming is covered by\n#    the same wire path, and an SSE hang should not eat the night.\nSLUG=$(curl -sS -m 20 $BASE\u002Fv1\u002Fmodels -H \"Authorization: Bearer $KEY\" \\\n  | python3 -c 'import json,sys;d=json.load(sys.stdin);print(d[\"data\"][0][\"id\"])')\ncurl -sS -m 60 $BASE\u002Fv1\u002Fchat\u002Fcompletions -H \"Authorization: Bearer $KEY\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d \"{\\\"model\\\":\\\"$SLUG\\\",\\\"max_tokens\\\":16,\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"Reply with OK.\\\"}]}\"\n```\n\nA healthy proxy answers `b.` with `choices[0].message` and `usage`. HTTP errors, an empty\n`choices`, or a timeout are failures. Vision and image generation are *not* nightly probes\n(expensive, and free to test on demand) — they are listed in `fix-codex-litellm`.\n\nRecord as evidence: the HTTP status, the error's `param`\u002Fmessage, the timestamp, and whether\n`sh codex.sh` was run in the last day (that deploy also replaces the provider source — see 4).\n\n## 2. When it fails: read the host logs\n\n```bash\nssh root@codex.plan.ai 'systemctl status podman-litellm --no-pager -n 40; journalctl -u podman-litellm --no-pager -n 200'\nssh root@codex.plan.ai 'journalctl -u litellm-codex-config --no-pager -n 80'\n```\n\nClassify with `fix-codex-litellm`'s taxonomy (request translation, response translation,\nmodel not supported, missing models, pricing, dispatch, auth, vision, image generation).\n\n## 3. Auth only\n\n`401`\u002Fexpired, or `journalctl` showing the refresh failing:\n\n```bash\nssh root@codex.plan.ai 'stat -c %y \u002Froot\u002F.codex\u002Fauth.json; systemctl restart podman-litellm'\nsleep 30   # the proxy takes ~30s; then re-run probe b\n```\n\nIf the **refresh token** is revoked (`codex login` needed) that is the account's, not the\nrepo's — report it, do not loop (see `fix-codex-litellm` Step 2, Auth).\n\n## 4. Repo \u002F config only\n\nA failure the container restart in (3) does not cure, with the config journal naming a\ncause: model discovery empty → fallback slugs, `priced models:` empty → the pricing regex in\n`codex\u002Fdefault.nix`, the handler shim in the same file for dispatch errors. Fix it there with\n`fix-codex-litellm`'s constraints (never hardcode slugs), then deploy:\n\n```bash\nsh codex.sh                       # devshell: false; impure; targets root@codex.plan.ai\nsleep 45 && ${probe b again}      # the switch may not restart podman-litellm on a\n                                  # provider-only bump — then restart it explicitly\n```\n\n## 5. Fork \u002F provider only\n\nTranslation bugs (`prompts.py` \u002F `adapter.py` \u002F `images.py`) are fixed in\n`mkg20001\u002Flitellm-codex-oauth-provider`, then repinned in\n`pkgs\u002Flitellm-codex-oauth-provider.nix` and deployed — `fix-codex-litellm` Steps 3-6, in\nfull. It touches the fork's `main` and the host; it is allowed here, but nothing else is:\n`sh codex.sh` on `codex.plan.ai`, never another host, and no `codex login` unattended.\n\n## 6. Upgrades can break the fork\n\nTwo host timers change codex.plan.ai on their own: `litellm-codex-refresh` (weekly;\nre-discovers models + rescrapes prices) and `litellm-image-update` (weekly; pulls\n`ghcr.io\u002Fberriai\u002Flitellm-database:main-stable` and restarts the container when it changed).\nIf the probe fails only for the newest slug, run\n`ssh root@codex.plan.ai 'systemctl start litellm-codex-refresh'`, wait, re-probe; if it is\nstill broken, do not roll the image or repin blindly — ask.\n\n## 7. Verify and report\n\nEnd the run by re-running probe `b` (the healthy JSON is the fix's proof) and re-checking the\ncontainer log for the original error. Never claim a fix without the passing probe. If the run\nchanged the repo, commit it (`fix(codex): …`) and push; if it did not, change nothing. A run\nthat needed `fix-codex-litellm` Steps 3-6 records the new rev and the failure shape in the\nproject's topic `codex` (memory).\n","# codex.plan.ai health check\n\nAnswer one question with evidence: **does `codex.plan.ai` serve its models right now**, and\nif not, repair it. `fix-codex-litellm` has the architecture map, the failure taxonomy and the\nfull repo\u002Ffork\u002Fdeploy mechanics — this skill is the *check* that decides whether that skill\nis needed. Run everything from the `nixos-infra` root.\n\n## 1. Probe (cheap first, stop at the first failure)\n\nProject commands run in a `nix develop`; this flake has no default devshell, so run shell\ntasks with `devshell: false`. `\u002Fetc\u002Flitellm.env` on the host holds `LITELLM_MASTER_KEY`.\n\n```bash\nBASE=https:\u002F\u002Fcodex.plan.ai\nKEY=$(ssh root@codex.plan.ai 'grep ^LITELLM_MASTER_KEY \u002Fetc\u002Flitellm.env | cut -d= -f2-')\n\n# a. reachability + advertised slugs (a non-empty list of codex slugs)\ncurl -sS -m 20 $BASE\u002Fv1\u002Fmodels -H \"Authorization: Bearer $KEY\"\n\n# b. one tiny chat completion through the custom provider (OAuth + request and\n#    response translation). Never stream at this hour — astreaming is covered by\n#    the same wire path, and an SSE hang should not eat the night.\nSLUG=$(curl -sS -m 20 $BASE\u002Fv1\u002Fmodels -H \"Authorization: Bearer $KEY\" \\\n  | python3 -c 'import json,sys;d=json.load(sys.stdin);print(d[\"data\"][0][\"id\"])')\ncurl -sS -m 60 $BASE\u002Fv1\u002Fchat\u002Fcompletions -H \"Authorization: Bearer $KEY\" \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d \"{\\\"model\\\":\\\"$SLUG\\\",\\\"max_tokens\\\":16,\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"Reply with OK.\\\"}]}\"\n```\n\nA healthy proxy answers `b.` with `choices[0].message` and `usage`. HTTP errors, an empty\n`choices`, or a timeout are failures. Vision and image generation are *not* nightly probes\n(expensive, and free to test on demand) — they are listed in `fix-codex-litellm`.\n\nRecord as evidence: the HTTP status, the error's `param`\u002Fmessage, the timestamp, and whether\n`sh codex.sh` was run in the last day (that deploy also replaces the provider source — see 4).\n\n## 2. When it fails: read the host logs\n\n```bash\nssh root@codex.plan.ai 'systemctl status podman-litellm --no-pager -n 40; journalctl -u podman-litellm --no-pager -n 200'\nssh root@codex.plan.ai 'journalctl -u litellm-codex-config --no-pager -n 80'\n```\n\nClassify with `fix-codex-litellm`'s taxonomy (request translation, response translation,\nmodel not supported, missing models, pricing, dispatch, auth, vision, image generation).\n\n## 3. Auth only\n\n`401`\u002Fexpired, or `journalctl` showing the refresh failing:\n\n```bash\nssh root@codex.plan.ai 'stat -c %y \u002Froot\u002F.codex\u002Fauth.json; systemctl restart podman-litellm'\nsleep 30   # the proxy takes ~30s; then re-run probe b\n```\n\nIf the **refresh token** is revoked (`codex login` needed) that is the account's, not the\nrepo's — report it, do not loop (see `fix-codex-litellm` Step 2, Auth).\n\n## 4. Repo \u002F config only\n\nA failure the container restart in (3) does not cure, with the config journal naming a\ncause: model discovery empty → fallback slugs, `priced models:` empty → the pricing regex in\n`codex\u002Fdefault.nix`, the handler shim in the same file for dispatch errors. Fix it there with\n`fix-codex-litellm`'s constraints (never hardcode slugs), then deploy:\n\n```bash\nsh codex.sh                       # devshell: false; impure; targets root@codex.plan.ai\nsleep 45 && ${probe b again}      # the switch may not restart podman-litellm on a\n                                  # provider-only bump — then restart it explicitly\n```\n\n## 5. Fork \u002F provider only\n\nTranslation bugs (`prompts.py` \u002F `adapter.py` \u002F `images.py`) are fixed in\n`mkg20001\u002Flitellm-codex-oauth-provider`, then repinned in\n`pkgs\u002Flitellm-codex-oauth-provider.nix` and deployed — `fix-codex-litellm` Steps 3-6, in\nfull. It touches the fork's `main` and the host; it is allowed here, but nothing else is:\n`sh codex.sh` on `codex.plan.ai`, never another host, and no `codex login` unattended.\n\n## 6. Upgrades can break the fork\n\nTwo host timers change codex.plan.ai on their own: `litellm-codex-refresh` (weekly;\nre-discovers models + rescrapes prices) and `litellm-image-update` (weekly; pulls\n`ghcr.io\u002Fberriai\u002Flitellm-database:main-stable` and restarts the container when it changed).\nIf the probe fails only for the newest slug, run\n`ssh root@codex.plan.ai 'systemctl start litellm-codex-refresh'`, wait, re-probe; if it is\nstill broken, do not roll the image or repin blindly — ask.\n\n## 7. Verify and report\n\nEnd the run by re-running probe `b` (the healthy JSON is the fix's proof) and re-checking the\ncontainer log for the original error. Never claim a fix without the passing probe. If the run\nchanged the repo, commit it (`fix(codex): …`) and push; if it did not, change nothing. A run\nthat needed `fix-codex-litellm` Steps 3-6 records the new rev and the failure shape in the\nproject's topic `codex` (memory).\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"description":7,"user_invocable":37},"plan.ai","1.0.0",{"tags":27,"related_skills":34},[28,29,30,31,32,33],"nixos","infrastructure","litellm","codex","healthcheck","deploy",[35,36],"fix-codex-litellm","update-nixos",true,"trunk","ae6b6d8ae743bf5a1af509d00f07168869ab26b3",".agents\u002Fskills\u002Fcodex-healthcheck",0,"https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra","https:\u002F\u002Fgithub.com\u002Fplanailabs","https:\u002F\u002Fplan.ai","2026-11-13 18:32:11",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":37},[48,51,54],{"tool":49,"command":50},"npx","npx skills add planailabs\u002Fnixos-infra --skill codex-healthcheck",{"tool":52,"command":53},"bunx","bunx skills add planailabs\u002Fnixos-infra --skill codex-healthcheck",{"tool":55,"command":56},"pnpm","pnpm dlx skills add planailabs\u002Fnixos-infra --skill codex-healthcheck","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra\u002Fblob\u002Ftrunk\u002F.agents\u002Fskills\u002Fcodex-healthcheck\u002FSKILL.md",[],[60,66,72,77],{"skillNo":61,"name":35,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M784SR5XNTH2VERG3XDJENK2","Use when the codex.plan.ai litellm plugin (Codex OAuth custom provider) is throwing errors — HTTP 400\u002F4xx\u002F5xx from the Codex \u002Fresponses endpoint, request\u002Fresponse translation failures, model-name or auth errors — to diagnose, fix the provider fork, and redeploy codex.plan.ai.","https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra\u002Fblob\u002Ftrunk\u002F.hermes\u002Fskills\u002Ffix-codex-litellm\u002FSKILL.md",[],[],{"skillNo":67,"name":36,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M784SJ9C733C0G2GFXR5EJ5C","Use when updating NixOS flake inputs and deploying nixos-infra to all plan.ai servers, including fixing build errors and pushing resulting commits.","https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra\u002Fblob\u002Ftrunk\u002F.claude\u002Fskills\u002Fupdate-nixos\u002FSKILL.md",[],[],{"skillNo":73,"name":35,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M784SDEW9G4REFT90HT4EDM2","https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra\u002Fblob\u002Ftrunk\u002F.claude\u002Fskills\u002Ffix-codex-litellm\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M784S8HE4XHFBK0MFZ4VTFX6","zitadel-bootstrap","Use when setting up Zitadel for a new plan.ai-style deployment (a cloud console, a chat\u002Fagent and optionally a Harbor on their own domains, like webapp.agency) or re-running it — asks for the domains, org and login names, social-login credentials and shared keys, writes ansible\u002Fzitadel\u002Fdeployments\u002F\u003Cname>.yml, runs setup.yml (Zitadel orgs, login policy, IdPs, projects, clients, service users) and secrets.yml (the rest of the secrets, private\u002F\u003Cname>-{cloud,chat,harbor}.nix).","https:\u002F\u002Fgithub.com\u002Fplanailabs\u002Fnixos-infra\u002Fblob\u002Ftrunk\u002F.agents\u002Fskills\u002Fzitadel-bootstrap\u002FSKILL.md",[],[]]