Voice-agent orchestration without speculative side effects
A caller asks for an appointment on Tuesday, adds “afternoons only”, then changes the day to Thursday. A fast answer based on Tuesday's availability is still the wrong answer.
The useful question is not just whether work can start earlier. It is which work can start, which evidence survives a correction, and what lets the agent report an operation as completed.
This is a design walkthrough, not an executable controller or a latency benchmark. The appointment is a fictional example. The boundary here excludes booking, sending and other business writes from speculative work. External reads still have effects: they can disclose data, consume quotas and incur costs.
Start with three separate boundaries
Local preparation can identify a likely intent or assemble candidate arguments. Those candidates are not authority to call a tool.
An external lookup needs its own gate: permitted tool and account, permitted data, complete arguments, relevant purpose and an available request budget. “Read-only” does not remove that gate.
A booking needs a separate commitment decision. In this proposed flow, it follows a completed request and any confirmation required by the application. A user wanting an appointment is not necessarily approval for every service, time or account the model might select.
Keep those checks in application code. Model-generated fields such as authorized: true are proposals, not permissions.
Give evidence a dependency key
Do not attach a result only to “the current conversation”. Record what produced it:
availability evidence:
tool and account
service, date, time constraint and timezone
request identifier and observation time
success, failure or outcome unknown
Tuesday availability cannot establish Thursday availability. A service-description lookup might remain useful if the service has not changed and its observation is still valid under the application's freshness rule.
This suggests dependency-based invalidation rather than blindly keeping or discarding every result after any edit. The dependency key is a proposed mechanism, not a tested retrieval policy.
Treat late results as a normal event
Cancellation and evidence rejection solve different problems.
When the caller corrects Tuesday to Thursday, request cancellation if supported. Also mark the Tuesday request obsolete for answering the Thursday question. If it completes later, the response handler must still reject it as evidence for the new date.
Cancelling a local task does not prove that a remote service stopped, that a charge was avoided, or that a slot was released. Keep unresolved work in the accounting rather than freeing capacity on the assumption that it vanished.
The following is pseudocode. It omits concrete API schemas, locking and the implementation of the permission checks.
on_request_update(update):
apply update to current state
identify changed dependencies
mark affected requests obsolete
request cancellation where supported
prepare candidates locally
start only lookups accepted by application gates
on_lookup_result(request, result):
record the result and request outcome
if request is obsolete:
do not use it to answer the current request
else if dependencies match and freshness is acceptable:
retain successful evidence
else:
retain the outcome, but reject it as current evidence
before_booking(candidate):
recheck exact target, latest state and permission
require the application's confirmation gate
record the write intent
execute through the separately authorized write adapter
verify the returned booking against the exact target
if the write outcome is unknown:
reconcile before deciding whether to retry
The last section is deliberately not part of speculative lookup execution. In concurrent systems, checks and dispatch also need protection against a correction arriving between them. Pseudocode alone does not establish that protection.
Name the answer state honestly
“Thursday afternoon is available” and “Thursday afternoon is booked” are different claims.
The first needs suitable current availability evidence. The second needs evidence that the intended booking exists. A successful request acknowledgement may not establish that final state, depending on the provider's contract.
If a write times out, the agent should retain the exact intended operation and its unresolved outcome. It cannot safely infer either “nothing happened” or “the booking succeeded” from silence. Reconcile against the provider's authoritative state before choosing a retry. This walkthrough does not implement that adapter or claim provider-side idempotency.
Evaluate the contract before evaluating speed
Build an offline fake-provider trace before connecting business tools. Include a date correction while a lookup is pending, a late obsolete result, missing lookup permission, a failed lookup and an unresolved booking response.
For each trace, specify the expected result in advance. For example: no external call without the lookup gate; no Tuesday result used as Thursday evidence; no booking inside the speculative executor; no completion claim from an unresolved write.
Passing those cases would validate only the behaviour implemented in that fixture. It would not prove remote cancellation, authorization across all accounts or safe production voice operation. No such tests were executed for this article.
Then compare the complete workflow with and without anticipation. Keep the cases and success criteria fixed. Separate first audible acknowledgement from a useful answer. Track errors, slow responses, retries and total cost, including discarded work. Starting earlier is a hypothesis about improving the interaction, not the result of that comparison.
The architecture decision gets clearer when preparation, permission and completion evidence stop sharing one vague “done” flag.
For the broader architecture trade-offs, see the original Spanish guide in The Learning Curve:
https://iamdgarcia.substack.com/p/cuatro-arquitecturas-para-construir
Top comments (2)
The Tuesday-to-Thursday correction is a nice test case, and I like that late results get rejected as evidence rather than just cancelled. Cancelling locally proves nothing about the remote service, as you say. In production voice flows I've found the hardest part is the quota and disclosure side of speculative reads, not latency. Have you considered a per-call budget that speculative lookups draw from, so a caller who keeps changing their mind can't burn through it?
One more side effect that's specific to voice: what the agent has already said out loud. If "Tuesday at three is open" gets spoken just before the Thursday correction lands, the caller may already have noted it, and rejecting the stale evidence in the handler doesn't take the sentence back. I'd give spoken claims the same dependency key as the evidence behind them, so an invalidation also triggers an explicit correction in the next turn ("sorry, that was for Tuesday") instead of a quiet switch to Thursday.