Description
Currently, any message injected by extensions via pi.sendUserMessage() has command handling and template expansion disabled (expandPromptTemplates: false). This prevents extensions from programmatically triggering slash commands (such as connection triggers or resetting sessions).
To solve this, I propose adding a new option allowCommands?: boolean to sendUserMessage(). When set to true, the expandPromptTemplates flag is enabled for that message.
I have implemented this change and created a matching PR (see #5732). Since this is an external bridge control feature (like in pi-telegram), opting in dynamically is safe and backward-compatible.
Description
Currently, any message injected by extensions via
pi.sendUserMessage()has command handling and template expansion disabled (expandPromptTemplates: false). This prevents extensions from programmatically triggering slash commands (such as connection triggers or resetting sessions).To solve this, I propose adding a new option
allowCommands?: booleantosendUserMessage(). When set totrue, theexpandPromptTemplatesflag is enabled for that message.I have implemented this change and created a matching PR (see #5732). Since this is an external bridge control feature (like in
pi-telegram), opting in dynamically is safe and backward-compatible.