Skip to content

5h + Weekly limit reset timestamps miscalculated after session resume #4761

@BMorgan1296

Description

@BMorgan1296

What version of Codex is running?

codex-cli 0.44.0

Which model were you using?

gpt-5-codex (low)

What platform is your computer?

WSL / Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

Resuming a codex session, and typing status, the reset times for 5h and Weekly limits are offset from the instantiation time of the resumed session, not from when the last message was sent.

This is easy to test.

Type codex and enter hi. Then /status, and a few enters to save the text in terminal, then Ctrl^C.

Wait a minute, then resume the session with the given ID, and type /status without sending a message. The cached response will be calculated from the session time.

Here is some abridged output:

╭──────────────────────────────────────────────────────────────────────────────────────╮
│  >_ OpenAI Codex (v0.44.0)                                                           │
│                                                                                      │
│  Model:            gpt-5-codex (reasoning low, summaries auto)                       │
│  Directory:        /home/brad/mydir                                                  |
│  Approval:         on-request                                                        │
│  Sandbox:          workspace-write                                                   │
│  Agents.md:        AGENTS.md                                                         │
│  Account:                                          (Plus)                            │
│  Session:          0199aeee-46bb-73e0-a9e2-abc5ecaf8a0f                              │
│                                                                                      │
│  Context window:   70% left (89.5K used / 272K)                                      │
╰──────────────────────────────────────────────────────────────────────────────────────╯


› Hi


...


/status

╭──────────────────────────────────────────────────────────────────────────────────────╮
│  >_ OpenAI Codex (v0.44.0)                                                           │
│                                                                                      │
│  Model:            gpt-5-codex (reasoning low, summaries auto)                       │
│  Directory:        /home/brad/mydir                                                  |
│  Approval:         on-request                                                        │
│  Sandbox:          workspace-write                                                   │
│  Agents.md:        AGENTS.md                                                         │
│  Account:                                          (Plus)                            │
│  Session:          $SESH                                                             │
│                                                                                      │
│  Context window:   100% left (3.47K used / 272K)                                     │
│  5h limit:         [░░░░░░░░░░░░░░░░░░░░] 0% used (resets 21:22)                     │ << 21:22 reset time
│  Weekly limit:     [█████████████░░░░░░░] 64% used (resets 13:04 on 8 Oct)           │ << 13:04 reset time
╰──────────────────────────────────────────────────────────────────────────────────────╯

...

ctrl^C

...

  To get started, describe a task or try one of these commands:

  /init - create an AGENTS.md file with instructions for Codex
  /status - show current session configuration
  /approvals - choose what Codex can do without approval
  /model - choose what model and reasoning effort to use
  /review - review any changes and find issues


/status

╭──────────────────────────────────────────────────────────────────────────────────────╮
│  >_ OpenAI Codex (v0.44.0)                                                           │
│                                                                                      │
│  Model:            gpt-5-codex (reasoning low, summaries auto)                       │
│  Directory:        /home/brad/mydir                                                  |
│  Approval:         on-request                                                        │
│  Sandbox:          workspace-write                                                   │
│  Agents.md:        AGENTS.md                                                         │
│  Account:                                          (Plus)                            │
│  Context window:   100% left (3.47K used / 272K)                                     │
│  5h limit:         [░░░░░░░░░░░░░░░░░░░░] 0% used (resets 21:24)                     │ << 21:24 reset time
│  Weekly limit:     [█████████████░░░░░░░] 64% used (resets 13:05 on 8 Oct)           │ << 13:05 reset time
╰──────────────────────────────────────────────────────────────────────────────────────╯

What is the expected behavior?

Should see the actual reset time.

What do you see instead?

I see the reset time increased by the session resumed time added.

Additional information

This is not a major bug, just an observation and perhaps an easy fix in the codebase.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions