You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GPT-5.3-Codex-Spark Keeps losing context, and always starts new, #22324
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:
compact_conversation_history(...) returning the server-side compacted history.
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.
Activity
emersonbusson commentedon May 13, 2026
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_implaround line 246 (sess.replace_compacted_history(new_history, ..., compacted_item)), wherenew_historycomes from:compact_conversation_history(...)returning the server-side compacted history.process_compacted_history(...)reinjectinginitial_contextahead of the last real user message (whenBeforeLastUserMessage) and filtering out non-user role messages.There are two ways this can produce an "empty" post-compact view:
process_compacted_historywill still install it — but to the user it looks like the session reset, because all prior turns are gone.gpt-5.3-codex-sparkis a recent rollout, so it's plausible the compact endpoint behaves differently for it.process_compacted_historycallscollect_user_messageswhich filters out summary-prefixed messages and (in recent versions) preserves only whatparse_turn_item(...) => TurnItem::UserMessage(..)matches. Ifgpt-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-sparkstarted 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.