Reduce prompt token overhead with leaner context injections

This commit is contained in:
Tobias Bischoff
2026-01-07 08:14:47 +01:00
committed by Peter Steinberger
parent 7a917602c5
commit 412990a139
6 changed files with 45 additions and 42 deletions

View File

@@ -1006,7 +1006,7 @@ describe("trigger handling", () => {
describe("group intro prompts", () => {
const groupParticipationNote =
"Be a good group participant: lurk and follow the conversation, but only chime in when you have something genuinely helpful or relevant to add. Don't feel obligated to respond to every message — quality over quantity. Even when lurking silently, you can use emoji reactions to acknowledge messages, show support, or react to humor — reactions are always appreciated and don't clutter the chat.";
"In groups, respond only when helpful; reactions are ok when available.";
it("labels Discord groups using the surface metadata", async () => {
await withTempHome(async (home) => {
vi.mocked(runEmbeddedPiAgent).mockResolvedValue({

View File

@@ -161,10 +161,10 @@ export function buildGroupIntro(params: {
: undefined;
const cautionLine =
activation === "always"
? "Be extremely selective: reply only when you are directly addressed, asked a question, or can add clear value. Otherwise stay silent."
? "Be extremely selective: reply only when directly addressed or clearly helpful. Otherwise stay silent."
: undefined;
const lurkLine =
"Be a good group participant: lurk and follow the conversation, but only chime in when you have something genuinely helpful or relevant to add. Don't feel obligated to respond to every message — quality over quantity. Even when lurking silently, you can use emoji reactions to acknowledge messages, show support, or react to humor — reactions are always appreciated and don't clutter the chat.";
"In groups, respond only when helpful; reactions are ok when available.";
return [
subjectLine,
membersLine,