Skip to content

Mark incomplete resumed turns interrupted when idle#14125

Merged
guinness-oai merged 4 commits intomainfrom
guinness/fix-thread-resume-status
Mar 10, 2026
Merged

Mark incomplete resumed turns interrupted when idle#14125
guinness-oai merged 4 commits intomainfrom
guinness/fix-thread-resume-status

Conversation

@guinness-oai
Copy link
Collaborator

Fixes a Codex app bug where quitting the app mid-run could leave the reopened thread stuck in progress and non-interactable. On cold thread resume, app-server could return an idle thread with a replayed turn still marked in progress. This marks incomplete replayed turns as interrupted unless the thread is actually active.

@guinness-oai guinness-oai marked this pull request as ready for review March 9, 2026 19:31
@owenlin0 owenlin0 requested a review from euroelessar March 9, 2026 19:39
Comment on lines +3255 to +3259
for turn in &mut thread.turns {
if matches!(turn.status, TurnStatus::InProgress) {
turn.status = TurnStatus::Interrupted;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this check/rewrite needs to be done before resume_thread_with_history call above.
We do allow multiple clients to connect to the same app server, and they should observe the same thread status/etc, but with this change only the first connected client will see interrupted turns, the rest will be stuck in limbo as before this change.

@guinness-oai guinness-oai merged commit b33edeb into main Mar 10, 2026
31 checks passed
@guinness-oai guinness-oai deleted the guinness/fix-thread-resume-status branch March 10, 2026 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 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.

2 participants