Repository navigation
fix(commands): show denied slash commands to Gateway clients - #204673
Merged
Merged
Conversation
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]>
Contributor
|
🦞👀 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. |
Collaborator
Author
|
Landed as 7f5ec42. Denied slash commands now reply to Gateway clients with the |
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #198259. On a Gateway with
gateway.auth.mode=passwordandcommands.allowFrom: {"*": [...]}, the owner's Control UI/status(and every other text command) returnedstarted, 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 setsilentUnauthorized, which dropped the native refusal too.Fix
command-gates.tsis the one owner of the denial outcome:commands.allowFrom, or move the"*"entries to per-channel keys so Control UI commands follow operator access.silentUnauthorizedoption and its 13 uses.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) passcommands.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.adminGateway clients passcommands.allowFrom(today the list is the only authority when set)? Default kept: no.User impact
commands.allowFrom: sees why and what to change, instead of nothing./status,/helpand 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).Evidence
e24a2eecffb7, green on head:commands-info.test.ts"denied /status" (Control UI owner refusal namescommands.allowFrom; native refusal). Silence for external text senders and the per-channel-key route pass on both.tsgo:core,tsgo:test, oxfmt, oxlint.9f42a4647b, isolated password-auth Gateway from source, Control UI client (operator.admin, password),chat.send /status:commands.allowFrom: {"*": ["someone-else"]}(the issue config): base736ec651c262gavestarted, then a final with no assistant message; head replies with the refusal that namescommands.allowFrom.commands.allowFrom: {"telegram": ["someone-else"]}(the documented route):/statusreturns the full status card.