The world of AI development is evolving at a breakneck pace. What started for me as AI-assisted development has rapidly transitioned to an AI-led approach, especially when tackling complex, low-level challenges. My recent journey into implementing web push notifications with Cloudflare Workers is a testament to this shift, highlighting both the power and the intricacies of this new paradigm.
The goal was seemingly straightforward: integrate web push notifications into a web app using the Web Push API, all while leveraging the efficiency of Cloudflare Workers. Little did I know, this endeavor would turn into a masterclass in advanced debugging and cryptographic implementation from scratch.
The initial hurdle was the lack of an “out-of-the-box” solution. Cloudflare Workers’ limited environment meant existing libraries often fell short. I explored several promising implementations, only to be met with a consistent roadblock: encryption library mismatches and a glaring lack of support for aes128gcm within the Worker’s runtime. This wasn’t a matter of tweaking a few lines; it required a fundamental understanding of how web push encryption works.
My first AI collaborator, Claude Sonnet 4.5, proved surprisingly reluctant to delve into the nitty-gritty of manually building aes128gcm support. It seemed to prefer higher-level abstractions. This is where the AI-led development truly began. I turned to Google Gemini 3.0, and its approach was a stark contrast. Gemini jumped directly into the problem, proactively developing the necessary cryptographic support specifically for the Cloudflare Workers environment. This was a truly remarkable display of problem-solving, going beyond mere code generation to address a missing fundamental capability.
Despite Gemini’s brilliant efforts, the solution still wasn’t fully functional. Hours were spent in a trial-and-error loop, testing various configurations and wrestling with subtle encryption nuances. This phase was a reminder that even with advanced AI, human expertise and persistent debugging remain crucial.
The breakthrough came when I fed the problematic code back to Claude. While hesitant to build the initial support, Claude’s analytical prowess shone brightly in the debugging phase. It immediately identified two critical issues that had eluded me:
- Push Message Record Size: The Web Push Protocol (RFC 8188) dictates that each push message record must be exactly 4096 bytes. My implementation had been subtly deviating from this, leading to decryption failures.
- Padding Delimiter: The padding delimiter within the encrypted payload was incorrectly set. This small but significant error was preventing the message from being correctly parsed.
Armed with these precise insights from Claude, I meticulously followed RFC 8188, adjusted the record size, and corrected the padding delimiter. And just like that, after days of intense struggle, the web push notifications finally began to flow seamlessly through Cloudflare Workers.
This experience wasn’t just about implementing a feature; it was a profound learning curve in AI development. It demonstrated how different AI models excel in different areas – one for generating novel solutions, another for pinpointing subtle bugs in complex specifications. It also highlighted the advanced level of development required for such tasks, where understanding and implementing cryptographic primitives from the ground up becomes a necessity. The journey from seeking AI assistance to letting AI lead the charge in solving seemingly impossible problems has been exhilarating, and I’m eager to see where this rapidly evolving partnership takes us next.

