Build Journal

Local State Management & CSP Fixes for GIGI Voice Agent — August 27, 2026

I fixed local state management issues and CSP settings to enhance the GIGI voice agent's functionality, improving the agentic web experience.

2 changes3 min readby Rob

What shipped

  • Local State FixImplemented a Promise.race timeout to manage cold state issues.
  • CSP AdjustmentsAllowed API connections for GIGI voice agent functionality.
  • Improved User ExperienceRestored GIGI voice agent and OpenStreetMap integration.

Today, I set out to address some critical issues that were affecting the performance of my platform, particularly around local state management and content security policy (CSP) settings. These fixes were essential to ensure that the GIGI voice agent could operate smoothly without interruptions. What shipped today were two significant fixes, both of which took about an hour of focused work to implement.

The first fix was related to local state management. I discovered that a newly drip-activated state in Arizona was causing a live in-house LLM call on a cold cache, which in turn was stalling the static-export worker beyond its timeout limit. Essentially, if that lane stalled, it hung the entire site build, which was a major blocker. I had to get creative with the error handling here, as the problem was uncaught by traditional try/catch methods. My solution involved implementing a Promise.race timeout that allowed me to fall back to the default introductory text if the live call didn't respond in time. This way, even if the promise was abandoned, it would still warm the cache for the next incremental static regeneration (ISR) render. This fix was particularly satisfying because it not only resolved the immediate issue but also improved the overall robustness of the local state management.

The second fix was related to the content security policy (CSP). I had previously enforced a CSP that inadvertently blocked the GIGI voice agent from functioning correctly. The @elevenlabs/react SDK, which fetches its conversation token directly from api.elevenlabs.io, was being blocked because the CSP rules didn’t allow it. Additionally, I was using an embedded OpenStreetMap map iframe that also got caught in the restrictive CSP. Both of these issues went unnoticed while the CSP was in report-only mode but became apparent once it was enforced. After diving into the CSP configurations, I allowed connections from api.elevenlabs.io for connect-src and www.openstreetmap.org for frame-src. This fix restored the functionality of both the voice agent and the map iframe, which are critical for enhancing user experience on the platform.

In terms of time spent, I dedicated about an hour to these fixes, and while it felt like a relatively short duration, the impact was substantial. This experience reinforced the importance of maintaining a flexible and responsive approach to error handling in a complex system like mine. Each fix not only addressed an immediate pain point but also contributed to the overall health of the project as I continue to build this one-man show toward a billion-dollar valuation.

Working solo with AI assistance has its challenges, but it also allows for a unique focus on solving problems without the distractions that often come with larger teams. The collaborative nature of coding with Claude Code in VS Code has been invaluable, especially when diagnosing these issues. The AI acts as a sounding board and a second pair of eyes, which can make a significant difference when tackling intricate problems. It’s a reminder that while I’m building this alone, I’m not really alone in the process.

As I reflect on today’s work, I’m proud of the progress made, knowing that every fix is a step closer to a seamless agentic web experience. I’m also reminded of the importance of thorough testing and monitoring, especially when deploying changes that could impact the entire platform. It’s all part of the grind, and I’m committed to navigating these challenges as I strive to create a superior product that stands out in the market. With every bug tackled and every feature refined, I’m building not just a platform but a legacy of innovation in the AI space.

← Back to the full build journal