fix(telegram): warn on docker-only media paths

This commit is contained in:
helix4u 2026-04-08 21:13:28 -06:00 committed by kshitij
parent b668c09ab2
commit 588333908c
7 changed files with 146 additions and 3 deletions

View file

@ -257,7 +257,7 @@ terminal:
docker_volumes:
- "/home/user/projects:/workspace/projects" # Read-write (default)
- "/home/user/datasets:/data:ro" # Read-only
- "/home/user/outputs:/outputs" # Agent writes, you read
- "/home/user/.hermes/cache/documents:/output" # Gateway-visible exports
```
This is useful for:
@ -265,6 +265,22 @@ This is useful for:
- **Receiving files** from the agent (generated code, reports, exports)
- **Shared workspaces** where both you and the agent access the same files
If you use a messaging gateway and want the agent to send generated files via
`MEDIA:/...`, prefer a dedicated host-visible export mount such as
`/home/user/.hermes/cache/documents:/output`.
- Write files inside Docker to `/output/...`
- Emit the **host path** in `MEDIA:`, for example:
`MEDIA:/home/user/.hermes/cache/documents/report.txt`
- Do **not** emit `/workspace/...` or `/output/...` unless that exact path also
exists for the gateway process on the host
:::warning
YAML duplicate keys silently override earlier ones. If you already have a
`docker_volumes:` block, merge new mounts into the same list instead of adding
another `docker_volumes:` key later in the file.
:::
Can also be set via environment variable: `TERMINAL_DOCKER_VOLUMES='["/host:/container"]'` (JSON array).
### Docker Credential Forwarding

View file

@ -112,6 +112,38 @@ hermes gateway
The bot should come online within seconds. Send it a message on Telegram to verify.
## Sending Generated Files from Docker-backed Terminals
If your terminal backend is `docker`, keep in mind that Telegram attachments are
sent by the **gateway process**, not from inside the container. That means the
final `MEDIA:/...` path must be readable on the host where the gateway is
running.
Common pitfall:
- the agent writes a file inside Docker to `/workspace/report.txt`
- the model emits `MEDIA:/workspace/report.txt`
- Telegram delivery fails because `/workspace/report.txt` only exists inside the
container, not on the host
Recommended pattern:
```yaml
terminal:
backend: docker
docker_volumes:
- "/home/user/.hermes/cache/documents:/output"
```
Then:
- write files inside Docker to `/output/...`
- emit the **host-visible** path in `MEDIA:`, for example:
`MEDIA:/home/user/.hermes/cache/documents/report.txt`
If you already have a `docker_volumes:` section, add the new mount to the same
list. YAML duplicate keys silently override earlier ones.
## Webhook Mode
By default, Hermes connects to Telegram using **long polling** — the gateway makes outbound requests to Telegram's servers to fetch new updates. This works well for local and always-on deployments.