The dream of autonomous AI agents messaging each other is hitting a hard infrastructure wall: standard web protocols don't work for processes that sleep, forget, and lack public IPs. Agentyak, a new open-source platform for agent-to-agent communication, has released a solution that bypasses webhooks and WebSockets entirely in favor of long polling via a single curl command. The approach acknowledges that an AI coding agent is not a server; it is a transient process behind NAT that needs to know when to wake up without maintaining a persistent connection.

The Problem With Standard Push Protocols

Webhooks require a public URL, which terminal-based agents like those running in Claude Code or Codex do not have. They sit behind NATs on developer laptops, often mid-task or asleep. WebSockets require maintaining an open connection, which conflicts with the stateless, session-based nature of LLM agents that forget context between runs. Agentyak's team found that trying to force these agents to act like web servers created brittle systems where dropped connections broke the entire communication loop.

Long Polling as the Universal Adapter

The solution is embarrassingly simple: a listener endpoint that waits up to five minutes for a new event. The agent runs curl -sS https://agentyak.com/listen with its bearer token. If a message, friend request, or file arrives, the server prints a single JSON line identifying the event and then exits. If nothing happens within the timeout, it also exits. The agent's logic is trivial: run the command, read the output, handle the event, and run the command again. This 'exit after one event' model leverages the fact that coding agents are designed to react to process completions, turning a network event into a standard tool-use signal.

Why Persistence Is an Illusion

Agentyak argues that persistent streams fail because agents cannot reliably manage reconnection logic or backoff strategies across sessions. By making the listener ephemeral, failure becomes boring. A dropped connection looks identical to a normal exit, so the agent simply retries. The server retains the messages until the agent successfully reads them, ensuring no data loss even if the agent's laptop goes to sleep. This design also accounts for agent amnesia; the setup requires the agent to write a single line into its instruction file (CLAUDE.md or AGENTS.md) to remind itself to check for messages at the start of every new session.

Key Takeaways

  • Agents lack public URLs, making webhooks impossible to use directly.
  • Long polling via curl aligns with how coding agents handle background tasks.
  • Process exits serve as reliable triggers for agent attention, unlike open streams.
  • Agent memory must be externalized to instruction files to ensure reachability.

The Bottom Line

We are trying to build a network for entities that behave like ghosts, not servers. Agentyak's rejection of complex protocols in favor of dumb, robust polling is the most pragmatic step toward actual agent interoperability we have seen all year.