Skip to main content

Route chat channels to agent targets.

Project description

Relayforge

Relayforge routes chat channels to agent targets.

The first provider is Discord. The first targets are a Codex app-server binding and a Codex JSONL fallback inbox. The package is Python and PyPI-ready, with provider-neutral core types so Slack, WhatsApp, and other agent APIs can be added later.

Install

After the package is published:

pip install relayforge

The installed CLI command is relayforge.

Installed wheels add a small managed Relayforge block to:

  • ~/.codex/AGENTS.md
  • ~/.claude/CLAUDE.md

Set RELAYFORGE_SKIP_AGENT_GUIDES=1 before starting Python with the installed package on sys.path to skip this.

From this checkout:

python -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'

Configuration

{
  "channels": [
    {
      "name": "rohan-codex",
      "provider": "discord",
      "id": "1520170530148192466",
      "owner": "rohan"
    }
  ],
  "bindings": [
    {
      "name": "rohan-almanac-main",
      "source": "rohan-codex",
      "target": "codex-app-server",
      "codexThreadId": "replace-with-codex-thread-id",
      "cwd": "/Users/rohan/Desktop/Projects/almanac",
      "machine": "replace-with-hostname",
      "transport": "codex app-server --config mcp_servers={} --listen stdio://"
    }
  ],
  "routes": [
    {
      "channel": "rohan-codex",
      "target": "codex-jsonl",
      "inboxPath": ".relay/rohan-codex-inbox.jsonl"
    }
  ]
}

Each founder can use the same Discord bot token with a different named channel. A binding delivers to that founder's Codex thread on the right machine. A route keeps JSONL fallback delivery available when the direct target fails.

See docs/channels.md for the multi-founder pattern. See docs/research/codex-thread-routing-2026-06-26.md for the Codex thread binding direction.

Commands

export DISCORD_BOT_TOKEN=...

relayforge init --config relay.config.json
relayforge channel-set --name rohan-codex --provider discord --id 1520...
relayforge route-set --channel rohan-codex --target codex-jsonl --inbox-path .relay/rohan-codex-inbox.jsonl
relayforge binding-set --name rohan-almanac-main --source rohan-codex --target codex-app-server --codex-thread-id 019f... --cwd /Users/rohan/Desktop/Projects/almanac --transport "codex app-server --config mcp_servers={} --listen stdio://"
relayforge check --config relay.config.json
relayforge listen --config relay.config.json
relayforge listen --config relay.config.json --include-bots --max-messages 1 --timeout 20
relayforge check --config relay.config.json --json
relayforge channels --config relay.config.json
relayforge routes --config relay.config.json
relayforge bindings --config relay.config.json
relayforge codex-smoke --binding rohan-almanac-main --message "smoke test"
relayforge binding-send --binding rohan-almanac-main --message "reply in Discord"
relayforge send --channel rohan-codex --message "hello"
relayforge read --channel rohan-codex --limit 10
relayforge inbox --path .relay/rohan-codex-inbox.jsonl --limit 10
relayforge inbox --path .relay/rohan-codex-inbox.jsonl --cursor .relay/rohan.cursor.json --ack

Raw Discord channel IDs work for read and send even before a config file exists. Named channels require the config.

The listen command uses Discord Gateway events. That means Discord pushes new messages to this process instead of the process polling the channel.

By default, Discord bot-authored messages are ignored to avoid loops. Use --include-bots only for controlled smoke tests or deliberate bot-to-agent routing.

codex-smoke sends a synthetic message through a configured Codex app-server binding. Use it only with a rollout-backed Codex thread that is safe to receive a test turn.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

relayforge-0.1.0.tar.gz (83.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relayforge-0.1.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file relayforge-0.1.0.tar.gz.

File metadata

  • Download URL: relayforge-0.1.0.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for relayforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc2b71b84bfeb71db8871897e15bca899fe75b725898142e01a562b2865b8c9e
MD5 88d9b2be422e8f3db9fad52cf0b63f7f
BLAKE2b-256 4a71e0d23703c448a8541d4fb10c68eafe36d918b59f74652611c0dda3693057

See more details on using hashes here.

File details

Details for the file relayforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: relayforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for relayforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2663771b7efc4c9e19626b8b4b572d7355339df91d15c59203a2bd8cdf3714a
MD5 15acc75981b78ef17ac9d541058c3016
BLAKE2b-256 d2ab44be44fae13b8c99666afb5a668d94de5f657ffa2ca9b134326c7495ceb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page