From 0acdf3b346abe546ea647772a3c3d1fcf9be8a85 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 Aug 2026 14:09:10 +0000 Subject: [PATCH] fix: listener daemon read config from wrong HOME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enable_service baked Environment=HOME=$HOME into the unit at enable time; a stale/wrong shell HOME made the daemon read an empty ~/.config/linux_post_install/telegram_commands.env — commands showed in the bot menu (synced from the editor's correct HOME) but replying said "unknown command" and /help said none mapped. systemd user services already set the correct HOME; stop pinning it. --- DOC/AGENT_Context_Project.md | 2 +- bin/pos-communication-telegram-listener | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DOC/AGENT_Context_Project.md b/DOC/AGENT_Context_Project.md index 3c3c5bb..8451081 100644 --- a/DOC/AGENT_Context_Project.md +++ b/DOC/AGENT_Context_Project.md @@ -556,7 +556,7 @@ Use conventional prefixes: `feat:`, `fix:`, `docs:`, `refactor:`, `chore:` | `features/autostart.sh` | 14 | Boot-time feature (moved from `bin/`, flag-gated service) | | `bin/pos` | 272 | CLI dispatcher with smart arg matching + logging + category help | -| `bin/pos-communication-telegram-listener` | 509 | Telegram bot listener: map /command → bash, run them on chat messages | +| `bin/pos-communication-telegram-listener` | 511 | Telegram bot listener: map /command → bash, run them on chat messages | | `bin/pos-communication-telegram-sender` | 220 | Send Telegram messages/files/links/stickers via Bot API (send, test) | | `bin/pos-config` | 80 | Interactive editor for the tools' runtime config (reads # POS_CONFIG: registry) | | `bin/pos-docker-compose` | 366 | Docker Compose service manager (ls/up/down/restart/logs/update/config) | diff --git a/bin/pos-communication-telegram-listener b/bin/pos-communication-telegram-listener index 69509e0..8646e07 100755 --- a/bin/pos-communication-telegram-listener +++ b/bin/pos-communication-telegram-listener @@ -366,7 +366,9 @@ Type=simple ExecStart=$runner --run Restart=always RestartSec=5 -Environment=HOME=$HOME +# Do NOT pin Environment=HOME here — the systemd user manager already sets the +# correct HOME for the user; pinning a stale enable-time value made the daemon +# read ~/.config/... from the wrong home (menu shows commands, daemon says unknown). [Install] WantedBy=default.target