Repository navigation
fix: sandbox explain reports channel=(unknown) and allowedByConfig=false for telegram slash sessions - #189343
Conversation
…gins The sandbox explain CLI activates a sandbox-backends-scoped plugin registry, which is empty for stock docker/podman configs, so normalizeAnyChannelId could never resolve bundled channels like telegram and elevated diagnostics kept reporting channel=(unknown) with allowedByConfig=false for telegram:slash:* sessions (issue openclaw#51245). Fall back to the static bundled channel catalog after the runtime registry lookup misses, covering both the stored-delivery and parsed-key channel paths. Red/green: two new tests in src/commands/sandbox-explain.test.ts set an empty plugin registry exactly like the real CLI and fail on main (channel undefined), pass with the fallback (20/20).
|
🦞👀 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 changesThis PR lets sandbox explain resolve bundled channels when its scoped plugin registry contains no channel plugins. Example: Run openclaw sandbox explain --session telegram:slash:123456 with tools.elevated.allowFrom.telegram set to ["123456"].
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current diagnostic bug with a small, supported change and credible CLI proof; no actionable code defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe sandbox CLI reads configuration and session metadata, identifies the applicable channel, and renders sandbox and elevated-policy diagnostics without authorizing execution. flowchart TD
A[Sandbox explain CLI] --> B[Configuration and session metadata]
B --> C[Stored channel or session key]
C --> D[Registered channel lookup]
D --> E[Bundled catalog fallback]
E --> F[Elevated configuration report]
Technical reviewBest possible solution: Retain the existing registry-first lookup with bundled-catalog fallback in the diagnostic command and keep live authorization investigation in the linked issue. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the empty-registry failure, and the supplied real CLI before/after output corroborates it; no target code was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete diagnostic repair: it reuses existing channel owners, preserves registered-plugin precedence, and covers the two distinct lookup paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3588c0514ac8. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +101. Total +107 across 3 files. Added test files: 0. 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: No label 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 (3 earlier review cycles)Reviewed November 14, 2026, 1:54 AM ET / 06:54 UTC (Revision 4). |
|
Hi @nikolas-sapa, thanks for this fix. I opened #189880, which cherry-picks your commit unchanged (authorship kept) and adds two things ClawSweeper asked for here: built-CLI before/after output on Linux, and a stored-delivery test that uses a channel-less session key, so it fails if the stored-delivery fallback is removed. Credit for the fix is yours. If you'd rather fold the test change into this PR, I'm happy to close mine. |
|
@clawsweeper re-review @jerome-queck Folded in the channel-less session key test isolation case and updated the description with the Linux CLI before/after proof. Thanks for the test case! |
|
🦞👀 Re-review progress:
|
|
Hi @nikolas-sapa, thanks for folding in the test and proof! ClawSweeper keeps overall at 3/6 because it rates the fix scope as Partial: #51245 also covers the live elevated-exec denial for Telegram slash sessions, and this PR only touches I looked at the live half. On current main the runtime gate ( To fold it in: Then add a short "Live elevated gate" note to your body's Evidence section. You can copy the one from #189880's description: the four I can't prove it against a real Telegram account from Linux, so if a maintainer wants that, it would need a real bot. Once you've folded it in, I'll close #189880 in favor of yours. |
…gate Covers the live half of openclaw#51245: a Telegram native slash context with no channel plugin registered is authorized by tools.elevated.allowFrom.telegram and a different sender is still denied.
|
@clawsweeper re-review @jerome-queck Folded in your live elevated-gate tests (cherry-picked as ea18bc7, authorship kept — note it rebased to dff3669 on your branch, same diff). Verified locally: 30/30 pass across both files, test-lines ratchet OK with slack. Body updated with the Live elevated gate section. |
|
🦞👀 Re-review progress:
|
Co-authored-by: obviyus <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…lse for telegram slash sessions (openclaw#189343) * fix(sandbox): resolve bundled channels in explain without channel plugins The sandbox explain CLI activates a sandbox-backends-scoped plugin registry, which is empty for stock docker/podman configs, so normalizeAnyChannelId could never resolve bundled channels like telegram and elevated diagnostics kept reporting channel=(unknown) with allowedByConfig=false for telegram:slash:* sessions (issue openclaw#51245). Fall back to the static bundled channel catalog after the runtime registry lookup misses, covering both the stored-delivery and parsed-key channel paths. Red/green: two new tests in src/commands/sandbox-explain.test.ts set an empty plugin registry exactly like the real CLI and fail on main (channel undefined), pass with the fallback (20/20). * test(sandbox-explain): isolate stored delivery fallback test with channel-less key * test(elevated): pin Telegram slash allowFrom in the runtime elevated gate Covers the live half of openclaw#51245: a Telegram native slash context with no channel plugin registered is authorized by tools.elevated.allowFrom.telegram and a different sender is still denied. --------- Co-authored-by: Jerome <[email protected]> Co-authored-by: obviyus <[email protected]>
Related: #51245 (both halves covered: this fixes the
sandbox explaindiagnostic, and adds regression tests proving the live elevated gate already authorizes Telegram slash senders on main — no runtime change needed there. A real-bot live check would still need a maintainer with a Telegram account, so the issue can stay open until then.)What Problem This Solves
openclaw sandbox explain --session telegram:slash:<id>reportschannel: (unknown)andallowedByConfig: falsewhen the CLI's plugin registry has no channel plugins (the sandbox-backends scope is empty for stock docker/podman configs), even withtools.elevated.allowFrom.telegramconfigured.User Impact
openclaw sandbox explainshows the right channel andallowedByConfig: truefor telegram sessions on stock docker/podman setups, so elevated-tool allow lists can be checked without confusing(unknown)output.Why This Change Was Made
agent:builder:main), so only the stored delivery context supplies telegram. Fails if the stored-delivery fallback is removed.Evidence
Real CLI proof at exact head
948c62ef4291(this branch merged with currentmain; maintainer run).openclaw sandbox explain --session telegram:slash:123456, run from source in an isolated HOME whose only config is{"tools":{"elevated":{"enabled":true,"allowFrom":{"telegram":["123456"]}}}}:Elevatedblock--jsonelevatedmain520f18975936channel: (unknown),allowedByConfig: falsechannel,allowedByConfig: false,allowFrom: {}948c62ef4291channel: telegram,allowedByConfig: truechannel: "telegram",allowedByConfig: true,allowFrom.global: ["123456"]src/commands/sandbox-explain.tsreset tomain, both newsandbox-explain.test.tscases fail (2 failed, 18 passed); on the head 20/20 pass, andreply-elevated.test.ts10/10.oxlint/oxfmtclean on the touched files.Contributor evidence
Setup: Linux, built CLI, isolated HOME.
Config:
{"tools":{"elevated":{"enabled":true,"allowFrom":{"telegram":["123456"]}}}}Before (main;
sandbox-explain.tsandchannels/registry.ts):After (this branch):
--jsonbefore/after: before"allowedByConfig": false(nochannelfield); after"channel": "telegram", "allowedByConfig": trueTests
Tests 2 failed | 18 skipped (20) (exit 1), both tests failTests 1 failed | 1 passed | 18 skipped (20) (exit 1), the stored-delivery test failsTests 2 passed | 18 skipped (20) (exit 0); whole file:Tests 20 passed (20) (exit 0)Live elevated gate (second half of #51245)
Commit
ea18bc782(cherry-picked from @jerome-queck's #189880, authorship kept) adds regression tests for the runtime gate (resolveElevatedPermissions, used byget-reply-directivesfor live Telegram turns). On current main, Telegram native slash turns reach the gate withProvider: "telegram", andtools.elevated.allowFrom.telegramis looked up by that provider. With no channel plugin registered, a Telegram slash context (SessionKey: telegram:slash:123456,SenderId: 123456) is authorized for["123456"],[123456]and["telegram:123456"], and a different sender is still denied. So no runtime code change is needed on main — the live elevated path already passes per these tests (which include #182406). The tests keep it that way; thesandbox explainfix above was the remaining part of the issue.Thanks to @jerome-queck for the stored-delivery test isolation case and the live elevated-gate regression tests.