CODEX → TELEGRAM: CONTINUE ON THE CORRECT LOCAL COMPUTER

For Christopher
Create a NEW LOCAL Codex chat on <STUDIO_COMPUTER>. Opening the existing Office chat
from Studio does not change where it executes. Download the source/handoff ZIP
through this chat's file attachment link on Studio and attach that downloaded
file to the new local chat. A <OFFICE_USERPROFILE> path on Office is not a Studio path.
Do not run an Office absolute-path command or enter credentials in chat.

Paste this continuation request into the new LOCAL Studio chat:

Continue the user-wide Codex-to-Telegram integration using the attached source
handoff package. FIRST, before any write or installation, independently verify
your actual execution computer, Windows identity/profile, and Documents known
folder. Expected target evidence from my PowerShell is <STUDIO_COMPUTER>, profile
<USERPROFILE>, Documents <DOCUMENTS>. Stop if your executor is somewhere else.
All PowerShell commands you present to me must be SINGLE LINE.

The earlier chat started on my OFFICE PC, <OFFICE_COMPUTER> (User account), and retained
that executor when viewed from Studio. Source version 1.0.0 was installed and
tested on Office only. My physical attempt to launch its Office-path setup
command on Studio FAILED with CommandNotFoundException/ObjectNotFound, before
credential entry. Studio's known-folder-derived launcher does not exist.
This host mismatch is CONFIRMED. Preserve that failed physical evidence.

After confirming Studio execution, validate prerequisites READ ONLY: resolve
Studio's actual Python runtime (minimum 3.11 required by tomllib), version,
tkinter and sibling pythonw.exe, Windows DPAPI/ACL support, current Codex client
and its actual CODEX_HOME/config location. Runtime detection must not assume
Office's Python314 path or a User account. Do not automatically install Python
or alter system settings. The package contains Windows/Python standard-library
source, no credentials and no external Python dependencies. It was exercised
on Office's Python 3.14, not yet on Studio. Establish compatibility before install.

Review the provided Install.ps1 and register_user.py against the observed target
environment. Install.ps1 already uses the Windows Documents known folder and
resolves python.exe; validate that resolution is an actual compatible interpreter
and not an app execution alias. If Studio uses the py launcher or another runtime
location, adapt the reviewed installer only after direct prerequisite evidence.
Install user-wide under that account's Documents\Codex\Integrations\telegram-files,
with absolute detected runtime/source paths in its user-level MCP configuration.
Use the supported direct config.toml route. Preserve unrelated configuration,
comments, options, and source changes. Do not write a project-only MCP config.

The sender exposes telegram_status and telegram_send_file(path, caption).
It sends the one explicitly chosen file as a real Telegram document attachment,
to the pinned private chat. No recipient parameter, watchers, bidirectional agent,
remote-location detection, bulk sends, background polling, or bot-setting changes.
The user's existing bot is Maverick; obtain its exact expected @username locally
instead of guessing. Do not create another bot. Credentials are still pending.

Keep token entry exclusively in the masked local setup window. Never request a
token in chat, command arguments, environment variables, source, docs, logs or
history. The helper verifies getMe/getChat and displays bot/private-chat identity
for local confirmation, then encrypts token and pinned identity with current-user
DPAPI, stored in the restricted %USERPROFILE%\.codex\telegram-files-private
directory. It checks getWebhookInfo read-only, NEVER getUpdates, deleteWebhook,
setWebhook, or offset consumption. An existing Maverick receiver must be preserved.
If private numeric chat ID is unknown, determine a non-disruptive next step with
Christopher; do not assume it or consume an existing bot's updates.

Focused offline verification is test_telegram.py (17 tests passed on Office).
Cover actual Windows DPAPI/ACL, masked UI, file locking, upload bytes, identity
mismatch, pinned recipient, private-store denial, error redaction, no retry,
stdio discovery in two isolated project contexts, and direct config preservation.
Perform relevant tests in Studio's observed environment before credential entry.
Then verify user-wide discovery from two separate Studio project contexts using
disposable fixtures, without modifying unrelated projects. Office discovery does
not establish Studio availability. Do not create chats without my instruction;
the earlier agent used standalone app-server processes without creating chats.

IMPORTANT CONFIGURATION CAVEAT: Office's initial codex mcp add registration passed,
but an independent before/after comparison flagged an unrelated parsed difference.
The initial snapshot was not retained; the exact delta cannot now be recovered.
Do not claim it was preserved. OpenAI source shows CLI add rewrites the whole
MCP map; normalization is INFERRED, not confirmed, as the explanation. Later
registration switched to a targeted direct-config helper; its byte-preservation,
repeatability and conflict tests pass, and subsequent Office rechecks left current
configuration unchanged. Do not guess at restoring Office settings from Studio.

Keep the original evidence and actual process/decisions/reasons current for my
later article/tutorial. The MAIN tutorial focuses on connecting Codex and sending
files across projects. BotFather creation instructions remain OPTIONAL ADDENDUM.
Use placeholders for private details and do not claim unobserved success.
The new package includes the current tutorial and verification history; preserve
the original failed candidate rather than rewriting it as a successful attempt.

After Studio installation and secure entry, use the included harmless
sample-delivery.txt (marker CODEX-TELEGRAM-LOCAL-2026-11-01). Verify actual bot/chat
identity before upload. Telegram API acceptance and message ID are not physical
acceptance. Setup, live sending and cross-project Studio availability remain OPEN
until established. I must confirm receiving/downloading/opening the attachment.
No real credential has been entered and no file has been sent at this handoff.

Package contents and provenance
telegram-files/ contains the previously verified source, installer, focused tests,
sample and current process/evidence documents. Production source was not changed
to guess a Studio runtime. This is a SOURCE HANDOFF, not a deployed correction.
The package does not upload/publish a plugin or Site and creates no new bot.
The original Office ZIP remains preserved as the failed-handoff candidate.

Original failed candidate ZIP SHA-256:
B61922173E54C4D0B1717874796809F274AAA4E456E171EE710DEC9175BA25CC
Office sample SHA-256:
d5746630f6243ea2dedfed407b6a07574d004468fa48e4492dd2c97930d430d7

Original official guidance consulted (re-check if the target client differs):
https://developers.openai.com/codex/mcp
https://core.telegram.org/bots/api
https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata
