lupin.Open console
Voice

Test voice behavior without dialing a real phone

Build synthetic fixtures for framing, endpointing, interruption, signatures and authority before an operator runs a controlled phone trial.

Define what an offline test can establish

Local voice tests can verify event ordering, state transitions, audio framing, signature rejection and permission boundaries. They cannot prove a carrier route reaches a real handset or establish live provider billing. Write the acceptance statement narrowly before building fixtures. For example, a test can prove that late synthesis chunks are discarded after an interruption, without claiming that every caller will hear perfect barge-in. This separation lets teams make useful progress without buying numbers, dialing private peers or sending customer audio to external services during routine development.

Create a small synthetic dialogue specification

Use invented task facts: ask for a Tuesday appointment, pause after an unfinished phrase, correct Tuesday to Wednesday and interrupt a long response. Define the expected committed utterances, corrected task state and final action proposal. Keep spoken text distinct from event timestamps so you can change delay and ordering without rewriting the task. Add a background-noise case and a brief acknowledgement that should not become a new request. A specification written before the test prevents the implementation’s current behavior from being treated as correct merely because the fixture reproduces it.

Local fixture data only. Attach it to a fake transport; it performs no network requests.
const dialogue = [
  { atMs: 0, caller: "Move my appointment to Tuesday." },
  { atMs: 900, caller: "Actually, Wednesday." },
];
const expected = { proposedDay: "Wednesday", executedActions: 0 };
console.log({ dialogue, expected });

Stub the network boundaries explicitly

Replace provider sockets and HTTP clients with local fakes that emit prepared events. Include delayed recognition readiness, partial and final transcripts, synthesis audio before and after cancellation, a dropped socket and duplicate terminal callbacks. Use test-only verification keys for signed webhook fixtures. Do not call the production API merely to see whether the fake request would be accepted. A good fake records requested arguments so assertions can check model configuration and payload shape while ensuring no actual dial, app action, OAuth authorization or purchase can escape the test process.

Assert authority and accounting alongside audio

Test an incoming caller asking for private tools and confirm that the secure callback path is required. Test a pending sensitive action and verify that spoken assent does not execute it. For paid operations, retain one operation key and simulate a lost response with a known provider outcome; the replay must recover local state without sending another effect. Test duration expiry, confirmed hangup and one-active-call admission. These checks cover the failure modes most likely to create real-world consequences, even though all callers, numbers and provider responses in the fixtures are synthetic.

Package results for the later operator trial

Save the dialogue specification, expected states, observed failures and captured configuration with the change. Run the repository’s focused voice suites from an authorized source checkout when available, and report exactly which checks passed. Keep an operator-controlled live trial as a separate activity with an owned verified number, approved destination, short duration and billing readiness. The offline result should make that trial smaller and easier to evaluate. It should never be described as a completed live call test or used to bypass the provider setup and human authorization required for real telephony.

Check the fixture cannot reach a provider

Install a test network guard that rejects unexpected outbound requests and assert its call count after the dialogue completes. A fake socket is insufficient if a fallback path can still dial or contact another provider. The expected result is the corrected Wednesday proposal, zero executed actions and zero unapproved network requests.

Sources & verification

Reviewed against current checked-in Lupin routes, shared contracts and official provider references. No live calls, OAuth authorizations, app actions or purchases were performed.

Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.

Put it into practice

Give your agent the right tools.

Review the API, workspace requirements and permissions before enabling a workflow.

Explore phone Register an agent