Skip to content

Retry previous-model compaction with selected model#31976

Open
celia-oai wants to merge 4 commits into
mainfrom
codex/retry-compaction-on-model-404
Open

Retry previous-model compaction with selected model#31976
celia-oai wants to merge 4 commits into
mainfrom
codex/retry-compaction-on-model-404

Conversation

@celia-oai

@celia-oai celia-oai commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • retry automatic previous-model compaction once with the selected model for errors that may reflect model availability, compatibility, capacity, model-scoped usage, or broader server failure
  • share the retry eligibility check across both remote compaction implementations
  • document why the policy intentionally accepts occasional redundant fallback attempts
  • preserve the existing invalid-request regression test and add a separate model-not-found regression test

Why

A previous model may become unusable after a thread switches models. The failure can surface as an invalid request, unexpected HTTP status, context-window error, usage limit, overload, internal server error, or exhausted retry limit. Retrying compaction once with the selected model lets the turn continue while keeping fallback bounded.

Testing

  • just test -p codex-core 'pre_sampling_compact_falls_back_' (3 passed)
  • just test -p codex-core 'suite::compact::' (41 passed)
  • just fix -p codex-core
  • just fmt
  • previously attempted just test -p codex-core; the compaction tests passed, while the broader run encountered unrelated environment-dependent failures in approval, shell, MCP, code-mode, and realtime tests

@celia-oai celia-oai marked this pull request as ready for review July 10, 2026 02:06
@celia-oai celia-oai requested a review from a team as a code owner July 10, 2026 02:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7fbf365344

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/compact_remote_v2.rs
@celia-oai celia-oai changed the title Retry previous-model compaction after 404 Retry previous-model compaction with selected model Jul 10, 2026
@celia-oai celia-oai marked this pull request as draft July 10, 2026 02:31
@celia-oai celia-oai marked this pull request as ready for review July 10, 2026 02:35
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.

1 participant