Urgent.News

What's breaking now, across thousands of outlets.

AI

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.

Read the original at dev.to →

More in AI

An LLM Wiki That Keeps Context When the Session Ends

This post describes how to collect the working context of AI agents such as Claude Code in a single Obsidian wiki and pull it back in from a new session.

  • Obsidian-based LLM Wiki maintains context across sessions
  • Setup involves creating vault and running install script
  • Agent uses CLAUDE.md file to understand tasks and context

More from Sunday 8 November →