From 2a816e27a521392c9845987ed14e7d7ada08ead2 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 21 May 2026 13:58:32 +0000 Subject: [PATCH] Document container-visible photo paths --- .codex/skills/telegram-photo/SKILL.md | 6 ++++-- .env.example | 3 +++ README.md | 3 ++- docker-compose.yml | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.codex/skills/telegram-photo/SKILL.md b/.codex/skills/telegram-photo/SKILL.md index 8eda7c5..7a90cee 100644 --- a/.codex/skills/telegram-photo/SKILL.md +++ b/.codex/skills/telegram-photo/SKILL.md @@ -14,9 +14,11 @@ Use exactly one directive line per image, outside code fences: `` Rules: -- Replace `` with an absolute path that exists in the current workspace or another location visible to the bot process. +- Replace `` with an absolute path that the bot container can read. +- The source image may live anywhere on the host, but the bot runs in Docker; before emitting the directive, make sure the image is inside a workspace under the configured playground base directory or another path explicitly mounted into the bot container. +- If the image is outside container-visible paths, copy it into an appropriate workspace-local location first, then use the copied file's absolute path in the directive. - Do not hardcode machine-specific directories, user names, repository paths, or sample filenames in this skill. - Supported extensions are `.jpg`, `.jpeg`, `.png`, `.webp`, and `.gif`. - `caption` is optional and should be short; omit the `caption` field when no caption is needed. - Do not use external Telegram tool calls for this. -- If no usable image path is known, ask for the path or explain what local file is needed. +- If no usable container-visible image path is known, ask for the path or explain what local file is needed. diff --git a/.env.example b/.env.example index 1aab987..08e92d9 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,9 @@ HOST_UPLOAD_DIR= HOST_CODEX_HOME= CODEX_STATE_DB= +# Playground root is mounted at the same absolute path so workspace-local files are visible to the bot. +HOST_PLAYGROUND_DIR= + # Host-side SQLite directory mounted to /data in the container. DB_DIR=./data diff --git a/README.md b/README.md index 27c986f..e206f3d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Docker Compose runs only the Go Telegram bot. Codex runs on the host through `co ## Setup -1. Copy `.env.example` to `.env` and set `TELEGRAM_BOT_TOKEN`, `HOST_CODEX_SOCKET`, and `HOST_UPLOAD_DIR`. +1. Copy `.env.example` to `.env` and set `TELEGRAM_BOT_TOKEN`, `HOST_CODEX_SOCKET`, `HOST_CODEX_RUN_DIR`, `HOST_UPLOAD_DIR`, `HOST_CODEX_HOME`, and `HOST_PLAYGROUND_DIR`. 2. Start the host Codex app-server: ```sh @@ -46,4 +46,5 @@ Plain text continues the active Codex thread and creates one if needed. Telegram - `HOST_UPLOAD_DIR` must be the same absolute path inside the bot container and on the host so host Codex can read staged files. - `HOST_CODEX_SOCKET` must point to the host app-server socket. `HOST_CODEX_RUN_DIR` is mounted into the bot container at the same absolute path so socket recreation is visible without rebuilding. +- `HOST_PLAYGROUND_DIR` should point to the shared playground/workspace root mounted at the same absolute path, so assistant photo directives can reference workspace-local image files that the bot container can read. - Use long polling for the MVP; webhooks are not required. diff --git a/docker-compose.yml b/docker-compose.yml index 17104d3..fc4f911 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,3 +24,4 @@ services: - ${HOST_CODEX_RUN_DIR:?set HOST_CODEX_RUN_DIR}:${HOST_CODEX_RUN_DIR:?set HOST_CODEX_RUN_DIR} - ${HOST_UPLOAD_DIR:?set HOST_UPLOAD_DIR}:${HOST_UPLOAD_DIR:?set HOST_UPLOAD_DIR} - ${HOST_CODEX_HOME:?set HOST_CODEX_HOME}:${HOST_CODEX_HOME:?set HOST_CODEX_HOME} + - ${HOST_PLAYGROUND_DIR:?set HOST_PLAYGROUND_DIR}:${HOST_PLAYGROUND_DIR:?set HOST_PLAYGROUND_DIR}