Skip to content

fix: write RFC 3339 timestamps to codex auth.json#46

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-auth-json-time-format
Draft

fix: write RFC 3339 timestamps to codex auth.json#46
Copilot wants to merge 2 commits intomainfrom
copilot/fix-auth-json-time-format

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 17, 2026

Codex CLI changed its auth.json schema to expect RFC 3339 date-time strings for expires_at and last_refresh. bub login openai was writing raw Unix integers, causing codex to fail on startup with:

invalid type: integer `1776414280`, expected an RFC 3339 formatted date and time string at line 11 column 28

Changes

  • save_openai_codex_oauth_tokens: writes expires_at and last_refresh as RFC 3339 strings ("2026-04-17T08:24:40Z") instead of integers
  • _parse_tokens: accepts both RFC 3339 strings and legacy integer timestamps for backward compatibility when reading existing files
  • Helpers added: _unix_to_rfc3339(ts) and _rfc3339_to_unix(value) for clean conversion in both directions

Resulting auth.json structure:

{
  "tokens": {
    "access_token": "...",
    "refresh_token": "...",
    "expires_at": "2026-04-17T08:24:40Z"
  },
  "last_refresh": "2026-04-17T08:56:01Z"
}

…mpatibility

Agent-Logs-Url: https://github.com/bubbuild/republic/sessions/bec5de29-5d89-4de9-bea2-0ef97ad4cc65

Co-authored-by: frostming <16336606+frostming@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix codex auth.json time format to RFC3339 fix: write RFC 3339 timestamps to codex auth.json Apr 17, 2026
Copilot AI requested a review from frostming April 17, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codex auth.json time format changed to RFC3339

2 participants