Skip to content

fix(commands): show denied slash commands to Gateway clients - #204673

Merged
obviyus merged 1 commit into
mainfrom
fix/allowfrom-silent-denial
Nov 24, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/allowfrom-silent-denial

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Fixes #198259. On a Gateway with gateway.auth.mode=password and commands.allowFrom: {"*": [...]}, the owner's Control UI /status (and every other text command) returned started, then a final with no assistant message. The command gate (rejectUnauthorizedCommand) replied only to native commands; every other denial was silent. Thirteen commands (/status, /help, /commands, /skill, /context, /usage, /fast, /session, /diagnostics, /agents//subagents, /tts, /whoami, /restart, /update) also set silentUnauthorized, which dropped the native refusal too.

Fix

  • command-gates.ts is the one owner of the denial outcome:
    • Gateway clients (Control UI, WebChat, CLI) get a refusal that names the policy and the next step: add the Gateway user profile ID to commands.allowFrom, or move the "*" entries to per-channel keys so Control UI commands follow operator access.
    • Native commands get the existing refusal for every command.
    • Text commands from external channel senders stay silent, so strangers in shared chats get no reply. This is the recorded intentional non-outcome.
  • Deleted the silentUnauthorized option and its 13 uses.
  • Docs (docs/tools/slash-commands.md): password/token Control UI clients have no user identity, and how to keep their commands available.

Supersedes the denial part of #198874 (draft, maintainer edits off). Thanks @RomneyDa for the first cut of the visible WebChat refusal.

Owner identity: no change (policy question)

The issue asks that the password owner (gateway-owner) pass commands.allowFrom. The docs are not silent here: since #144601 they say "A shared owner profile used only for attribution does not grant this access." Every holder of the shared password or token gets that profile, so making it matchable would admit them all. This PR keeps that rule and does not add an owner bypass. The documented route for the reporter: list channel senders under per-channel keys and omit "*"; Control UI commands then follow operator scopes.

Open policy question for @obviyus: should operator.admin Gateway clients pass commands.allowFrom (today the list is the only authority when set)? Default kept: no.

User impact

  • Control UI owner denied by commands.allowFrom: sees why and what to change, instead of nothing.
  • Native /status, /help and the others from a denied sender: see "You are not authorized to use this command." instead of no response (Discord shows "did not respond" otherwise).
  • External channel text senders: unchanged (silent).

Evidence

  • Red on base e24a2eecffb7, green on head: commands-info.test.ts "denied /status" (Control UI owner refusal names commands.allowFrom; native refusal). Silence for external text senders and the per-channel-key route pass on both.
  • Pre-push: touched tests + importers of every changed source (15 files), tsgo:core, tsgo:test, oxfmt, oxlint.
  • Head E2E 9f42a4647b, isolated password-auth Gateway from source, Control UI client (operator.admin, password), chat.send /status:
    • commands.allowFrom: {"*": ["someone-else"]} (the issue config): base 736ec651c262 gave started, then a final with no assistant message; head replies with the refusal that names commands.allowFrom.
    • commands.allowFrom: {"telegram": ["someone-else"]} (the documented route): /status returns the full status card.
  • One-admission E2E on head (queued refusal, running turn finishes, Stop cancels): Q, R, S pass.

A Control UI owner outside commands.allowFrom sent /status and got no reply.
Gateway clients now get a refusal that names commands.allowFrom and how to
admit them; native commands always get the refusal. Deletes silentUnauthorized.
Text commands from external channel senders stay silent.

Fixes #198259.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 24, 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 docs Improvements or additions to documentation size: S labels Nov 24, 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. labels Nov 24, 2026
@obviyus
obviyus merged commit 7f5ec42 into main Nov 24, 2026
137 checks passed
@obviyus
obviyus deleted the fix/allowfrom-silent-denial branch November 24, 2026 13:41
@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 7f5ec42. Denied slash commands now reply to Gateway clients with the commands.allowFrom policy and how to admit them; native denials always reply; external channel text senders stay silent. Proof: real password-auth Gateway /status refusal on head (silent on base), documented per-channel config returns the status card, one-admission Q/R/S pass. Thanks @RomneyDa for the first cut in #198874.

tideclaw-bot pushed a commit that referenced this pull request Nov 25, 2026
## Problem

Fixes #198259. On a Gateway with `gateway.auth.mode=password` and `commands.allowFrom: {"*": [...]}`, the owner's Control UI `/status` (and every other text command) returned `started`, then a final with no assistant message. The command gate (`rejectUnauthorizedCommand`) replied only to native commands; every other denial was silent. Thirteen commands (`/status`, `/help`, `/commands`, `/skill`, `/context`, `/usage`, `/fast`, `/session`, `/diagnostics`, `/agents`/`/subagents`, `/tts`, `/whoami`, `/restart`, `/update`) also set `silentUnauthorized`, which dropped the native refusal too.

## Fix

- `command-gates.ts` is the one owner of the denial outcome:
  - Gateway clients (Control UI, WebChat, CLI) get a refusal that names the policy and the next step: add the Gateway user profile ID to `commands.allowFrom`, or move the `"*"` entries to per-channel keys so Control UI commands follow operator access.
  - Native commands get the existing refusal for every command.
  - Text commands from external channel senders stay silent, so strangers in shared chats get no reply. This is the recorded intentional non-outcome.
- Deleted the `silentUnauthorized` option and its 13 uses.
- Docs (`docs/tools/slash-commands.md`): password/token Control UI clients have no user identity, and how to keep their commands available.

Supersedes the denial part of #198874 (draft, maintainer edits off). Thanks @RomneyDa for the first cut of the visible WebChat refusal.

## Owner identity: no change (policy question)

The issue asks that the password owner (`gateway-owner`) pass `commands.allowFrom`. The docs are not silent here: since #144601 they say "A shared owner profile used only for attribution does not grant this access." Every holder of the shared password or token gets that profile, so making it matchable would admit them all. This PR keeps that rule and does not add an owner bypass. The documented route for the reporter: list channel senders under per-channel keys and omit `"*"`; Control UI commands then follow operator scopes.

Open policy question for @obviyus: should `operator.admin` Gateway clients pass `commands.allowFrom` (today the list is the only authority when set)? Default kept: no.

## User impact

- Control UI owner denied by `commands.allowFrom`: sees why and what to change, instead of nothing.
- Native `/status`, `/help` and the others from a denied sender: see "You are not authorized to use this command." instead of no response (Discord shows "did not respond" otherwise).
- External channel text senders: unchanged (silent).

## Evidence

- Red on base `e24a2eecffb7`, green on head: `commands-info.test.ts` "denied /status" (Control UI owner refusal names `commands.allowFrom`; native refusal). Silence for external text senders and the per-channel-key route pass on both.
- Pre-push: touched tests + importers of every changed source (15 files), `tsgo:core`, `tsgo:test`, oxfmt, oxlint.
- Head E2E `9f42a4647b`, isolated password-auth Gateway from source, Control UI client (`operator.admin`, password), `chat.send /status`:
  - `commands.allowFrom: {"*": ["someone-else"]}` (the issue config): base `736ec651c262` gave `started`, then a final with no assistant message; head replies with the refusal that names `commands.allowFrom`.
  - `commands.allowFrom: {"telegram": ["someone-else"]}` (the documented route): `/status` returns the full status card.
- One-admission E2E on head (queued refusal, running turn finishes, Stop cancels): Q, R, S pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 7f5ec42)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…w#204673)

## Problem

Fixes openclaw#198259. On a Gateway with `gateway.auth.mode=password` and `commands.allowFrom: {"*": [...]}`, the owner's Control UI `/status` (and every other text command) returned `started`, then a final with no assistant message. The command gate (`rejectUnauthorizedCommand`) replied only to native commands; every other denial was silent. Thirteen commands (`/status`, `/help`, `/commands`, `/skill`, `/context`, `/usage`, `/fast`, `/session`, `/diagnostics`, `/agents`/`/subagents`, `/tts`, `/whoami`, `/restart`, `/update`) also set `silentUnauthorized`, which dropped the native refusal too.

## Fix

- `command-gates.ts` is the one owner of the denial outcome:
  - Gateway clients (Control UI, WebChat, CLI) get a refusal that names the policy and the next step: add the Gateway user profile ID to `commands.allowFrom`, or move the `"*"` entries to per-channel keys so Control UI commands follow operator access.
  - Native commands get the existing refusal for every command.
  - Text commands from external channel senders stay silent, so strangers in shared chats get no reply. This is the recorded intentional non-outcome.
- Deleted the `silentUnauthorized` option and its 13 uses.
- Docs (`docs/tools/slash-commands.md`): password/token Control UI clients have no user identity, and how to keep their commands available.

Supersedes the denial part of openclaw#198874 (draft, maintainer edits off). Thanks @RomneyDa for the first cut of the visible WebChat refusal.

## Owner identity: no change (policy question)

The issue asks that the password owner (`gateway-owner`) pass `commands.allowFrom`. The docs are not silent here: since openclaw#144601 they say "A shared owner profile used only for attribution does not grant this access." Every holder of the shared password or token gets that profile, so making it matchable would admit them all. This PR keeps that rule and does not add an owner bypass. The documented route for the reporter: list channel senders under per-channel keys and omit `"*"`; Control UI commands then follow operator scopes.

Open policy question for @obviyus: should `operator.admin` Gateway clients pass `commands.allowFrom` (today the list is the only authority when set)? Default kept: no.

## User impact

- Control UI owner denied by `commands.allowFrom`: sees why and what to change, instead of nothing.
- Native `/status`, `/help` and the others from a denied sender: see "You are not authorized to use this command." instead of no response (Discord shows "did not respond" otherwise).
- External channel text senders: unchanged (silent).

## Evidence

- Red on base `5bfd560ab5f1`, green on head: `commands-info.test.ts` "denied /status" (Control UI owner refusal names `commands.allowFrom`; native refusal). Silence for external text senders and the per-channel-key route pass on both.
- Pre-push: touched tests + importers of every changed source (15 files), `tsgo:core`, `tsgo:test`, oxfmt, oxlint.
- Head E2E `9f42a4647b`, isolated password-auth Gateway from source, Control UI client (`operator.admin`, password), `chat.send /status`:
  - `commands.allowFrom: {"*": ["someone-else"]}` (the issue config): base `d5af0116c7e3` gave `started`, then a final with no assistant message; head replies with the refusal that names `commands.allowFrom`.
  - `commands.allowFrom: {"telegram": ["someone-else"]}` (the documented route): `/status` returns the full status card.
- One-admission E2E on head (queued refusal, running turn finishes, Stop cancels): Q, R, S pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
## Problem

Fixes #198259. On a Gateway with `gateway.auth.mode=password` and `commands.allowFrom: {"*": [...]}`, the owner's Control UI `/status` (and every other text command) returned `started`, then a final with no assistant message. The command gate (`rejectUnauthorizedCommand`) replied only to native commands; every other denial was silent. Thirteen commands (`/status`, `/help`, `/commands`, `/skill`, `/context`, `/usage`, `/fast`, `/session`, `/diagnostics`, `/agents`/`/subagents`, `/tts`, `/whoami`, `/restart`, `/update`) also set `silentUnauthorized`, which dropped the native refusal too.

## Fix

- `command-gates.ts` is the one owner of the denial outcome:
  - Gateway clients (Control UI, WebChat, CLI) get a refusal that names the policy and the next step: add the Gateway user profile ID to `commands.allowFrom`, or move the `"*"` entries to per-channel keys so Control UI commands follow operator access.
  - Native commands get the existing refusal for every command.
  - Text commands from external channel senders stay silent, so strangers in shared chats get no reply. This is the recorded intentional non-outcome.
- Deleted the `silentUnauthorized` option and its 13 uses.
- Docs (`docs/tools/slash-commands.md`): password/token Control UI clients have no user identity, and how to keep their commands available.

Supersedes the denial part of #198874 (draft, maintainer edits off). Thanks @RomneyDa for the first cut of the visible WebChat refusal.

## Owner identity: no change (policy question)

The issue asks that the password owner (`gateway-owner`) pass `commands.allowFrom`. The docs are not silent here: since #144601 they say "A shared owner profile used only for attribution does not grant this access." Every holder of the shared password or token gets that profile, so making it matchable would admit them all. This PR keeps that rule and does not add an owner bypass. The documented route for the reporter: list channel senders under per-channel keys and omit `"*"`; Control UI commands then follow operator scopes.

Open policy question for @obviyus: should `operator.admin` Gateway clients pass `commands.allowFrom` (today the list is the only authority when set)? Default kept: no.

## User impact

- Control UI owner denied by `commands.allowFrom`: sees why and what to change, instead of nothing.
- Native `/status`, `/help` and the others from a denied sender: see "You are not authorized to use this command." instead of no response (Discord shows "did not respond" otherwise).
- External channel text senders: unchanged (silent).

## Evidence

- Red on base `e24a2eecffb7`, green on head: `commands-info.test.ts` "denied /status" (Control UI owner refusal names `commands.allowFrom`; native refusal). Silence for external text senders and the per-channel-key route pass on both.
- Pre-push: touched tests + importers of every changed source (15 files), `tsgo:core`, `tsgo:test`, oxfmt, oxlint.
- Head E2E `9f42a4647b`, isolated password-auth Gateway from source, Control UI client (`operator.admin`, password), `chat.send /status`:
  - `commands.allowFrom: {"*": ["someone-else"]}` (the issue config): base `736ec651c262` gave `started`, then a final with no assistant message; head replies with the refusal that names `commands.allowFrom`.
  - `commands.allowFrom: {"telegram": ["someone-else"]}` (the documented route): `/status` returns the full status card.
- One-admission E2E on head (queued refusal, running turn finishes, Stop cancels): Q, R, S pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 7f5ec42)

Companion audit: The approval context follow-up f57a179 is separately selected. #204756 is a main-only authority refactor, #205780 adds the /context budget card, and #207006 changes loop test scaffolding; none is needed for baseline denial. #144601 verified-sender matching is already an ancestor of the pinned baseline.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

commands.allowFrom silently denies ALL WebChat/Control UI slash commands on password-auth gateways (empty senderCandidates)

1 participant