Repository navigation
fix: keep Telegram automations tied to their owner and account - #201008
Conversation
OpenClaw-Publication: 5ac54850-8838-4d25-8e37-f09f8d90e200
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesPreserves a Telegram owner's authenticated requester and channel origin when creating or reauthorizing account-bound automations. Example: A verified Telegram owner creates an automation from account work in a private-chat topic.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current automation-creation defect, resolves the three earlier findings, and introduces no identified code or security defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherChannel ingress authenticates the sender, reply execution carries that authority into automation grants, and the Gateway persists provenance that scheduled execution and repair consume. flowchart LR
A[Telegram owner message] --> B[Verified host ingress]
B --> C[Reply requester capture]
C --> D[Gateway automation grant]
D --> E[Stored job provenance]
E --> F[Scheduled execution]
E --> G[Owner repair turn]
Technical reviewBest possible solution: Retain the existing grant and scheduler owners, capture verified Telegram provenance at creation, and reauthorize legacy jobs explicitly from their original conversation. Do we have a high-confidence way to reproduce the issue? Current-main source shows the missing external creation origin and Discord-only requester capture; no target code was executed during this read-only review. Is this the best way to solve the issue? The fix addresses the provenance producer, reuses existing normalization and grant validation, preserves Discord behavior, and adds no competing storage or authorization owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 74e5127c0c3d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +58, Tests +463, Other +2. Total +523 across 14 files. Added test files: 3. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 18, 2026, 2:55 AM ET / 07:55 UTC (Revision 2). |
OpenClaw-Publication: a873b056-74de-4978-a40d-2926bbd40bee
OpenClaw-Publication: 08149ece-55ef-4a22-a4e9-ea576d5316f5
OpenClaw-Publication: aca5fd31-3be8-4bf9-b3c2-df98ef752425
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Problem: an automation created from a channel chat must remember who created it and on which account, so each run can check that owner. #201008 fixed this for Telegram with a Telegram-specific branch next to an older Discord-specific path; other channels (Slack, WhatsApp, ...) still saved no creator, and core code branched on channel names. Fix: the creator comes from the owner identity that the shared channel ingress already verified (`channelPrincipal`, added in #201008), for every channel. The `discord`/`telegram` branches and the configured-owner fallback are removed. Missing, mismatched, revoked or unverified owner authority still cannot establish ownership. User impact: automations created by a verified channel owner on any channel keep their creator and account, so their runs pass the account check. A sender recognized as owner only by config/alias matching, without a verified ingress identity, no longer creates automations as owner. Proof: Slack host-ingress capture (default and work accounts) and persisted origin/requester integration fail on base and pass on head; existing Telegram and Discord cases pass. Builds on Vincent Koc's #201008. Co-authored-by: Ayaan Zaidi <[email protected]>
…law#201008) * fix: preserve account context for channel-owner automations * fix: retain Telegram automation requester identity * fix: require host-bound Telegram automation owner * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: 5ac54850-8838-4d25-8e37-f09f8d90e200 * fix: correct scheduled authority validation * fix: limit scheduled origin capture to channel owners * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: a873b056-74de-4978-a40d-2926bbd40bee * test: bind scheduled account reload to config source * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: 08149ece-55ef-4a22-a4e9-ea576d5316f5 * test: allocate scheduled owner regression coverage * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: aca5fd31-3be8-4bf9-b3c2-df98ef752425
…201159) Problem: an automation created from a channel chat must remember who created it and on which account, so each run can check that owner. openclaw#201008 fixed this for Telegram with a Telegram-specific branch next to an older Discord-specific path; other channels (Slack, WhatsApp, ...) still saved no creator, and core code branched on channel names. Fix: the creator comes from the owner identity that the shared channel ingress already verified (`channelPrincipal`, added in openclaw#201008), for every channel. The `discord`/`telegram` branches and the configured-owner fallback are removed. Missing, mismatched, revoked or unverified owner authority still cannot establish ownership. User impact: automations created by a verified channel owner on any channel keep their creator and account, so their runs pass the account check. A sender recognized as owner only by config/alias matching, without a verified ingress identity, no longer creates automations as owner. Proof: Slack host-ingress capture (default and work accounts) and persisted origin/requester integration fail on base and pass on head; existing Telegram and Discord cases pass. Builds on Vincent Koc's openclaw#201008. Co-authored-by: Ayaan Zaidi <[email protected]>
* fix: preserve account context for channel-owner automations * fix: retain Telegram automation requester identity * fix: require host-bound Telegram automation owner * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: 5ac54850-8838-4d25-8e37-f09f8d90e200 * fix: correct scheduled authority validation * fix: limit scheduled origin capture to channel owners * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: a873b056-74de-4978-a40d-2926bbd40bee * test: bind scheduled account reload to config source * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: 08149ece-55ef-4a22-a4e9-ea576d5316f5 * test: allocate scheduled owner regression coverage * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: aca5fd31-3be8-4bf9-b3c2-df98ef752425 (cherry picked from commit febe293) Co-authored-by: RomneyDa <[email protected]>
Problem: an automation created from a channel chat must remember who created it and on which account, so each run can check that owner. #201008 fixed this for Telegram with a Telegram-specific branch next to an older Discord-specific path; other channels (Slack, WhatsApp, ...) still saved no creator, and core code branched on channel names. Fix: the creator comes from the owner identity that the shared channel ingress already verified (`channelPrincipal`, added in #201008), for every channel. The `discord`/`telegram` branches and the configured-owner fallback are removed. Missing, mismatched, revoked or unverified owner authority still cannot establish ownership. User impact: automations created by a verified channel owner on any channel keep their creator and account, so their runs pass the account check. A sender recognized as owner only by config/alias matching, without a verified ingress identity, no longer creates automations as owner. Proof: Slack host-ingress capture (default and work accounts) and persisted origin/requester integration fail on base and pass on head; existing Telegram and Discord cases pass. Builds on Vincent Koc's #201008. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 00be7d5) Co-authored-by: RomneyDa <[email protected]>
…law#201008) * fix: preserve account context for channel-owner automations * fix: retain Telegram automation requester identity * fix: require host-bound Telegram automation owner * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: 5ac54850-8838-4d25-8e37-f09f8d90e200 * fix: correct scheduled authority validation * fix: limit scheduled origin capture to channel owners * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: a873b056-74de-4978-a40d-2926bbd40bee * test: bind scheduled account reload to config source * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: 08149ece-55ef-4a22-a4e9-ea576d5316f5 * test: allocate scheduled owner regression coverage * fix: keep Telegram automations tied to their owner and account OpenClaw-Publication: aca5fd31-3be8-4bf9-b3c2-df98ef752425 Release adaptation: Split coherent23/41 preparation: host-verified immutable principal producer and shared ingress fixture; row41 consumes it next. No broadened grants. (cherry picked from commit febe293) Co-authored-by: RomneyDa <[email protected]>
…201159) Problem: an automation created from a channel chat must remember who created it and on which account, so each run can check that owner. openclaw#201008 fixed this for Telegram with a Telegram-specific branch next to an older Discord-specific path; other channels (Slack, WhatsApp, ...) still saved no creator, and core code branched on channel names. Fix: the creator comes from the owner identity that the shared channel ingress already verified (`channelPrincipal`, added in openclaw#201008), for every channel. The `discord`/`telegram` branches and the configured-owner fallback are removed. Missing, mismatched, revoked or unverified owner authority still cannot establish ownership. User impact: automations created by a verified channel owner on any channel keep their creator and account, so their runs pass the account check. A sender recognized as owner only by config/alias matching, without a verified ingress identity, no longer creates automations as owner. Proof: Slack host-ingress capture (default and work accounts) and persisted origin/requester integration fail on base and pass on head; existing Telegram and Discord cases pass. Builds on Vincent Koc's openclaw#201008. Co-authored-by: Ayaan Zaidi <[email protected]> Release adaptation: Split coherent23/41 preparation: retained native-account factory, caller and real ingress/queue tests consume preceding principal producer. (cherry picked from commit 00be7d5) Co-authored-by: RomneyDa <[email protected]>
Related: #186008
What Problem This Solves
An automation scheduled from a Telegram private chat can fail every run with
Scheduled account "<name>" is unavailableeven though that bot account is configured and still chatting normally. The job was saved without the record that it came from Telegram, so the scheduler had no channel to check the account against. A later repair turn could also lose the identity of the owner who authorized the job.User Impact
Automations created by a Telegram owner keep their Telegram account context and authenticated requester, so they run and can be repaired. An owner can reauthorize an existing job in its original Telegram conversation while keeping its current tool list.
Jobs saved before this change are not migrated. Each one needs a single reauthorization from its original conversation; until then it still reports the account as unavailable.
Why This Change Was Made
The creation grant passed through only local origins, so an authenticated channel owner's external origin was dropped, and the native requester was captured for Discord only. The grant now carries the origin for channel owners, and the Telegram requester comes from the identity that channel ingress already verified and bound to the current owner authority. A missing, mismatched, or revoked grant cannot establish ownership.
Not in this change: other channels keep their origin but still do not capture a native requester, and the scheduler's "account unavailable" wording for a job with no saved origin is unchanged. Both are follow-ups.
Evidence
Incident. On one deployment, 25 runs across 10 automations created from Telegram private-chat topics failed with this error over six days while the same account kept delivering chat. The affected jobs carried an account policy but no saved origin, and a private-chat session key names no channel.
Regression coverage. The Gateway integration test creates a job through the automation tool from a private-chat thread session, reloads it, and proves the saved origin and requester, the owner recheck on repair (including revocation and a non-owner), scheduled trigger evaluation, and rejection once the account is removed.
Exact-head CI. Run 44261389865 (attempt 1) tested
210fb959c8e5da0de4dc32c6d1502912dda78319merged into main atee3f5a72fb. The five test files this PR adds or changes passed with no failures, andsecurity-fastpassed. Nine jobs and the aggregate gate failed, none in code this PR touches:check-prod-types,check-test-types,check-test-types-core-1to-5,check-additional-extension-package-boundarysrc/plugin-sdk/plugin-entry.ts, which imports type names main no longer exported at that commitchecks-node-changed-compact-small-34src/cli/program/register.onboard.test.tssrc/cli/The files behind both failures are byte-identical between that main commit and the tested merge. This PR is being landed with those failures attributed rather than green.
An earlier dispatch on the same head (run 44251963365) failed on different inherited jobs (stale exports, two UI e2e tests, the same onboarding test, one timeout) that did not recur.
The current-head native and hosted test-line ratchets passed exactly: 463 net regression lines = 400 default + 63 allocated. The allocation-only commit retains independent origin, owner, revocation, and account-removal regression coverage.
Local review. Autoreview, branch mode, merge base
f3707dafb9to head210fb959c8, priorities P0 through P2: scoped-clean, no findings. The reviewer had the diff only; it did not have unchanged implementation context and did not execute tests.Live. Telegram creation and retrieval passed with exactly six allowed tools, the caller origin, and the authenticated requester preserved. Offline legacy-job repair also passed update, retrieval, and removal with the same tool capabilities. Live reauthorization of a job saved before this change has not been run.