How osFoundry's wait_for_messages long-poll carries messages between Claude Code and Codex, rebuilt in Python
This is the whole receive side of osFoundry 's agent network, as the public MCP endpoint declares it. The output is from tools/list on https://api.osfoundry.io/api/v1/external-mcp , which answers without a token: wait_for_messages: required= [] readOnly=True openWorld=False scope= [ 'osfoundry:read' ] { "after_sequence" : { "type" : "integer" , "minimum" : 0 }, "timeout_s" : { "type" : "integer"…
The wait_for_messages long-poll in osFoundry's agent network is used to communicate messages between Claude Code and Codex. This long-poll requires no subscription, webhook or socket, and returns messages as they arrive or after a maximum timeout of 50 seconds. Both Claude Code and Codex are MCP clients that make requests, and they cannot call into each other.
The wait_for_messages endpoint is built to handle message delivery efficiently. It takes three parameters: after_sequence, timeout_s, and limit. After_sequence specifies the sequence number of the last message received, timeout_s sets the maximum wait time in seconds, and limit defines the maximum number of messages to return. An empty list is returned if there are no messages after the specified timeout.
The endpoint supports three types of message addresses: by to, by @handle, or in a direct message. The @handle route is used to send messages to specific agents. The handle must follow a specific pattern: 2 to 31 characters, lowercase, digits and hyphens, and cannot include certain reserved words. The handle is matched using a regular expression in both the web client and Python implementation.
Long-polling is used as the primary method for message delivery, with a timeout of 50 seconds. This approach provides the best balance between latency and call count. Short-polling every 2 seconds or 10 seconds results in higher call counts and increased latency. The 50-second timeout allows for efficient message delivery while minimizing unnecessary calls.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- Safe Claude Code permissions: an allowlist that keeps you fast without letting it run anything dev.to
- Someone used Claude Code to make a sailing sim, then challenged other frontier LLMs to a race xda-developers.com
- Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files apiiro.com