You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
webchat: single chat.send creates 3-4 duplicate user messages in session JSONL #46005
A single chat.send RPC via the webchat channel creates 3-4 duplicate user messages in the session JSONL file. Each duplicate has a unique message ID and different timestamps (10-40s apart), suggesting the gateway processes the same inbound message multiple times rather than it being a client-side retry.
Repro
Connect a native macOS app (or the gateway dashboard) via webchat WebSocket
Send one message via chat.send RPC with an idempotencyKey
Check the session JSONL: the user message appears 3-4 times
Closing this as duplicate or superseded after Codex automated review.
#46005 is superseded by the dedicated open draft PR #52903, which explicitly tracks the same model-fallback retry duplicate-user-message problem and says it fixes #46005. Current main has gateway same-idempotency handling, but the session-manager retry dedupe itself is not separately implemented on main, so this should close as superseded rather than implemented.
Gateway idempotency path exists: Current chat.send checks cached chat:<idempotencyKey> results and returns the cached payload before starting a new run. (src/gateway/server-methods/chat.ts:2185, 28497515fe1e)
Gateway in-flight path exists: Current chat.send checks chatAbortControllers for the idempotency key and returns { status: "in_flight" } while the run is active. (src/gateway/server-methods/chat.ts:2193, 28497515fe1e)
Activity
fix(agents): deduplicate user messages from model-fallback retries
fix(ai): deduplicate identical consecutive user messages in Responses…
clawsweeper commentedon Apr 26, 2026
Closing this as duplicate or superseded after Codex automated review.
#46005 is superseded by the dedicated open draft PR #52903, which explicitly tracks the same model-fallback retry duplicate-user-message problem and says it fixes #46005. Current main has gateway same-idempotency handling, but the session-manager retry dedupe itself is not separately implemented on main, so this should close as superseded rather than implemented.
What I checked:
chat:<idempotencyKey>results and returns the cached payload before starting a new run. (src/gateway/server-methods/chat.ts:2185, 28497515fe1e)chatAbortControllersfor the idempotency key and returns{ status: "in_flight" }while the run is active. (src/gateway/server-methods/chat.ts:2193, 28497515fe1e)prepareSessionManagerForRun()still only resets pre-created session files when there is no assistant message; it does not include thestripTrailingOrphanedUserMessages()style fix proposed by fix: strip trailing orphaned user messages on retry to prevent duplicates #46028/fix(agents): deduplicate user messages from model-fallback retries #52903. (src/agents/pi-embedded-runner/session-manager-init.ts:32, 28497515fe1e)So I’m closing this here and keeping the remaining discussion on the canonical linked item.
Codex Review notes: model gpt-5.5, reasoning high; reviewed against 28497515fe1e.