Skip to content

MSC4391: Simplified in-room bot commands#4391

Open
Gnuxie wants to merge 20 commits into
matrix-org:mainfrom
Gnuxie:gnuxie/simplified-in-room-bot-commands
Open

MSC4391: Simplified in-room bot commands#4391
Gnuxie wants to merge 20 commits into
matrix-org:mainfrom
Gnuxie:gnuxie/simplified-in-room-bot-commands

Conversation

@Gnuxie

@Gnuxie Gnuxie commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

Rendered

Signed-off-by: Gnuxie Gnuxie@protonmail.com


This MSC incorporates work from MSC4332

@Gnuxie Gnuxie changed the title MSC0000: Simplified in-room bot commands MSC4391: Simplified in-room bot commands Dec 24, 2025
@tulir tulir added proposal A matrix spec change proposal. Process state. A-Client Server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Dec 24, 2025

@tulir tulir Dec 24, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements:

  • Client
  • Bot

@tulir tulir Dec 26, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gomuks/gomuks#675 is mostly complete implementation of client and technically also bot, converted from MSC4332. It doesn't have full support for room/event IDs or unions yet, but mostly it should be there

It assumes most of my suggestions in other comments are applied. Specifically:

  • command string instead of designator array
  • "optional": true instead of "required": false
  • primitive schemas nested in an object with "schema_type": "primitive"
  • arrays only at top level and unions only at top level or in arrays)
  • optionally: list of aliases, default_value for default values

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(all of these suggestions were up-streamed into the MSC)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proper bot implementation: maunium/meowlnir#50

Both meowlnir and parts of gomuks use logic from mautrix/go#446 (gomuks web has its own typescript implementation, gomuks terminal uses mautrix-go)

Comment thread proposals/4391-simplified-in-room-bot-commands.md
Comment thread proposals/4391-simplified-in-room-bot-commands.md Outdated
Comment thread proposals/4391-simplified-in-room-bot-commands.md Outdated
Comment thread proposals/4391-simplified-in-room-bot-commands.md Outdated
Comment thread proposals/4391-simplified-in-room-bot-commands.md Outdated
Comment thread proposals/4391-simplified-in-room-bot-commands.md
Comment thread proposals/4391-simplified-in-room-bot-commands.md Outdated
Comment thread proposals/4391-simplified-in-room-bot-commands.md
"m.text": [{ "body": "Whether to apply this to the policy" }]
},
// This argument is not required
"required": false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternative/extension to optional parameters, a default value might be useful. The /raw command in gomuks has {} as the default value for event JSON for example

Also, "optional": true might be nicer than "required": false to allow treating undefined as false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include defaults at this stage because they can also be provided by partial commands and interactive prompts ie the way suggestions work in draupnir. I guess it might be ok if it's treated like a literal default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit hesitant to do so right now and am thinking of making a JSON RPC style response follow up MSC that can explore the prompts and partial commands before settling on how to do defaults.

Comment thread proposals/4391-simplified-in-room-bot-commands.md
Gnuxie and others added 4 commits January 5, 2026 16:31
matrix-org#4391 (comment)

Co-authored-by: Tulir Asokan <tulir@maunium.net>
matrix-org#4391 (comment)

Co-authored-by: Tulir Asokan <tulir@maunium.net>
Enable ease of parsing
matrix-org#4391 (comment)

Co-authored-by: Tulir Asokan <tulir@maunium.net>
matrix-org#4391 (comment)

Co-authored-by: Tulir Asokan <tulir@maunium.net>
Gnuxie and others added 5 commits January 5, 2026 17:39
matrix-org#4391 (comment)

Co-authored-by: Tulir Asokan <tulir@maunium.net>
Co-authored-by: Tulir Asokan <tulir@maunium.net>
Co-authored-by: Tulir Asokan <tulir@maunium.net>
Co-authored-by: Tulir Asokan <tulir@maunium.net>
@Gnuxie Gnuxie marked this pull request as ready for review January 8, 2026 17:13
@tulir tulir added implementation-needs-checking The MSC has an implementation, but the SCT has not yet checked it. Process state. and removed needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Jan 10, 2026
- Using state events limits a bot's ability to advertise commands if it isn't
given power to do so.

## Alternatives

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in the process of adding a "response" mixin in a follow up MSC. It would be really useful to also be able to proxy the commands into a mutual room (like draupnir's command room). See the-draupnir-project/Draupnir#1041 (comment)

- Some predefined validation on arguments, like a range for integers or
maximum/minimum length of strings.

## Potential issues

@Gnuxie Gnuxie Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When commands are available across an entire space it is a pita to have to resend the state events everywhere. So maybe it would be nice to be able to only specify the commands in a space or take inspiration from sticker pack MSCs if they haven't encountered the same problem.

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

Labels

A-Client Server Client-Server API implementation-needs-checking The MSC has an implementation, but the SCT has not yet checked it. Process state. kind:feature MSC for not-core and not-maintenance stuff proposal A matrix spec change proposal. Process state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants