dimamitya

← writing

testing a voice agent by breaking its connection

claudima’s first conversations through its own clubhouse client established that the audio path worked. the next question was what survived when a connection stopped working halfway through a session.

the client coordinates an http api, a room-event subscription, and a native audio process. i tested those paths separately. the failures exposed bugs in how the application represented a room, owned its membership, and offered recovery to the person operating it.

fail one connection at a time

for the http and subscription experiments, i used a temporary local relay that could delay or close the application’s connections to the selected services. it passed encrypted traffic without inspecting its contents. the native agora audio path stayed outside that relay.

testing audio required a different experiment: temporarily fail outgoing network calls inside the application’s own rtc helper process. the real sdk then reported a connection failure. an independent http request still succeeded, which helped distinguish the audio failure from a general loss of access to clubhouse.

each experiment had a narrower question than “does reconnect work?” which state became unavailable, which process stayed alive, and which operations could still proceed?

a missing snapshot erased the conversation

a short network interruption changed the conversation uuid even though the room and rtc generation had not changed.

the capture path used an available room snapshot as the condition for returning a room id. when the snapshot became unavailable, the consumer interpreted the missing id as a room change and reset the conversation.

the fix separated identity from readiness. the connection continued to own its room id while temporarily unavailable. capture and commands still required fresh, usable state. final closure cleared the identity.

a regression reproduced the reset on the old code and passed after the change. this gave the room id a precise meaning throughout an interruption, without allowing stale state to authorize new work.

replacing audio accidentally left the room

the first native audio failure reached the expected recovery path: the sdk reported a keep-alive timeout, publication stopped, and the old helper exited. the replacement’s room join then received http 400, and the application stopped.

inspection found an explicit room-leave request on every rtc replacement. the audio process had been given responsibility for ending the wider membership. leaving as the last participant could have closed that room; the observations were consistent with that explanation, but did not establish the server’s exact reason for rejecting the new join.

i moved ownership of membership to the enclosing connection. replacing the audio helper could then preserve membership, while final closure and failed recovery still retained an obligation to leave.

in the subsequent live experiment, the replacement helper became available and the application kept its conversation uuid and journal. recognition resumed in the same session. that established recovery for the tested failure sequence.

a failed memory probe needed its own explanation

after recovery, the model failed to recall a control word. it looked like another symptom of the connection bug until i checked what the model had actually received.

36 new utterances had arrived after the word, before the fault, while the recent-history window held 30. the word was still in sqlite but was already outside the context supplied to the model. the post-recovery request did contain earlier utterances that remained inside that window.

the experiment supported preservation of the session and its bounded context. it provided no evidence that the model could recall a word absent from its input. checking the actual context prevented a failed probe from being assigned to the wrong subsystem.

cleanup became a recovery dead end

a later network failure left the process and control panel alive, but room cleanup was incomplete. the client rejected every new join and demanded a restart. the first cleanup error also hid the outcome of the other leave operation.

the fix retained the unconfirmed cleanup obligations individually. once the old audio process and subscription producers had stopped, a user-requested join or leave could retry the remaining steps. each confirmed step was cleared; a new join stayed blocked until cleanup was confirmed.

another real network interruption exercised this change. a join through the local api completed the outstanding cleanup and recovered the connection without restarting the application.

the interface still blocked the same action. its room card decided “you are here” by comparing room ids, including the id deliberately retained during failed cleanup. the card needed the connection phase and readiness too. its states now distinguish a connected room, an active attempt, and a failed connection where “join again” is available.

give each result a boundary

the native recovery and the later cleanup retry both have live observations. the interface fix and further reconnect timing changes have local regression coverage; that is a different level of evidence from repeating a live fault.

these experiments made recovery inspectable as a sequence: retain identity, withdraw unavailable capabilities, settle the old connection’s obligations, and establish fresh readiness. the operator also needs a usable route through that sequence. a process that stays alive with a permanently disabled join button still leaves the task unfinished.

also in this project: building the clubhouse client and teaching a voice agent to stay quiet.