fix(native-chat): a refused steer leaves its turn as the chat's latest request (#29907)

A steer Codex answered into a turn that then ended without taking it is
rejected and moved to the thread, so the sidebar verdict and the
completion feed treated it as a refused request of its own and reported
it in place of the turn it joined.
This commit is contained in:
Brennan Benson
2026-10-17 13:12:26 -07:00
committed by GitHub
parent 46984db859
commit 1c411db2a5
2 changed files with 12 additions and 3 deletions
@@ -191,11 +191,15 @@ const ROWS: Row[] = [
items: [
userEntry('m1', 1),
turn('t1', 2, { state: 'completed', outcome: 'success', completedAt: 50 }),
userEntry('steer', 3, 't1')
userEntry('steer', 3)
],
submissions: [
sent('m1', { dispatchState: 'accepted' }),
rejected('steer', 'no active turn to steer', 30)
sent('steer', {
dispatchState: 'rejected',
reason: 'no active turn to steer',
answeredInTurn: { turnItemId: 'codex:turn:t1', via: 'steer' }
})
],
outcome: 'success',
listed: true
@@ -82,7 +82,12 @@ export function latestStructuredAgentSessionRequest(
}
}
const submission = rejected.get(item.itemId)
if (submission && classifyDispatchRejection(submission).verdict === 'failure') {
// Rejection relocates a refused steer to the thread, but its turn remains the request.
if (
submission &&
submission.answeredInTurn?.via !== 'steer' &&
classifyDispatchRejection(submission).verdict === 'failure'
) {
return {
kind: 'refused-send',
id: item.itemId,