skip [telegram] prefix for ! commands so pi handles them natively as shell

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wassname
2026-04-19 21:38:51 +08:00
parent 96b4d6fa67
commit 5da34c33a2
+2 -1
View File
@@ -65,7 +65,8 @@ export function buildTelegramTurnPrompt(options: {
files: DownloadedTelegramTurnFileLike[];
historyTurns?: Pick<PendingTelegramTurn, "historyText">[];
}): string {
let prompt = options.telegramPrefix;
// Let pi handle `!` shell commands natively - don't prepend [telegram] prefix
let prompt = options.rawText.trimStart().startsWith("!") ? "" : options.telegramPrefix;
if ((options.historyTurns?.length ?? 0) > 0) {
prompt +=
"\n\nEarlier Telegram messages arrived after an aborted turn. Treat them as prior user messages, in order:";