Skip to content

[codex] Omit fork turns from thread started notifications#19093

Merged
euroelessar merged 1 commit intomainfrom
ruslan/thread-fork-started-no-turns
Apr 24, 2026
Merged

[codex] Omit fork turns from thread started notifications#19093
euroelessar merged 1 commit intomainfrom
ruslan/thread-fork-started-no-turns

Conversation

@euroelessar
Copy link
Copy Markdown
Collaborator

Why

thread/fork responses intentionally include copied history so the caller can render the fork immediately, but thread/started is a lifecycle notification. The v2 Thread contract says notifications should return turns: [], and the fork path was reusing the response thread directly, causing copied turns to be emitted through thread/started as well.

What Changed

  • Route app-server thread/started notification construction through a helper that clears thread.turns before sending.
  • Keep thread/fork responses unchanged so callers still receive copied history.
  • Add persistent and ephemeral fork coverage that asserts thread/started emits an empty turns array while the response retains fork history.

Testing

  • just fmt
  • cargo test -p codex-app-server

@euroelessar euroelessar marked this pull request as ready for review April 23, 2026 07:15
@euroelessar euroelessar merged commit a3cccbd into main Apr 24, 2026
25 checks passed
@euroelessar euroelessar deleted the ruslan/thread-fork-started-no-turns branch April 24, 2026 19:31
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 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