Skip to content

Do not replay rolled-back turns from history fallback - #356

Open
Skywt2003 wants to merge 1 commit into
agentclientprotocol:mainfrom
Skywt2003:codex/fix-rollback-history
Open

Do not replay rolled-back turns from history fallback#356
Skywt2003 wants to merge 1 commit into
agentclientprotocol:mainfrom
Skywt2003:codex/fix-rollback-history

Conversation

@Skywt2003

Copy link
Copy Markdown

Summary

  • honor thread_rolled_back before replaying response-item fallback history
  • use task_started as the turn boundary, with user_message fallback for legacy rollouts
  • discard messages and tool calls belonging to rolled-back turns

Fixes #355.

Root cause

The app-server thread contains only the active conversation, but the response-item fallback reads the append-only rollout and previously ignored thread_rolled_back. Merging both histories could therefore restore an obsolete prompt and answer after a message edit.

Validation

  • npm run typecheck
  • npm test — 342 passed, 28 skipped
  • npm run build

@Skywt2003
Skywt2003 marked this pull request as ready for review August 2, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session/load replays turns removed by thread_rolled_back

1 participant