Skip to content

Defer managed worktree transitions to fresh TUI loop iterations - #43298

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/0435f56d08bf3a6392d35b5c1cfdcc0f1fe02753
Sep 6, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/0435f56d08bf3a6392d35b5c1cfdcc0f1fe02753

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 6, 2026

Copy link
Copy Markdown

Defer managed worktree transitions to fresh TUI loop iterations

Why

Managed worktree transitions run through the event handler into the large synchronous ChatWidget constructor. Split this work so each stage runs on a fresh event-loop stack.

What changed

  • Queue worktree setup, checkout completion and configuration loading, session transition, and widget attachment as separate stages with boxed futures.
  • Recheck the source session before transitioning and report retained checkout cleanup instructions when the transition cannot proceed.
  • Keep the old configuration paired with the old widget until attachment, and protect input during the handoff.

Testing

Update worktree lifecycle and submission tests to drain the deferred stages explicitly and assert that checkout creation starts before completion.

## Why

Managed worktree transitions run through the event handler into the large synchronous `ChatWidget` constructor. Split this work so each stage runs on a fresh event-loop stack.

## What changed

- Queue worktree setup, checkout completion and configuration loading, session transition, and widget attachment as separate stages with boxed futures.
- Recheck the source session before transitioning and report retained checkout cleanup instructions when the transition cannot proceed.
- Keep the old configuration paired with the old widget until attachment, and protect input during the handoff.

## Testing

Update worktree lifecycle and submission tests to drain the deferred stages explicitly and assert that checkout creation starts before completion.

GitOrigin-RevId: 0435f56d08bf3a6392d35b5c1cfdcc0f1fe02753
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/0435f56d08bf3a6392d35b5c1cfdcc0f1fe02753 branch from 402b91f to 52e12e0 Compare September 6, 2026 22:35
@copyberry
copyberry Bot merged commit 52e12e0 into main Sep 6, 2026
25 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/0435f56d08bf3a6392d35b5c1cfdcc0f1fe02753 branch September 6, 2026 22:36
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 6, 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.

6 participants