Skip to content

Conversation

@aibrahim-oai
Copy link
Collaborator

@aibrahim-oai aibrahim-oai commented Sep 12, 2025

We need to construct the history different when compact happens. For this, we need to just consider the history after compact and convert compact to a response item.

This needs to change and use build_compact_history when this #3446 is merged.

@aibrahim-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

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, or 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 fix this CI failure" or "@codex address that feedback".

// --- Test helpers -----------------------------------------------------------

/// Build an SSE stream body from a list of JSON events.
fn sse(events: Vec<serde_json::Value>) -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can import these helpers from /codex-rs/core/tests/suite/compact.rs since they're the same

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

makes sense

(session, turn_context)
}

fn sample_rollout(
Copy link
Collaborator

Choose a reason for hiding this comment

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

As mentioned elsewhere, we should put helper functions under tests.

Copy link
Collaborator

@dedrisian-oai dedrisian-oai left a comment

Choose a reason for hiding this comment

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

Other than the small comments on tests, looks good!

@aibrahim-oai aibrahim-oai enabled auto-merge (squash) September 14, 2025 05:24
@aibrahim-oai
Copy link
Collaborator Author

@codex code by fixing tests that are failing on windows because of the new line. see the tests in this PR and make them different OS compatible. example of failing part:
FAIL [ 9.538s] codex-core::all suite::compact_resume_fork::compact_resume_after_second_compaction_preserves_history
FAIL [ 3.520s] codex-core::all suite::compact_resume_fork::compact_resume_and_fork_preserve_model_history_view

        <                        "text": String("You were originally given instructions from a user over one or more turns. Here were the user messages:\n\nAFTER_FORK\n\nAnother language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:\n\nSUMMARY_ONLY_CONTEXT"),
>                        "text": String("You were originally given instructions from a user over one or more turns. Here were the user messages:\r\n\r\nAFTER_FORK\r\n\r\nAnother language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:\r\n\r\nSUMMARY_ONLY_CONTEXT"),

@chatgpt-codex-connector
Copy link
Contributor

Summary

Testing

  • ⚠️ just fmt (command not available in container; used cargo fmt instead)
  • cargo fmt
  • cargo test -p codex-core --test all compact_resume_fork

View task →

@aibrahim-oai aibrahim-oai merged commit bbea6bb into main Sep 14, 2025
33 of 35 checks passed
@aibrahim-oai aibrahim-oai deleted the compact-resume branch September 14, 2025 13:23
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants