Skip to content

Bug report: Session resume after rate limit loses task intent and continues on wrong context #8310

@jroth1111

Description

@jroth1111

Bug report: Session "resume after rate limit" loses task intent and continues on wrong context

Title

After hitting usage limit, resuming a Codex/agent session often drops latest instructions and continues with unrelated work (task drift + repeated prompts)

Summary

When a long-running Codex/agent session hits a usage limit and is later resumed (same or different account), the assistant frequently fails to continue the last requested task. It instead:

  • Reverts to earlier context
  • Repeats previously completed steps/prompts
  • Performs unrelated work that was never requested

This appears correlated with Context compacted events and/or the transition through the rate-limit boundary.

Environment

  • Product: Codex/agent session (CLI-style flow with resume semantics)
  • Model observed in transcript: gpt-5.2-codex xhigh (after resume)
  • Timeframe: Dec 2025
  • Workflow: multi-step interactive work; user issues continue after selecting next steps; rate limit interrupts
  • Thread ID: 019b3469-9795-7b42-be13-705d06d2cbaf

Steps to reproduce

  1. Start a long interactive session with multi-step tasks (planning -> docs -> experiments -> follow-up validation).
  2. Have the assistant create/update documentation or notes files.
  3. Ask the assistant to run targeted experiments and summarize findings.
  4. Ask it to continue with explicit next steps (for example: validate specific comparisons across 2-3 cases, then rework a scheduler logic).
  5. Hit a usage limit (You have hit your usage limit...).
  6. Resume session later (same account or different account) and repeat the last instruction (continue).

Expected result

  • The assistant resumes exactly from the last instruction:
    • runs the requested validation across the requested cases,
    • reworks the logic as requested,
    • updates the relevant files,
    • and reports results with continuity.

Actual result

After resuming:

  • The assistant does not proceed with the requested validation or rework.
  • It instead performs unrelated work (for example: updates an unrelated spec doc), then restarts earlier prompts, and/or replays previously completed steps.
  • The flow shows loss of the current task pointer and drift to a different goal.

Evidence

  • Immediately after the rate limit boundary, the assistant outputs an update to an unrelated doc and restarts earlier prompts, despite those already being completed pre-limit.
  • The pre-limit state included a clear user instruction to continue with explicit next steps; the post-limit output did not follow those steps.

Impact

  • Wasted tokens/time: repeats already-finished work and rehashes earlier context.
  • Incorrect artifacts: may modify the wrong files.
  • Reliability issue: resume after limit becomes unusable for multi-step workflows without manual restatement.

Severity

High for multi-step engineering workflows. This breaks continuity and can lead to unintended code/doc changes.

Suspected causes

  • Context compaction drops the active task and last user constraints near the limit boundary.
  • Resume may rehydrate the wrong summary (or an earlier summary) rather than the most recent local state.
  • Session identity mismatch when resuming under another account (or changed model) may reduce access to the latest conversation state and/or tool state, amplifying drift.
  • Loss of ephemeral state (what to do next, which experiments remain) causes the assistant to fall back to generic or earlier instructions.

Workarounds

  • Write a persistent handoff file before limits (for example: SESSION_HANDOFF.md) including current goal, completed steps, next steps, and exact commands/URLs.
  • After resume, explicitly instruct: Read SESSION_HANDOFF.md and continue from Next steps.
  • Prefer resuming with the same session ID and same environment where possible; avoid switching accounts mid-session.

Suggested fix / product improvement

  • Persist and restore an explicit current task pointer (last user instruction + structured plan) separate from the compressed conversation summary.
  • On resume, show a brief Resume checkpoint (last task, last artifacts touched, pending steps) and bias execution toward completing pending steps before starting new work.
  • Detect drift: if the next assistant action edits unrelated files/goals, prompt for confirmation or re-anchor to last instruction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions