Skip to content

Defer persistence of rollout file#11028

Merged
etraut-openai merged 16 commits intomainfrom
etraut/defer_rollout
Feb 8, 2026
Merged

Defer persistence of rollout file#11028
etraut-openai merged 16 commits intomainfrom
etraut/defer_rollout

Conversation

@etraut-openai
Copy link
Collaborator

@etraut-openai etraut-openai commented Feb 7, 2026

  • Defer rollout persistence for fresh threads (InitialHistory::New): keep rollout events in memory and only materialize rollout file + state DB row on first EventMsg::UserMessage.
  • Keep precomputed rollout path available before materialization.
  • Change thread/start to build thread response from live config snapshot and optional precomputed path.
  • Improve pre-materialization behavior in app-server/TUI: clearer invalid-request errors for file-backed ops and a friendlier /fork “not ready yet” UX.
  • Update tests to match deferred semantics across start/read/archive/unarchive/fork/resume/review flows.
  • Improved resilience of user_shell test, which should be unrelated to this change but must be affected by timing changes

For Reviewers:

  • The primary change is in recorder.rs
  • Most of the other changes were to fix up broken assumptions in existing tests

Testing:

  • Manually tested CLI
  • Exercised app server paths by manually running IDE Extension with rebuilt CLI binary
  • Only user-visible change is that /fork in TUI generates visible error if used prior to first turn

- Defer rollout persistence for fresh threads (`InitialHistory::New`): keep rollout events in memory and only materialize rollout file + state DB row on first `EventMsg::UserMessage`.
- Keep precomputed rollout path available before materialization.
- Change `thread/start` to build thread response from live config snapshot and optional precomputed path.
- Improve pre-materialization behavior in app-server/TUI: clearer invalid-request errors for file-backed ops and a friendlier `/fork` “not ready yet” UX.
- Update tests to match deferred semantics across start/read/archive/unarchive/fork/resume/review flows.
@etraut-openai
Copy link
Collaborator Author

@codex review

Copy link
Contributor

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

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: 0101f2c2ad

ℹ️ 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".

Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

Code generally seems good by me, though the inherent complexity in supporting the laziness feels a bit unsatisfactory since anything dealing with rollouts needs to defend against the case where nothing may have hit disk yet? But if this is important to support, I suppose it can't be avoided...

})
}

fn open_log_file(path: &Path) -> std::io::Result<File> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

async?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think async makes sense in this case. Let me know if you're seeing something I'm not or feel strongly about it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this has been removed in the revised version, but I suggested this because I thought it was called from an async function (doing I/O).

Copy link
Collaborator

@pakrym-oai pakrym-oai left a comment

Choose a reason for hiding this comment

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

I think we should avoid having rollout recorder from interpreting items and knowing when to "commit". Instead it should be an explicit gesture from the agent loop.

@etraut-openai etraut-openai merged commit b3de6c7 into main Feb 8, 2026
37 of 38 checks passed
@etraut-openai etraut-openai deleted the etraut/defer_rollout branch February 8, 2026 07:05
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2026
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