Skip to content

GPT-5.3-Codex-Spark Keeps losing context, and always starts new, #22324

Open

Description

@TasmeerJamali

What version of the Codex App are you using (From “About Codex” dialog)?

26.506.31421

What subscription do you have?

Pro

What platform is your computer?

Windows

What issue are you seeing?

Image just losing context, starts from zero, on GPT-5.3-Codex-Spark

What steps can reproduce the bug?

nothng, whenevr compacts the context, it starts from zero,

What is the expected behavior?

repeating this again and again and again

Additional information

No response

Activity

  1. added
    app
    on May 12, 2026
  2. added
    bug
    model-behavior
    context
    and removed
    app
    model-behavior
    on May 12, 2026
  3. emersonbusson commented on May 13, 2026

    @emersonbusson

    From a quick scan of the compaction install path: the symptom "starts from zero after compact" most likely lands in codex-rs/core/src/compact_remote.rs::run_remote_compact_task_inner_impl around line 246 (sess.replace_compacted_history(new_history, ..., compacted_item)), where new_history comes from:

    1. compact_conversation_history(...) returning the server-side compacted history.
    2. process_compacted_history(...) reinjecting initial_context ahead of the last real user message (when BeforeLastUserMessage) and filtering out non-user role messages.

    There are two ways this can produce an "empty" post-compact view:

    • Server returned a degenerate compaction. If the compact endpoint replies with only a context-compaction item and no user messages, process_compacted_history will still install it — but to the user it looks like the session reset, because all prior turns are gone. gpt-5.3-codex-spark is a recent rollout, so it's plausible the compact endpoint behaves differently for it.
    • Local filtering dropped everything user-visible. process_compacted_history calls collect_user_messages which filters out summary-prefixed messages and (in recent versions) preserves only what parse_turn_item(...) => TurnItem::UserMessage(..) matches. If gpt-5.3-codex-spark's compact summaries come back with a role/shape the parser doesn't recognize, the filter quietly drops them.

    A diagnostic that would narrow this down: when it "starts from zero", does /status (or whatever surface shows context usage) report low/zero tokens, or does it report a normal-ish amount but the model itself acts amnesic? The first points at install-time history loss (cases above), the second points at the model not attending to the compaction summary item in its prompt.

    Also relevant: a recent attempt to harden the multimodal path through compaction (#22141, reverted by #22170) changed how user messages survive truncation — if gpt-5.3-codex-spark started shipping after that landed and then unlanded, the symptom timing would track.

    Not opening a PR — just leaving the code path map in case it helps the team triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcontext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions