{
  "schemaVersion": 2,
  "id": "wsl-oauth-localhost-callback",
  "title": "WSL OAuth localhost callback may be unreachable",
  "category": "auth",
  "severity": "high",
  "platforms": [
    "wsl"
  ],
  "match": {
    "any": [
      {
        "contains": "localhost:1455"
      },
      {
        "contains": "/auth/callback"
      },
      {
        "contains": "State mismatch"
      }
    ]
  },
  "summary": "The browser callback appears to be crossing Windows/WSL or another remote boundary, so localhost may refer to the wrong machine/context.",
  "explanation": "Treat this as a likely match, not proof of root cause.",
  "actions": [
    "Confirm where the Codex login listener is running and where the browser is running.",
    "For remote/headless flows, check whether a device-code login flow is now available for your build (a request for it, openai/codex#12263, was closed as completed in August 2026) - it avoids the localhost callback entirely.",
    "Check for stale VS Code/devcontainer port forwarding on port 1455 before retrying."
  ],
  "links": [
    {
      "type": "github_issue",
      "url": "https://github.com/openai/codex/issues/12263",
      "label": "openai/codex#12263"
    }
  ],
  "tags": [
    "auth",
    "wsl",
    "oauth",
    "localhost"
  ],
  "i18n": {
    "zh-CN": {
      "title": "WSL OAuth localhost 回调可能不可达",
      "summary": "浏览器回调可能跨越了 Windows / WSL 或远程环境边界，导致 localhost 指向错误的上下文。",
      "explanation": "这只是高概率匹配，不等同于已经证明根因。",
      "actions": [
        "确认 Codex 登录监听器运行在哪里，以及浏览器运行在哪里。",
        "远程/无头流程先确认你的构建是否已支持设备码登录（相关请求 openai/codex#12263 已于 2026 年 8 月以 completed 关闭）——它可完全避开 localhost 回调。",
        "重试前检查 VS Code / devcontainer 是否残留 1455 端口转发。"
      ]
    },
    "ja": {
      "title": "WSL の OAuth localhost コールバックが届かない可能性",
      "summary": "ブラウザのコールバックが Windows/WSL または別のリモート境界を越えている可能性があり、localhost が誤ったマシン/コンテキストを指している可能性があります。",
      "explanation": "根因の証明ではなく、有力な一致として扱ってください。",
      "actions": [
        "Codex のログインリスナーがどこで、ブラウザがどこで動いているか確認します。",
        "リモート/ヘッドレスのフローでは、まずビルドにデバイスコード ログインが用意されているか確認してください（その要望 openai/codex#12263 は 2026 年 8 月に完了としてクローズされました）。localhost コールバックを完全に回避できます。",
        "再試行前に、ポート 1455 の古い VS Code/devcontainer ポート転送を確認します。"
      ]
    }
  }
}
