feat(telegram): add monitor service wrapper#1106
Merged
Merged
Conversation
4ebfbf4 to
e9cf3ae
Compare
- what changed: add opt-in telegram-user monitor-service lifecycle commands around monitor-poll --watch for launchd/systemd - why: durable Telegram-as-me waits need a supervised local watcher path after foreground polling is proven - behavior/risk: no service was installed in this lane; Windows service install remains foreground/supervisor-only and hook auth uses service environment instead of process arguments
e9cf3ae to
9535303
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review Fast Path
monitor-poll --watchservice path after foreground polling is proven.tsgo,format:check,git diff --check,build, built CLI smoke, andcodex review --base origin/mainall passed.OPENCLAW_GATEWAY_TOKEN.Summary
telegram-user monitor-poll --watchworked, but durable waits had no repo-owned supervised service wrapper.openclaw telegram-user monitor-service status|install|restart|stop|uninstallfor macOS launchd and Linux systemd.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Adds:
openclaw telegram-user monitor-service statusopenclaw telegram-user monitor-service installopenclaw telegram-user monitor-service restartopenclaw telegram-user monitor-service stopopenclaw telegram-user monitor-service uninstallThe service runs the existing
telegram-user monitor-poll --watchpath. It is opt-in and profile-scoped.Security Impact (required)
Yes) Installs a per-user launchd/systemd service only when explicitly requested.Yes)OPENCLAW_GATEWAY_TOKENcan be persisted in the service environment instead of command args; status JSON redacts it.No) Uses the existing local hook dispatch path.Yes) Adds lifecycle CLI commands for the Telegram monitor service.No) Reuses existing Telegram monitor-poll stores and Telegram read path.Yes, explain risk + mitigation: hook URLs are validated as local and target/telegram-user-monitor-event; service identities are profile-scoped; no valid service install was run in this lane.Repro + Verification
Environment
plugins.entries.voice-callwarnings during CLI smokeSteps
codex review --base origin/main.Expected
Actual
Evidence
Human Verification (required)
npx -y pnpm@10.23.0 vitest run src/cli/telegram-user-monitor-service.test.ts src/daemon/telegram-monitor-service.test.ts src/daemon/service-env.test.ts src/daemon/launchd.test.ts src/daemon/systemd.test.ts src/cli/telegram-user-cli.test.ts src/cli/node-cli/register.test.ts src/cli/daemon-cli/lifecycle-core.test.ts src/commands/telegram-user.test.ts src/commands/telegram-monitor-service-install-helpers.test.ts src/telegram-user/monitor-listener.test.ts src/telegram-user/monitor-event.test.ts src/monitor/event-router.test.ts src/gateway/server.hooks.test.ts src/gateway/server-methods/monitor.test.ts src/agents/tools/monitor-tool.test.ts src/agents/tools/goal-tools.test.ts src/config/sessions/goals.test.tsnpx -y pnpm@10.23.0 tsgonpx -y pnpm@10.23.0 format:checkgit diff --checknpx -y pnpm@10.23.0 buildmonitor-service --help, parent help, default/profile status JSON, invalid poll interval, invalid remote hook URL, and token redaction.codex review --base origin/mainpassed after fixing a status/config-port drift finding.startcommand, token not in command args/status JSON, non-gateway launchd restart skips gateway stale-pid cleanup.Review Conversations
Compatibility / Migration
Yes)Yes) Service install may persistOPENCLAW_GATEWAY_TOKEN;OPENCLAW_NO_RESPAWN=1is set for the monitor service.No)Failure Recovery (if this breaks)
openclaw telegram-user monitor-service stoporopenclaw telegram-user monitor-service uninstall; revert this commit if the CLI surface itself is bad.Risks and Mitigations
filterDaemonEnv.AI Assistance