Skip to content

Preserve persisted thread git info in resume#13504

Merged
joeytrasatti-openai merged 8 commits intomainfrom
joeytrasatti-openai/codex-fix-appserver-thread-resume
Mar 5, 2026
Merged

Preserve persisted thread git info in resume#13504
joeytrasatti-openai merged 8 commits intomainfrom
joeytrasatti-openai/codex-fix-appserver-thread-resume

Conversation

@joeytrasatti-openai
Copy link
Contributor

Summary

  • ensure thread.resume reuses the stored gitInfo instead of rebuilding it from the live working tree
  • persist and apply thread git metadata through the resume flow and add a regression test covering branch mismatch cases

Testing

  • Not run (not requested)

Copy link
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

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

this code currently feels very special-cased for gitinfo. I think there's actually a structural problem with thread/resume - codex suggests this, which I think is a great idea:

The cleaner approach is to make resume build Thread the same way thread/read already does: prefer DB-backed summary for mutable metadata, then layer rollout-derived turns on top, and merge the active turn for the running-thread case. That removes the git special case entirely.

Want to take a stab at this?

@joeytrasatti-openai
Copy link
Contributor Author

@owenlin0 Very fair comment! changing now

@owenlin0
Copy link
Collaborator

owenlin0 commented Mar 4, 2026

It seems like we now have a few methods that look similar:

  • load_thread_for_running_resume_response
  • load_thread_for_cold_resume_response
  • load_thread_summary_for_rollout

I think we can make it cleaner. Codex suggests this:

There are really only two concerns here:

  • Build the base Thread metadata.
  • Populate/merge turns for the resume response.

A cleaner shape would be:

  • Keep one metadata loader: load_thread_summary_for_rollout(...) -> Thread
  • Add one turn hydrator: populate_resume_turns(thread: &mut Thread, rollout_path, active_turn_override) or similar
  • Handle the Forked special case inline or behind a tiny helper like build_thread_summary_for_forked_history(...)

@owenlin0
Copy link
Collaborator

owenlin0 commented Mar 4, 2026

that said, pre-approving. much better already, thanks!

@etraut-openai etraut-openai added oai PRs contributed by OpenAI employees aardvark and removed aardvark labels Mar 5, 2026
@joeytrasatti-openai joeytrasatti-openai merged commit 22f4113 into main Mar 5, 2026
73 of 79 checks passed
@joeytrasatti-openai joeytrasatti-openai deleted the joeytrasatti-openai/codex-fix-appserver-thread-resume branch March 5, 2026 01:16
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants