summaryrefslogtreecommitdiff
path: root/config/pi/extensions/forum.ts
diff options
context:
space:
mode:
Diffstat (limited to 'config/pi/extensions/forum.ts')
-rw-r--r--config/pi/extensions/forum.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/config/pi/extensions/forum.ts b/config/pi/extensions/forum.ts
index 05d5edc..4b16103 100644
--- a/config/pi/extensions/forum.ts
+++ b/config/pi/extensions/forum.ts
@@ -567,10 +567,15 @@ export default function (pi: ExtensionAPI) {
deliver();
}
+ // A notice that wakes nobody. A session with no conversation yet -- a fresh
+ // pi, or just after /new -- gets it with its first run instead: appended
+ // now, it would sit ahead of the system message pi records at that run, and
+ // pi then sends that message without its content, which providers reject.
function notice(details: NoticeDetails, text: string) {
+ const started = session?.sessionManager.getBranch().some((e) => e.type === "message") ?? false;
pi.sendMessage<NoticeDetails>(
{ customType: NOTICE_TYPE, content: text, display: true, details },
- { triggerTurn: false },
+ started ? { triggerTurn: false } : { deliverAs: "nextTurn" },
);
}