Skip to content

fix(sandbox): resolve bundled channel in sandbox explain (companion to #189343) - #189880

Closed
jerome-queck wants to merge 9 commits into
openclaw:mainfrom
jerome-queck:fix/sandbox-explain-bundled-channel-companion
Closed

jerome-queck wants to merge 9 commits into
openclaw:mainfrom
jerome-queck:fix/sandbox-explain-bundled-channel-companion

Conversation

@jerome-queck

@jerome-queck jerome-queck commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #51245 (partial: this fixes the sandbox explain diagnostic only; the live Telegram elevated-execution denial steipete kept open in that issue is not addressed here, so the issue should stay open).

Builds on #189343 by @nikolas-sapa. Their commit is cherry-picked unchanged with authorship kept; this PR adds the test change and Linux proof that ClawSweeper asked for on #189343. Credit for the fix goes to @nikolas-sapa. If #189343 lands instead, this can be closed.

What Problem This Solves

openclaw sandbox explain --session telegram:slash:<id> reports channel: (unknown) and allowedByConfig: false when the CLI's plugin registry has no channel plugins (the sandbox-backends scope is empty for stock docker/podman configs), even with tools.elevated.allowFrom.telegram configured.

User Impact

User impact: openclaw sandbox explain shows the right channel and allowedByConfig: true for telegram sessions on stock docker/podman setups, so elevated-tool allow lists can be checked without confusing (unknown) output.

Why

  • Original fix (@nikolas-sapa, 4e58d9b): fall back to the static bundled channel catalog after the runtime registry misses, for both the stored-delivery and the parsed-key paths.
  • Added here: the stored-delivery regression test now uses a session key with no channel (agent:builder:main), so only the stored delivery context supplies telegram. It now fails if the stored-delivery fallback is removed (it previously passed because the key also resolved telegram).

Evidence

Setup: Linux, built CLI, isolated HOME.

Config: {"tools":{"elevated":{"enabled":true,"allowFrom":{"telegram":["123456"]}}}}

Before (main 88217c9; sandbox-explain.ts and channels/registry.ts are unchanged from there to base 43a3abe):

Elevated:
  enabled: true
  channel: (unknown)
  allowedByConfig: false

After (this branch 46de5b0c90f):

Elevated:
  enabled: true
  channel: telegram
  allowedByConfig: true

--json before/after: before "allowedByConfig": false (no channel field); after "channel": "telegram", "allowedByConfig": true

Tests

  • Red (fix reverted): Tests 2 failed | 18 skipped (20) (exit 1), both tests fail
  • Red (stored-delivery fallback only reverted): Tests 1 failed | 1 passed | 18 skipped (20) (exit 1), the stored-delivery test fails
  • Green (branch): Tests 2 passed | 18 skipped (20) (exit 0); whole file: Tests 20 passed (20) (exit 0)
  • oxlint exit 0, format check exit 0, check:test-mock-exports exit 0, git diff --check exit 0

AI-assisted; all output above is from real runs.

Live elevated gate (second half of #51245)

Commit 553345060b6 adds regression tests for the runtime gate (resolveElevatedPermissions, used by get-reply-directives for live Telegram turns). I checked the live path on current main: Telegram native slash turns reach the gate with Provider: "telegram", and tools.elevated.allowFrom.telegram is 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 tests keep it that way. The sandbox explain fix above was the remaining part of the issue.

$ npx vitest run src/auto-reply/reply/reply-elevated.test.ts src/commands/sandbox-explain.test.ts
 ✓ telegram slash session authorizes a numeric sender id
 ✓ telegram slash session authorizes a number-typed sender id
 ✓ telegram slash session authorizes a telegram:-prefixed sender id
 ✓ telegram slash session denies a different sender
 Test Files  2 passed (2)
      Tests  30 passed (30)

Test-lines baseline

No scalar baseline raise on this PR. After merging current origin/main (50555bb134e), the local ratchet reports Test lines OK: 6499381; ceiling: 6499390; slack: 9. Our allocation config/test-lines-allocations/sandbox-explain-bundled-channel-elevated.txt remains 101 and covers this PR's added test lines exactly. Earlier heads were blocked by inherited main debt (same class of failure #193183 reconciled); newer main landings cleared that debt, so a manual +7 baseline bump is unnecessary and was not applied.

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations docker Docker and sandbox tooling size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 31, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

The original PR now contains the same diagnostic fix, both regression cases, and CLI proof, and is cleanly mergeable with a passing CI gate; this companion adds no distinct runtime repair.

Root-cause cluster
Relationship: duplicate
Canonical: #189343
Summary: The original open PR owns the same diagnostic repair; this companion adds tests of already-working runtime permissions.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Land the diagnostic fix through the original PR and preserve this companion's optional Telegram permission tests by link.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Land the diagnostic fix through the original PR and preserve this companion's optional Telegram permission tests by link.

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

Current source establishes the empty-registry failure, and the contributor supplies built-CLI before/after output; no target code was executed during this review.

Is this the best way to solve the issue?

The narrow diagnostic fallback uses existing channel owners and preserves runtime registry precedence; the original PR now implements the same solution.

Security review:

Security review cleared: The fallback changes diagnostic output while leaving sender authorization and execution boundaries unchanged.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1fb7766 adds src/commands/sandbox-explain.ts:169 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1fb7766685a5; files: src/commands/sandbox-explain.ts)

Codex review notes: model internal, reasoning medium; reviewed against 7f3a651fec39.

@jerome-queck

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 1, 2026
@jerome-queck

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 1, 2026
…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.
@jerome-queck
jerome-queck force-pushed the fix/sandbox-explain-bundled-channel-companion branch from 5533450 to 9f9c057 Compare November 5, 2026 00:30

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@jerome-queck

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@jerome-queck

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@jerome-queck

Copy link
Copy Markdown
Contributor Author

Closing this in favour of #189343. @nikolas-sapa folded the channel-less session key test and the Linux built-CLI proof into the original, so it now carries the same fix and tests, and that's where the credit belongs. The extra reply-elevated.test.ts case from 5533450 is still here on the branch if it's useful for #189343 or for the live half of #51245. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docker Docker and sandbox tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants