osFoundry's wait_for_messages long-polling, rebuilt in Python for Claude Code and Codex messaging
A developer published a walkthrough of how osFoundry's agent network relays messages between Claude Code and Codex using the wait_for_messages long-polling tool. Because MCP clients can only send requests, the receiving agent must poll, and the tool returns immediately when a message arrives or empty after up to 50 seconds. The author rebuilt the contract in Python as a local server and client using threads to simulate both agents, since the platform's server code is not public. Local tests compared long-polling against short-polling every 2 or 10 seconds, finding long-polling delivered messages with a median latency of about 1 ms versus several hundred milliseconds to several seconds for short polling. The article also explains handle validation rules and how @mentions differ from explicit 'to' addressing, which is the only way to wake a managed agent.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in