Repository navigation
fix: migrate Telegram pairing allowFrom to default account only - #58165
Conversation
Greptile SummaryThis PR fixes a security over-copy issue in the legacy Telegram pairing
Confidence Score: 5/5This PR is safe to merge — the change is minimal, targeted, well-tested, and narrows (rather than expands) access. No P0 or P1 issues found. The migration logic is correct and idempotent, the removed No files require special attention.
|
| Filename | Overview |
|---|---|
| src/infra/state-migrations.ts | Removed listTelegramAccountIds import and replaced the fan-out copy-plan generation with a single plan targeting DEFAULT_ACCOUNT_ID. Logic is correct and idempotent. |
| src/infra/state-migrations.test.ts | Tests correctly updated to expect a single default copy plan, and now additionally assert that alpha and beta paths do NOT exist after migration. |
| src/commands/doctor-state-migrations.test.ts | Fan-out test updated to assert no copy to named bot accounts and verify only telegram-default-allowFrom.json is created; test name updated to reflect corrected behavior. |
Reviews (1): Last reviewed commit: "fix: migrate Telegram pairing allowFrom ..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 245a1be7df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dca9ada94c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e359faa4d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
* fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
…claw#58165) * fix: migrate Telegram pairing allowFrom to default account only * fix: address PR review feedback * fix: address PR review feedback
Summary
allowFrommigration fanned out the store to every configured named account, requiring a read of all Telegram account IDs at migration time.listTelegramAccountIdsand could over-copy the allowFrom store to accounts that may not need it, causing unintended access broadening.allowFromstore to only thedefaultaccount, removing the fan-out logic and thelistTelegramAccountIdsdependency.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
Regression Test Plan (if applicable)
src/infra/state-migrations.test.ts,src/commands/doctor-state-migrations.test.tsdefaultaccount path;alphaandbetaaccount paths do not receive a copy.User-visible / Behavior Changes
Users running
openclaw doctoron an instance with a legacy Telegram pairing allowFrom store will now migrate it to thedefaultaccount only, rather than to every configured named Telegram account.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: The change narrows the blast radius of the migration. No new access is granted; access to non-default named accounts is no longer auto-migrated.Repro + Verification
Environment
Steps
allowFromstore at the legacy pathopenclaw doctormigrationtelegram-default-allowFrom.jsonis createdExpected
telegram-default-allowFrom.jsoncreatedActual
telegram-<accountId>-allowFrom.jsoncreated for every configured accountEvidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations