Unofficial Telegram integration for the Windows Codex app: real-time message sync, Codex app commands, runtime approval handling, and an official-app patch/re-register workflow through a locally patched and re-registered copy.
Features | Release 0.2.2 | Windows Official Setup | Bot Setup | Commands | Security
This repository contains the patch source, workflow scripts, and setup docs for a Telegram-driven Codex workflow on Windows. It does not include OpenAI binaries, extracted bundles, rebuilt app.asar, or runtime secrets.
- install the official Microsoft Store Codex app
- confirm the official app works before patching
- extract that installed package into a local ignored workspace
- inject the Telegram runtime into the extracted bundle
- rebuild
app.asar - update executable integrity metadata for the local package copy
- re-register the local
OpenAI.Codexpackage copy and launch it - use Telegram for real-time Codex message sync, control commands, and approval handling
The active maintained line is the v30 Telegram feature set, rebased onto newer official Codex builds.
Kept features:
- Telegram real-time message sync
- Telegram image/document staging into Codex
- Codex app native control commands
- Telegram approval handling
- session binding and replay behavior
- official Store extract/patch/re-register workflow
- Read docs/TELEGRAM_BOT_SETUP.md and create your bot.
- Create your local config from examples/telegram-native.example.json:
New-Item -ItemType Directory -Force "$env:APPDATA\\Codex" | Out-Null
Copy-Item .\examples\telegram-native.example.json "$env:APPDATA\\Codex\\telegram-native.json"- Install dependencies:
npm install-
Sign into the official Codex app first and make sure a normal Codex chat works.
-
Prepare the patched official-app workspace from the currently installed Microsoft Store package:
npm run official:update- Replace the live app with the freshly prepared local package:
npm run official:redeploy- If the Microsoft Store update path is blocked by the currently registered local package, run the recovery flow instead:
npm run official:recover-store/codex_newopens the real native new-thread flow.- The first Telegram message after
/codex_newcreates the real thread and auto-binds the returned session id. /codex_sessionbinds a Telegram chat to a Codex session and submits follow-up text through the app-native path./codex_sessionreplays the latest 5 instruction/result groups./codex_model,/codex_fast,/codex_reasoning,/codex_permission, and/codex_currentuse app-native control or state paths.- runtime approval prompts are relayed into Telegram with approve or reject actions.
- Telegram images are staged locally and sent through the app-native local-image input path.
- patch/telegram-native.js
- scripts/inject_native_telegram.mjs
- scripts/rebuild_patched_asar.mjs
- scripts/update_asar_integrity.mjs
- scripts/prepare_official_app_workspace.ps1
- scripts/run_official_telegram_update.ps1
- scripts/redeploy_updated_official_telegram.ps1
- scripts/recover_official_store_then_repatch.ps1
- examples/telegram-native.example.json
Publishable:
patch/scripts/docs/examples/README.mdpackage.jsonpackage-lock.json.gitignore
Local-only:
%APPDATA%\Codex\telegram-native.json- runtime state such as
chat_bindings.jsonandchat_settings.json work/tasks/
Run the publish check before every commit or push:
powershell -ExecutionPolicy Bypass -File .\scripts\prepublish_secret_check.ps1