-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Title: Gateway regenerates service-env file on every restart, wiping Telegram bot tokens (and other secrets) with placeholder values #98107
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Bug type
Crash (process/app exits or hangs)
Beta release blocker
No
Summary
Environment: macOS 26.5.1 (arm64), OpenClaw 2026.6.10, LaunchAgent service install, npm-managed CLI/gateway
. Every time the gateway restarts (openclaw gateway restart, launchctl kickstart, or after openclaw update), the file ~/.openclaw/service-env/ai.openclaw.gateway.env is regenerated and resets TELEGRAM_DEFAULT_BOTTOKEN and TELEGRAM_HERMES_BOTTOKEN to their placeholder values (your-real-telegram-default-token-here), even though OPENCLAW_SERVICE_MANAGED_ENV_KEYS only lists OPENROUTER_API_KEY. This causes the Telegram channel to fail immediately on every restart with Call to 'deleteWebhook' failed! (404: Not Found), since the bot token is invalid I ran openclaw secrets configure to map channels.telegram.accounts.default.botToken and hermes-default.botToken to source: env references (TELEGRAM_DEFAULT_BOTTOKEN / TELEGRAM_HERMES_BOTTOKEN), expecting this to persist the values, but the underlying service-env file is still wiped on restart regardless.
Steps to reproduce
Expected behavior
xpected: Either these tokens should be included in OPENCLAW_SERVICE_MANAGED_ENV_KEYS so they’re preserved across regeneration, or openclaw secrets configure should actually persist the secret value somewhere durable (e.g. Keychain) rather than only updating the config reference.
Actual behavior
Actual: TELEGRAM_DEFAULT_BOTTOKEN and TELEGRAM_HERMES_BOTTOKEN are reset to placeholder strings (your-real-telegram-default-token-here), even though OPENCLAW_SERVICE_MANAGED_ENV_KEYS in that same file only lists OPENROUTER_API_KEY as managed. Telegram then fails to start with Call to 'deleteWebhook' failed! (404: Not Found) because the token is invalid.
OpenClaw version
2026.6.10
Operating system
mac 26.5.1
Install method
mac app
Model
openrouter/ gemini 2.5 flash
Provider / routing chain
openclaw
Additional provider/model setup details
No response
Logs
Screenshots, recordings, and evidence
No response
Impact and severity
No response
Additional information
Current workaround: Maintaining tokens in a separate file and manually re-injecting them into service-env before every restart.