This page is for a new user who wants to answer one simple question:
How do I connect this repo to a local Codex session and start talking to that session from Telegram anywhere?
Use the base bridge first. It is the main supported path. Treat live /call as a second-stage, experimental feature.
“Point Codex at it” means:
- clone the repo locally
- open that folder in Codex Desktop
- let Codex inspect the repo from inside that workspace
- run
bridge:claimfrom the exact Codex Desktop session you want Telegram to inherit
flowchart TD
CLONE["Clone repo locally"] --> OPEN["Open repo in Codex Desktop"]
OPEN --> ASK["Ask Codex to help with setup"]
ASK --> FILES["Create .env and bridge.config.toml from examples"]
FILES --> BOT["Configure Telegram bot and discover authorized chat id"]
BOT --> CLAIM["Run bridge:claim from this Codex Desktop session"]
CLAIM --> DAEMON["Start telegram-daemon"]
DAEMON --> TALK["Talk to this Codex session from Telegram"]
Good first prompt inside Codex Desktop:
Help me set up the base Telegram bridge in this repo. Check what already exists and tell me the next step without asking me to paste secrets into chat.
After the base bridge is ready, Telegram becomes a front door into the bound Codex Desktop session you already use locally.
sequenceDiagram
participant User as You in Telegram
participant Bot as telegram-daemon
participant State as BridgeState
participant Codex as Bound Codex Desktop thread
User->>Bot: text, file, photo, or voice note
Bot->>State: queue and stage inputs
State-->>Bot: attachment paths / queued task
Bot->>Codex: continue the bound thread with staged inputs
Codex-->>Bot: answer and saved artifact paths
Bot->>User: Telegram reply, files, images, or audio
What this means in practice:
- if you send plain text, Telegram continues the bound Codex thread
- if you send a file or photo, the bridge stages it locally before Codex sees it
- if Codex creates a file and names the saved path clearly, the bridge can send it back to Telegram
- if you ask for audio or images, bridge-managed providers can deliver those back to Telegram too
Live /call is not required for the main product flow. It is an optional Mini App path for a live voice session when chat is too slow.
flowchart LR
ARM["Operator runs bridge:ctl -- call arm"] --> BUTTON["/call in Telegram shows launch button"]
BUTTON --> MINI["Telegram Mini App opens"]
MINI --> GATE["realtime-gateway verifies launch + Telegram auth"]
GATE --> RT["OpenAI Realtime session"]
RT --> HANDOFF["Call transcript and summary artifact"]
HANDOFF --> CODEX["Bound Codex thread receives handoff"]
Use /call only after:
- the base bridge is already working
npm run start:gatewayis runningnpm run bridge:capabilitiesshows the realtime prerequisites are presentnpm run bridge:ctl -- call armsucceeds
The fallback lane is for safe, non-mutating Telegram work when the bound desktop Codex thread is already busy. It uses a separate bridge-owned autonomous Codex app-server thread and stays disabled unless explicitly enabled.
flowchart LR
BUSY["Bound desktop turn is busy"] --> POLICY["Fallback policy checks task"]
POLICY --> SAFE["Safe non-mutating work"]
POLICY --> PRIMARY["Repo edits, secrets, terminal, desktop, git, installs stay primary"]
SAFE --> FALLBACK["Fallback Codex thread answers"]
FALLBACK --> TELEGRAM["Reply returns to Telegram"]
Safe-lane posture:
bridge.fallback_lane.routing = "when_desktop_busy_safe"bridge.fallback_lane.allow_workspace_writes = false/fallback statusinspects the lane/fallback enableis explicit and reversible with/fallback disable
The terminal lane is for explicit /terminal work and extra Codex capacity. Start with the safe tmux lane before considering stronger powers. Telegram uses it only after /terminal ask ... or /terminal chat on.
flowchart LR
ASK["User asks Codex for safe tmux lane"] --> CHECK["Codex checks tmux + current config"]
CHECK --> ENABLE["Set terminal_lane.enabled = true"]
ENABLE --> CAP["Run bridge:capabilities"]
CAP --> INIT["terminal init starts bridge-owned tmux"]
INIT --> STATUS["terminal status verifies gates and lock"]
STATUS --> ATTACH["Operator attaches with tmux"]
STATUS --> CHAT["Optional /terminal chat on"]
Safe-lane posture:
terminal_lane.backend = "tmux"terminal_lane.profile = "public-safe"terminal_lane.sandbox = "read-only"terminal_lane.approval_policy = "never"terminal_lane.model = "gpt-5.5"terminal_lane.reasoning_effort = "low"terminal_lane.web_search = trueterminal_lane.daemon_owned = trueterminal_lane.allow_user_owned_sessions = falseterminal_lane.allow_terminal_control = false
Terminal chat mode routes normal text/document and safe web-research work to the verified lane, but native media, image generation, live calls, and desktop-control requests stay on the primary bridge path.
Ask Codex for unlock terminal superpowers in this repo only when you deliberately want write-capable tmux or user-owned iTerm2, Terminal.app, or existing-pane adoption.
The shortest successful path is:
- clone the repo
- open it in Codex Desktop
- ask Codex to guide setup
- create the bot and add
TELEGRAM_BOT_TOKEN - run
npm run telegram:configure - send
/startto the bot - run
npm run telegram:discover - set
telegram.authorized_chat_id - run
npm run bridge:claimfrom the intended Codex Desktop session - run
npm run start:telegram - run
npm run bridge:capabilities - send a normal Telegram message and confirm Codex replies
Once that works, then consider /call or the optional safe tmux lane.