pi forum: give a fresh session its notice with the first run Appended to a session with no conversation yet -- a new pi, or just after /new -- the join notice sat ahead of the system message pi records at the first run, and pi then sent that message without its content: the provider refused every request with a 400. Queue it for the next turn instead, which pi places after the system message.
Igor Soarez igor@soarez.org
Fri, 06 Nov 2026 13:58:14 +0200
1 files changed,
6 insertions(+),
1 deletions(-)
jump to
M
config/pi/extensions/forum.ts
→
config/pi/extensions/forum.ts
@@ -567,10 +567,15 @@ due.push({ details, text: messageContent(details, forumNames(forums)), forums, sent: false });
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" }, ); }