Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions tests/test_send_acknowledgment.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
"""Tests: send acknowledgment + diagnostic preservation.

ChatGPT code review (conv 6a52f0f3) found two defects:

1. click_send dispatches events but doesn't verify React accepted the
submission. If the page is overloaded, the click fires but no message
is sent. The bridge silently enters completion detection which finds
nothing → reconciliation failure with no diagnostic.

2. TurnReconciliationError discards the underlying fetch_failed diagnostic.
The actual error (CDP timeout, destroyed context, HTTP error) is lost.

Fix 1: after click_send + UUID wait, verify at least one acknowledgment:
"""
after click_send + UUID wait, verify at least one acknowledgment:
- UUID captured, OR
- user-message DOM count increased AND composer cleared
If none → raise SendNotAcknowledgedError before entering completion detection.
Expand Down Expand Up @@ -49,8 +38,6 @@ async def test_send_not_acknowledged_raises_when_no_signals(monkeypatch):
"""When click_send fires but no acknowledgment appears (no UUID, no DOM
count increase, composer not cleared), the bridge must raise a typed error
instead of silently entering completion detection."""
from chatgpt_web2api.cdp_driver import CDPDriver

driver = _make_driver()
# Mock the send path
driver.type_message = AsyncMock()
Expand Down
Loading