Skip to content

Improve Telegram groups config shape diagnostics#83260

Merged
giodl73-repo merged 2 commits into
openclaw:mainfrom
giodl73-repo:fix-telegram-groups-diagnostic-83083
May 19, 2026
Merged

Improve Telegram groups config shape diagnostics#83260
giodl73-repo merged 2 commits into
openclaw:mainfrom
giodl73-repo:fix-telegram-groups-diagnostic-83083

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #83083.

Summary

  • Add Telegram-owned doctor diagnostics when channels.telegram.groups or account-level Telegram groups is an array, string, null, or another non-object shape.
  • Keep core raw channel config validation plugin-agnostic: it still reports the failing path and schema error, but does not mention Telegram-specific repairs.
  • Keep the schema strict: this only improves diagnostics and does not auto-migrate arbitrary non-object values.

Real behavior proof

Behavior addressed: Malformed Telegram group config such as channels.telegram.groups: ["-1001234567890"] failed with only a generic raw config validation error, and doctor did not explain the expected Telegram group/topic object-map shape.

Real environment tested: WSL2 Ubuntu 24.04 OpenClaw checkout on PR head 357a224da3, rebuilt with pnpm build so the bundled Telegram runtime entry matched the patch.

Exact steps or command run after this patch:

pnpm build

cat > "$tmp/openclaw.json" <<'EOF'
{
  "plugins": { "enabled": true },
  "channels": {
    "telegram": {
      "groups": ["-1001234567890"],
      "accounts": {
        "work": { "groups": null }
      }
    }
  }
}
EOF
OPENCLAW_CONFIG_PATH="$tmp/openclaw.json" node openclaw.mjs doctor >"$tmp/doctor.out" 2>&1
rg -n "invalid Telegram groups shape|object map keyed|Example shape|channels.telegram.groups|accounts.work.groups|Config invalid" "$tmp/doctor.out"

node node_modules/vitest/vitest.mjs run \
  src/config/validation.channel-metadata.test.ts \
  extensions/telegram/src/doctor.test.ts \
  --reporter=dot

git diff --check

Evidence after fix:

19:│  Config invalid; doctor will run with best-effort config.  │
48:│  - channels.telegram.groups has invalid Telegram groups shape (array);  │
49:│    expected an object map keyed by Telegram group/chat id, not an       │
56:│  - Example shape: channels.telegram.groups."-1001234567890".topics."99"  │
237:- channels.telegram.groups: invalid config: must be object
238:- channels.telegram.accounts.work.groups: invalid config: must be object
exit=0

src/config/validation.channel-metadata.test.ts: 8 tests passed
extensions/telegram/src/doctor.test.ts: 18 tests passed

Observed result after fix: openclaw doctor now emits the Telegram-owned malformed-groups guidance while the generic raw validation output still reports the invalid config paths without plugin-specific repair text.

What was not tested: No live Telegram bot or forum topic was contacted; this is a config/doctor diagnostic-only change and intentionally does not send Telegram API calls or migrate arbitrary invalid values.

Verification

  • pnpm build — passed.
  • OPENCLAW_CONFIG_PATH="$tmp/openclaw.json" node openclaw.mjs doctor — emitted the malformed Telegram groups warning shown above.
  • node node_modules/vitest/vitest.mjs run src/config/validation.channel-metadata.test.ts extensions/telegram/src/doctor.test.ts --reporter=dot — passed, 26 tests.
  • git diff --check — passed.

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S maintainer Maintainer-authored PR labels May 17, 2026
@clawsweeper

clawsweeper Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Summary
The PR adds Telegram-owned doctor warnings for malformed non-object groups config and tests that raw channel validation remains plugin-agnostic.

Reproducibility: yes. source-reproducible: current main requires Telegram groups to be an object record and its doctor preview warnings do not inspect non-object groups shapes. The PR body also shows after-fix openclaw doctor terminal output for the malformed config.

PR rating
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Summary: Good focused PR with strong terminal proof, regression coverage, and no blocking findings; remaining handling is maintainer review.

Rank-up moves:

  • none
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

PR egg
✨ Hatched: 🥚 common Moonlit Clawlet

        .--^^^^--.           
     .-'  o    o  '-.        
    /       \__/      \      
   |    /\  ____  /\   |     
   |   /  \/____\/  \  |     
    \  \_.------._/  /       
     '._  `----'  _.'        
        '-.____.-'           
       _/|_|  |_|\_          
      /__|      |__\         
       .-----------.         
      '-------------'        

Rarity: 🥚 common.
Trait: sniffs out flaky tests.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Moonlit Clawlet in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • How to hatch it: reach status: 👀 ready for maintainer look or status: 🚀 automerge armed; that usually means sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

Real behavior proof
Sufficient (terminal): The PR body includes terminal proof from a rebuilt checkout showing the new openclaw doctor warning and the unchanged generic invalid config paths after the patch.

Risk before merge
Why this matters: - The protected maintainer label means this needs explicit maintainer review before merge even though no code-level merge risk was found.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused Telegram-owned doctor diagnostic after maintainer review, preserving plugin-agnostic core validation output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
The remaining action is explicit maintainer review/landing under the protected label; there is no narrow automated repair to queue.

Security
Cleared: The diff is limited to config/doctor diagnostics and tests, with no dependency, CI, secrets, install, or network execution changes.

Review details

Best possible solution:

Land the focused Telegram-owned doctor diagnostic after maintainer review, preserving plugin-agnostic core validation output.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: current main requires Telegram groups to be an object record and its doctor preview warnings do not inspect non-object groups shapes. The PR body also shows after-fix openclaw doctor terminal output for the malformed config.

Is this the best way to solve the issue?

Yes, the PR keeps owner-specific guidance in the Telegram doctor path while preserving generic core raw validation diagnostics, which matches the repo boundary for plugin-owned behavior.

Label justifications:

  • P2: This is a normal-priority Telegram setup diagnostics fix with limited blast radius and focused tests.

What I checked:

  • Current main lacks the targeted Telegram warning: Current main has Telegram doctor preview warnings for missing env tokens, invalid allowFrom entries, apiRoot values, and quote/tool-progress interactions, but it does not inspect non-object groups shapes before this PR. (extensions/telegram/src/doctor.ts:555, 6f18decb7a2c)
  • Schema contract requires object-map groups: Telegram account config declares groups as a record keyed by string group/chat ids, so arrays, strings, and null are invalid shapes under the existing contract. (src/config/zod-schema.providers-core.ts:269, 6f18decb7a2c)
  • PR adds Telegram-owned malformed groups detection: The PR head scans top-level and account-level Telegram scopes for present-but-non-object groups values, reports the path and actual type, and wires the warning into Telegram doctor preview warnings. (extensions/telegram/src/doctor.ts:145, 357a224da31a)
  • PR keeps core raw validation generic: The PR head adds a focused regression test that malformed channels.telegram.groups still reports generic invalid config: raw validation text without Telegram-specific repair wording. (src/config/validation.channel-metadata.test.ts:250, 357a224da31a)
  • PR body includes real behavior proof: The PR body shows a rebuilt WSL2 checkout running openclaw doctor against malformed Telegram groups config, producing the new Telegram warning plus the existing generic invalid config paths, and reports the focused tests and diff check passing. (357a224da31a)
  • Relevant local history: Available blame/history ties the current Telegram doctor and raw validation surfaces to commit 324a95d, which recently touched the same Telegram doctor/config area. (extensions/telegram/src/doctor.ts:555, 324a95db8b21)

Likely related people:

  • Yuval Dinodia: Recent local blame/history for the Telegram doctor adapter, config validation path, and Telegram group schema all point to commit 324a95d. (role: recent area contributor; confidence: medium; commits: 324a95db8b21; files: extensions/telegram/src/doctor.ts, src/config/validation.ts, src/config/zod-schema.providers-core.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 6f18decb7a2c.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 17, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Resolved the ClawSweeper P2 in latest push 357a224: removed the Telegram-specific shape hint from core config validation and kept the useful malformed-groups diagnostic in Telegram doctor, so owner-specific wording stays in the Telegram plugin boundary.

Verification:

node node_modules/vitest/vitest.mjs run src/config/validation.channel-metadata.test.ts extensions/telegram/src/doctor.test.ts --reporter=dot
git diff --check

Result: 2 test files passed, 26 tests passed; diff check passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 18, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Updated the PR body to match the current implementation: Telegram-specific shape guidance now lives in the Telegram doctor path, while core raw channel validation stays plugin-agnostic.

@clawsweeper re-review

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the Real behavior proof with a rebuilt bundled runtime path and actual openclaw doctor output. The command now shows the Telegram-owned malformed-groups warning plus the generic invalid config paths, and the focused tests remain green.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@giodl73-repo giodl73-repo merged commit 19065e4 into openclaw:main May 19, 2026
155 of 164 checks passed
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* Improve Telegram groups config diagnostics

Add targeted guidance when channels.telegram.groups uses a non-object shape so startup/config validation and doctor explain the required group-id object map and topic nesting.

* fix(config): keep channel validation hints generic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram groups config shape error needs actionable startup/doctor guidance

1 participant