[codex] retry whatsapp session init conflicts#101106
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 9:58 PM ET / 01:58 UTC. Summary PR surface: Source +54. Total +54 across 2 files. Reproducibility: yes. at source/test level, not as a live reproduction: current main only releases exact WhatsAppRetryableInboundError instances, and the PR's regression test models redelivery after the native conflict string. I did not inspect a real WhatsApp run against current main or the PR head. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the WhatsApp-local retry classifier after redacted real WhatsApp proof confirms release-for-redelivery, delayed read marking, and single successful reply behavior. Do we have a high-confidence way to reproduce the issue? Yes at source/test level, not as a live reproduction: current main only releases exact WhatsAppRetryableInboundError instances, and the PR's regression test models redelivery after the native conflict string. I did not inspect a real WhatsApp run against current main or the PR head. Is this the best way to solve the issue? Yes, this appears to be the best narrow code layer for the WhatsApp delivery consequence: it reuses the existing WhatsApp retryable inbound path and matches the Slack precedent instead of adding a second dedupe mechanism. The remaining gap is real WhatsApp behavior proof, not a different code shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f3106057e62b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +54. Total +54 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
WhatsApp inbound handling already has a retry path through
WhatsAppRetryableInboundError, butreply session initialization conflicted for ...was thrown as a plain error from the native reply session setup path.When that happened, WhatsApp finalized the inbound delivery as complete even though the agent turn did not run successfully. That committed dedupe state and completed durable receive state, so a later WhatsApp redelivery with the same message id could be ignored instead of retried.
This PR classifies that native session-init conflict as retryable for WhatsApp inbound delivery. The existing WhatsApp dedupe and durable receive retry path then releases the message instead of marking it complete.
Summary
reply session initialization conflictedinbound failures as retryable delivery failuresEvidence
node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-whatsapp.config.ts extensions/whatsapp/src/monitor-inbox.streams-inbound-messages.test-support.ts -t "reply session initialization conflicts"node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfonode scripts/run-vitest.mjs run --config test/vitest/vitest.extension-whatsapp.config.ts extensions/whatsapp/src/monitor-inbox.streams-inbound-messages.test-support.tsThe new test first throws
reply session initialization conflicted for agent:main:whatsapp:direct:+15551234567, confirms WhatsApp does not mark the failed inbound as read, redelivers the same message id, and confirms the second delivery is processed and then marked read.Notes
This mirrors the retry classification already used by Slack for the same native reply session initialization conflict text, while keeping WhatsApp on its existing dedupe and durable receive retry path.