[codex] Remove unused TurnContextItem fields#22709
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e723214081
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -382,11 +381,6 @@ impl TurnContext { | |||
| collaboration_mode: Some(self.collaboration_mode.clone()), | |||
| realtime_active: Some(self.realtime_active), | |||
| effort: self.reasoning_effort, | |||
There was a problem hiding this comment.
Keep new rollout turn_context lines readable by older builds
When a user creates turns with this version and then opens/resumes/forks the same rollout with the currently released older binary, the older TurnContextItem still requires summary, so RolloutRecorder::load_rollout_items fails to deserialize and skips each new turn_context line. That drops the persisted previous-turn settings/reference context baseline used for resume/fork reconstruction, so model/realtime/context diffs are rebuilt as if no baseline existed; if rollout compatibility across versions is expected, keep serializing at least the default summary until older readers make it optional.
Useful? React with 👍 / 👎.
| @@ -2805,8 +2805,6 @@ pub struct TurnContextNetworkItem { | |||
| pub struct TurnContextItem { | |||
There was a problem hiding this comment.
Update the remaining suite TurnContextItem constructor
This struct shape change leaves core/tests/suite/resume_warning.rs:28 constructing TurnContextItem with the removed trace_id, summary, user_instructions, developer_instructions, final_output_json_schema, and truncation_policy fields. Building the core integration suite now fails with unknown-field errors for that test target, so the removed fields need to be deleted there as well.
Useful? React with 👍 / 👎.
|
I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
Why
TurnContextItemis the durable baseline used to reconstruct context diffs across resume/fork. Several fields persisted on it were no longer read from the persisted item: trace ids, reasoning summary, user/developer instructions, output schema, and truncation policy. Keeping them in rollout snapshots adds schema surface and state that can drift without affecting reconstruction.What changed
TurnContextItem.TurnContext::to_turn_context_item.TurnContexttrace id instead of carrying it throughTurnContextItem.Verification
cargo test -p codex-protocol --lib turn_context_itemcargo test -p codex-core --lib new_default_turn_captures_current_span_trace_idcargo test -p codex-core --lib record_initial_history_resumed_turn_context_after_compaction_reestablishes_reference_context_itemcargo test -p codex-rollout resume_candidate_matches_cwd_reads_latest_turn_contextcargo test -p codex-state turn_contextgit diff --check