<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ContextQA Engineering]]></title><description><![CDATA[ContextQA Engineering]]></description><link>https://contextqa.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 21:36:11 GMT</lastBuildDate><atom:link href="https://contextqa.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The booking succeeded. The agent timed out. What should the test assert?]]></title><description><![CDATA[A practical test design for agent timeouts, duplicate bookings and backend verification, with a ContextQA verifier setup guide.]]></description><link>https://contextqa.hashnode.dev/the-booking-succeeded-the-agent-timed-out-what-should-the-test-assert</link><guid isPermaLink="true">https://contextqa.hashnode.dev/the-booking-succeeded-the-agent-timed-out-what-should-the-test-assert</guid><category><![CDATA[Software Testing]]></category><dc:creator><![CDATA[Deep Barot]]></dc:creator><pubDate>Sun, 15 Nov 2026 04:28:36 GMT</pubDate><content:encoded><![CDATA[<p>An AI agent calls a booking API. The service commits the appointment, but the response never reaches the agent. The agent retries. The conversation ends politely—and the customer now has two appointments.</p>
<p>A transcript review can miss this defect. The useful question is whether one user-approved action produced exactly one business outcome.</p>
<p>Disclosure: I’m Deep, founder of ContextQA. This article was prepared with AI assistance. The scenario below is a proposed test design, not a reported customer incident or an executed ContextQA benchmark.</p>
<h2>Specify the failure point</h2>
<p>Use a sandbox and synthetic customer data. Start with no booking for a unique test operation. Arrange for the booking service to accept the first request and commit the record, then deliberately drop its response. A timeout before the request reaches the service is a different case and deserves its own test.</p>
<p>Have the agent recover through its normal retry path. Inspect both the conversation and the authoritative booking store. Do not infer persistence from the agent saying “confirmed.”</p>
<h2>Write the assertions before running the conversation</h2>
<table>
<thead>
<tr>
<th>Evidence</th>
<th>Expected result</th>
</tr>
</thead>
<tbody><tr>
<td>Booking records for the test operation</td>
<td>Exactly one committed booking</td>
</tr>
<tr>
<td>Customer, service and time</td>
<td>Match the user’s confirmed intent</td>
</tr>
<tr>
<td>Retried requests</td>
<td>Reuse the operation identity when retrying the same action</td>
</tr>
<tr>
<td>Booking identifier</td>
<td>Refers to the original committed result</td>
</tr>
<tr>
<td>Agent response</td>
<td>Does not claim a result that has not been verified</td>
</tr>
<tr>
<td>Escalation context</td>
<td>Includes confirmed state and unresolved uncertainty</td>
</tr>
</tbody></table>
<p>An idempotency key is only one part of the design. The service needs a defined policy for key lifetime, request payload mismatches and concurrent requests. Two requests with the same key can still expose a race if the implementation checks for existence and writes in separate, unprotected steps.</p>
<p>Do not reuse an old operation identity for a genuinely new user instruction. Retrying “book Tuesday” and changing the booking to Thursday are different business operations.</p>
<h2>Change the sequence</h2>
<p>After the basic case, vary one condition at a time:</p>
<ul>
<li>Retry while the original request is still in flight.</li>
<li>Restart the agent after the service commits but before confirmation is recorded.</li>
<li>Ask for a human while recovery is in progress.</li>
<li>Correct the requested time before the agent confirms the booking.</li>
<li>Repeat after the service’s deduplication window expires.</li>
</ul>
<p>For a voice agent, also interrupt spoken confirmation and disconnect the call. The recovery policy should specify what happens to the committed booking and what the next agent or human sees. Speech quality and backend correctness need separate evidence.</p>
<h2>Keep failures diagnosable</h2>
<p>Save the synthetic fixture identifier, initial and final records, tool arguments, operation identity, timestamps, injected failure point, and model/prompt/tool versions. Redact tokens and customer data. If the backing store is eventually consistent, use a bounded wait that follows its documented consistency behavior, then report the timeout as a failure to establish the expected state.</p>
<p>Keep deterministic checks for record counts, identifiers and fields. Use human review or a calibrated conversational evaluator for whether the explanation is clear and the escalation is appropriate. A strong score for politeness must not override a duplicate booking.</p>
<p>The next useful experiment is small: one operation, one dropped response, and an independent check of the committed result. Expand the suite after that case is understandable and reproducible.</p>
<h2>Apply this in ContextQA</h2>
<p>ContextQA’s current tool-verification guide separates test setup from read-only verification. In the project’s Tools page, configure a REST API or AWS Lambda tool with the Verifier role, specify the record or test correlation identifier, and enable tool verification on the relevant custom metric. Keep duplicate-count and field assertions explicit; the judge’s rubric must define the expected outcome. A verifier should inspect state, never repair it.</p>
<p>Follow the <a href="https://learning.contextqa.com/ai-agent-testing/agent-evaluation/verify-tool-actions?utm_source=hashnode&amp;utm_medium=organic_social&amp;utm_campaign=practical_guides_2026_11&amp;utm_content=20261114_agent_retries_tutorial_learn_v1&amp;utm_id=cq_pg_2026_11">tool-action verification guide</a> to map this test design to your own backend. This article does not demonstrate automatic network-fault injection by ContextQA; configure the timeout fixture in your authorized test environment.</p>
]]></content:encoded></item></channel></rss>