Skip to content

feat(extensions): support allowCommands option in sendUserMessage #5733

@max-elia

Description

@max-elia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions