
Subscribe
Tags
Voice AI
AI Agents
Developer Tutorials
This series builds a talking jack-o'-lantern for trick-or-treaters, and this post is part 8. If it's the first one you've read, go back to part 1. In part 7 my server took charge of pacing and modes. Its checks are good, but a person standing in the yard sees things a camera misses. A nervous six-year-old can look older in a tall hat, and a family of adults who'd love the full act might bring a stroller. Here I build a phone remote that runs the show and lets that person overrule the server.
Relay commands through the server
The pumpkin's page holds the call and every setting, and it runs on a computer hidden inside the prop. The remote is a phone-sized page I can open from anywhere in the yard. The two pages never talk to each other directly. The server sits between them, passing numbered commands from the remote to the page and the page's status back to the remote.
A command can start or stop the show, set a slider, or reset a group of sliders. The server adds one more kind of its own, the restart from part 7. Once a second, the pumpkin's page asks for any commands newer than the last one it applied, so each command lands once. A newly loaded page gets the current number and none of the backlog, so a reload can't replay old slider changes over its saved settings.
Status flows the other way. Every second, the page posts whether it's running, the call's state, who's on stage, the mic level, and every setting. The remote shows all of it, and if the page goes quiet for more than five seconds, the remote treats the pumpkin's computer as gone.
Start needs a click
Chrome won't play audio until someone clicks on the page, so someone has to click Start on the pumpkin's computer once per page load. The page reports whether it's armed, which means someone has clicked Start there. Until it's armed, the remote's Start button stays disabled and shows a hint. Once it's armed, Start and Stop on the phone work from anywhere.
The Gentle / Normal switch
The remote's "This group" card shows the mode the server wants for the group in front, along with a switch to change it. Pressing the switch sends the operator's choice to the server.
A human operator's choice of context is remembered by the visit state we wrote in part 7, which holds it for the group in front until they leave. A person's choice outranks every automatic check. After Normal, a failed age check, a small child measured joining, and the model's own call to become_gentle all leave the act in place. After Gentle, only another press brings the act back. If nobody's on stage when the operator presses, the choice applies to a group arriving within 20 seconds. I can press Gentle when I see a stroller coming up the driveway.
If the pumpkin isn't in the chosen mode yet, the server also sends a message into the call asking for the tool that switches modes.
Traps to avoid
Don't let a later automatic check undo a person's choice. Scope the override to the group in front, and keep it until they leave.
Next
The pumpkin can now run a whole night with a person keeping watch. In part 9 I test it without visitors, replay a recorded night through the real server, and watch it live while it runs.
The series
The agent: a personality and three modes, as contexts and steps.
Tools: what the AI calls on my server, and why its material lives in code.
Vision: letting the agent see, and checking the camera before any decision that matters.
The stage: detecting who is standing in front of the pumpkin, in the browser.
The operator: a person with a phone who can overrule the agent (this post).
Related Resources






