session/load replays turns removed by thread_rolled_back
Summary
When the response-item history fallback is active, session/load replays turns
that were removed by editing/rollback. The fallback ignores
event_msg/thread_rolled_back, so the obsolete prompt and answer are merged
back into the current app-server thread history.
Reproduced on current main (992299d, package version 1.1.9).
Reproduction
Pass this sequence to parseResponseItemHistoryFallback (with a missing
function call so the fallback is enabled):
user_message: unfinished prompt
- assistant response:
obsolete answer
thread_rolled_back: { "num_turns": 1 }
user_message: edited prompt
- assistant response:
current answer
- a function call and its output
Expected message output:
edited prompt
current answer
Actual message output:
unfinished prompt
obsolete answer
edited prompt
current answer
The fallback should discard updates belonging to rolled-back turns before
merging them with the app-server thread history.
session/loadreplays turns removed bythread_rolled_backSummary
When the response-item history fallback is active,
session/loadreplays turnsthat were removed by editing/rollback. The fallback ignores
event_msg/thread_rolled_back, so the obsolete prompt and answer are mergedback into the current app-server thread history.
Reproduced on current
main(992299d, package version1.1.9).Reproduction
Pass this sequence to
parseResponseItemHistoryFallback(with a missingfunction call so the fallback is enabled):
user_message:unfinished promptobsolete answerthread_rolled_back:{ "num_turns": 1 }user_message:edited promptcurrent answerExpected message output:
Actual message output:
The fallback should discard updates belonging to rolled-back turns before
merging them with the app-server thread history.