Repository navigation
fix(doctor): stop reporting a fully configured Telegram setup as first-time setup - #124706
ggeutzzang wants to merge 2 commits into
Conversation
|
🦞👀 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: blocked before merge. Reviewed October 4, 2026, 12:14 AM ET / 04:14 UTC (Revision 16). ClawSweeper reviewWhat this changesThe PR repairs Doctor’s channel-account discovery and suppresses misleading Telegram setup guidance when every active account configures groups. Merge readiness⛔ Blocked before merge - 6 items remain Keep open: the reported bug remains on current main and the latest release, and this PR contains useful, demonstrated work. The prior P2 finding remains unfixed. Likely related people: vincentkoc and Peter Steinberger (routing candidates, medium confidence). Priority: P2 Review scores
Verification
How this fits togetherDoctor inspects channel configuration and plugin metadata to explain configuration problems to operators. Its shared account scanner supplies context to Telegram’s plugin-owned warning logic. flowchart TD
A[Channel configuration] --> B[Doctor inspection]
C[Plugin catalog and installed plugins] --> D[Account discovery]
B --> D
D --> E[Parent and account scope checks]
E --> F[Telegram setup guidance]
F --> G[Operator diagnostics]
Decision needed
Why: The additive contract preserves existing callbacks, but its permanent SDK shape needs owner acceptance that contributor assertions and previous bot recommendations cannot supply. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +69, Tests +270. Total +339 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use one environment-bound Doctor plugin lookup for account discovery and warnings, preserving callback invocation and genuine account-level guidance with an owner-approved parent context. Do we have a high-confidence way to reproduce the issue? Yes: the linked multi-account configuration and current-main parent warning path establish the false positive; the contributor also supplies real CLI before/after evidence. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Acceptable mitigation, but not yet the best complete fix: retain plugin-owned guidance and callback invocation while consolidating discovery and forwarding Doctor’s environment. Skipping the public callback would silently remove external-plugin diagnostics. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8a0b0c458bbd. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (15 earlier review cycles; latest 8 shown)
|
b545367 to
7a6cb23
Compare
CI status on
|
| Run | Duration | Outcome |
|---|---|---|
| 95202133949 | 9m50s | runner shutdown |
| 95203740315 | 6m15s | runner shutdown |
Both logs end the same way:
##[error]The runner has received a shutdown signal. This can happen when the runner
service is stopped, or a manually started runner is canceled.
[oxlint] FAILED (exit 143)
##[error]The operation was canceled.
143 is 128 + SIGTERM, so oxlint was terminated mid-run rather than reporting
violations.
Separately, pnpm lint does fail locally — but identically on main. Running
node --import tsx scripts/run-lint.mts on this branch reports:
extensions/cua-computer/src/mcp-driver-client.ts:89:62: error
typescript(no-redundant-type-constituents): 'ActionResult' is an 'error' type that acts
as 'any' and overrides all other types in this union type.
Checking out origin/main (3e0634f7ed9) and running the same command produces that
exact line, so it is pre-existing and untouched by this PR, which changes no file under
extensions/cua-computer/. Per CONTRIBUTING I have not tried to fix it here.
check-test-types passes on this head. It failed on the first push because of my own
test typing (vi.fn(() => []) inferring a zero-arg signature, so mock.calls
destructuring broke); that is fixed in 7a6cb23a35a.
I do not have rerun permissions on this run. Happy to push a rebase if a fresh CI run
would help.
7a6cb23 to
871da6c
Compare
Reworked to avoid the plugin SDK contract changeThe previous head added an optional That turned out to be avoidable. The scanner already knows whether a scope is a pure skipChannelExtraWarnings: activeAccounts.length > 0 && !hasImplicitActiveAccount,Deciding whether to ask is the scanner's job; deciding what to warn about stays the What this removes from the diff:
No channel plugin code changes at all now, so the Same verified outcome. Rebuilt and re-ran Happy to go back to the context-field approach if maintainers would rather have channels |
871da6c to
6643ee2
Compare
Reverted the rework — the additive field was the safer of the twoMy previous push replaced the optional
Not calling a public callback is a bigger change than adding a field to it. Concretely, for
The first is additive, the second is breaking. My error was checking that Telegram is the So this head (
Re-verified on this head: related suites 81 passed (core 40 / telegram 31 / catalog 10), The open question is unchanged and is still yours to decide: whether an optional, @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
6643ee2 to
e0737f6
Compare
Fixed the P2 finding: external plugins now resolve too
Correct, and it made the layer-1 repair half a fix: bundled channels resolved, configured
const plugin =
(channelId ? (getChannelPlugin(channelId) ?? getBundledChannelPlugin(channelId)) : undefined) ??
findReadOnlyChannelPlugin(cfg, channelName);
Note the ordering detail: the external path is reached even when Coverage added (
Red/green on this finding — reverting only Commands lane on this head: 319 files, 4117 passed, 4 skipped. Type check clean for these The remaining items are the maintainer decision on the additive exported context, which I @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…t-time setup Operators running Telegram with multiple accounts saw doctor report the channel as unconfigured -- "Telegram is in first-time setup mode ... Group messages stay blocked" -- while those bots replied in those groups normally. Two layers caused it. resolveDoctorChannelAccountIds resolved channels through the plugin registry, which is empty during a doctor run because doctor inspects config without starting channels. It therefore returned undefined for every channel, pinning hasImplicitActiveAccount to true and leaving suppressParentGroupAllowlistWarning (added in openclaw#93434 for this same class of parent-scope false positive) permanently dead in production. Doctor was already inconsistent with itself here: channel-doctor.ts finds adapters through the config-driven read-only path, so the warning was produced, while channel-capabilities.ts needed the registry, so the data that suppresses it was missing. Account resolution now falls back the same way doctor already does elsewhere: the bundled catalog for bundled channels, and the read-only configured-plugin loader for external ones, so configured third-party channels resolve too. The parent container scope is also checked as if it were an account, and the scanner's suppression signal never reached the channel-supplied extraWarningsForAccount hook. The scope now carries its active child accounts as an optional childAccounts field, and Telegram skips first-time guidance only when every active account defines groups. childAccounts is withheld when an implicit runtime account inherits the container scope, and when no active accounts exist, so it is always non-empty when present. The field is additive: existing channel plugins that ignore it keep their current behavior, and the hook keeps being called on every scope it is called on today. Verified on the real CLI, not only tests: with neither layer the warning appears, with layer 1 alone it still appears, with both it is gone. Note the reach: because account resolution previously failed for every channel, this makes parent-scope suppression live across all channels, not just Telegram. Prepared with AI assistance (Claude Code). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
e0737f6 to
787507f
Compare
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
Closes #124705
What Problem This Solves
Fixes an issue where operators running Telegram with multiple accounts would see
openclaw doctorreport the channel as unconfigured, even though every account alreadylists its groups and the bots reply in those groups normally:
The warning tells operators their group messages are blocked when they are not, and points
at
channels.telegram.groups— a key that multi-account setups intentionally leave emptybecause each account carries its own
groups. Doctor is what people reach for whensomething looks broken, so a permanent false alarm there costs trust in every other line
it prints.
Why This Change Was Made
There are two layers here, and the first one reaches past Telegram.
Layer 1 — doctor could not resolve any channel's accounts.
resolveDoctorChannelAccountIdsresolves the channel throughnormalizeAnyChannelId,which only knows channels present in the plugin registry. Doctor inspects config without
starting channels, so that registry is empty and the function returned
undefinedforevery channel. That makes
hasImplicitActiveAccountunconditionallytrue, which meanssuppressParentGroupAllowlistWarning— added in #93434 for exactly this class ofparent-scope false positive — has been permanently
falsein production. Its tests passbecause they run where the registry is populated.
Doctor was already inconsistent with itself:
channel-doctor.tslocates the Telegramadapter through
resolveReadOnlyChannelPluginsForConfig(config-driven, registry-free), sothe warning is produced, while
channel-capabilities.tsneeds the registry, so the datathat would suppress it is missing.
getDoctorChannelCapabilitiesalready sidesteps this byconsulting the bundled catalog first. Account resolution now falls back the same way
doctor already does elsewhere — the bundled catalog for bundled channels, and the
config-driven read-only plugin loader for configured external ones — so both halves of
doctor agree on which channels exist, third-party channels included.
Layer 2 — the parent container scope is checked as if it were an account.
scanEmptyAllowlistPolicyWarningscallscheckAccount(channelConfig, "channels.telegram", …, parent: undefined). Onceaccountsare in use that scope holds nogroupsof its own,so Telegram's first-time guidance fires there while both account scopes stay silent. The
scanner's existing suppression signal reaches
collectEmptyAllowlistPolicyWarningsForAccountbut not the channel-supplied
extraWarningsForAccounthook, which is where that guidancecomes from. The parent scope now carries its active child accounts in the existing
ChannelDoctorEmptyAllowlistAccountContextas an optionalchildAccountsfield, andTelegram skips first-time guidance only when every active account defines
groups.The field is additive. The hook keeps being invoked on exactly the scopes it is invoked
on today, and a channel plugin that ignores
childAccountsbehaves exactly as before, sono existing plugin — bundled or external — changes behavior without opting in.
childAccountsis withheld whenhasImplicitActiveAccountis true — the same guard #93434applied. A container-level
botToken/tokenFile/$TELEGRAM_BOT_TOKENsynthesizes animplicit
defaultruntime account that inherits this scope and has no scope of its own towarn on, so its group routing really is unconfigured and the container keeps owning that
guidance. It is also withheld when there are no active accounts, so when present it is
always non-empty. Deciding this in the scanner rather than in the adapter keeps the
account-resolution data and the guard in one place.
Non-goals: setups with no
accountsblock keep the existing warning verbatim, accountsthat genuinely lack
groupskeep warning at their own scope, and no authorization orrouting behavior changes — this only affects what doctor prints.
Blast radius, stated plainly. Layer 1 is broader than the Telegram symptom that led
here. Because
resolveDoctorChannelAccountIdspreviously returnedundefinedfor everychannel,
suppressParentGroupAllowlistWarningwas dead for every channel. This changemakes that suppression live across all channels at once. It only fires when every active
account genuinely resolves a
groupAllowFrom(orallowFromunder the fallbackcapability), so operators lose no real warning — but reviewers should weigh it as a
cross-channel behavior change, not a Telegram-only one.
empty-allowlist-scan.test.tscovers a non-Telegram channel on both sides of that boundary.
User Impact
Operators running multiple Telegram accounts get a clean
openclaw doctorrun instead of astanding false alarm, and real first-time setups still get the guidance they need, reported
at the account scope that actually needs fixing. Beyond Telegram, doctor can now resolve
channel accounts at all during a normal run, which is what #93434's suppression needed to
work in the first place.
Evidence
Measured on the real CLI, not just tests. Built the repo and ran
node openclaw.mjs doctoragainst a live 6-account Telegram config. Temporary instrumentation confirmed theroot cause before the fix:
Each layer was then reverted independently and the CLI rebuilt, which shows both are
required:
first-time setupwarnings in realdoctoroutputNo other Telegram warnings changed; the remaining ones are unrelated (dead-lettered ingress
events).
Red/green, production change reverted per layer. Reverting only
src/commands/doctor/channel-capabilities.ts:Reverting only
extensions/telegram/src/doctor.ts:Reverting only
src/commands/doctor/shared/empty-allowlist-scan.ts:Test lanes:
test:channelstest:contracts:pluginstest:contracts:channelstest:extension telegrampnpm checkassertion SAFETY comment ratchetThe one
pnpm checkfailure is pre-existing and unrelated: it reportssrc/gateway/server.auth.control-ui.pairing.suite.ts: 6 < 11(a baseline larger than thereal count). Stashing this change and rerunning produces byte-identical output, so it
reproduces on
mainuntouched.New coverage pins both layers: account ids resolve through the bundled catalog when no
channel is registered, resolve a configured external plugin through the read-only loader,
and still return
undefinedwhen no loader can identify the channel;first-time guidance is skipped only when every active account configures
groups, and ispreserved when one account lacks them, when there is no
accountsblock, whenchildAccountsis withheld for an implicit runtime account, and at account scope.Prepared with AI assistance (Claude Code).