Hide trigger:workflow_dispatch from prompt

This commit is contained in:
Colin McDonnell
2026-01-21 23:04:39 +00:00
committed by pullfrog[bot]
parent c6dfe4fa10
commit 5740eba150
2 changed files with 10 additions and 6 deletions
+4 -3
View File
@@ -140237,7 +140237,7 @@ function buildRuntimeContext(ctx) {
return encode(filtered);
}
function buildEventData(event) {
const { title, body, ...rest } = event;
const { title, body, trigger, ...rest } = event;
const sections = [];
const trimmedTitle = typeof title === "string" ? title.trim() : "";
const trimmedBody = typeof body === "string" ? body.trim() : "";
@@ -140247,9 +140247,10 @@ function buildEventData(event) {
if (trimmedBody) {
sections.push(trimmedBody);
}
if (Object.keys(rest).length > 0) {
const restWithTrigger = trigger === "workflow_dispatch" ? rest : { trigger, ...rest };
if (Object.keys(restWithTrigger).length > 0) {
if (sections.length > 0) sections.push("---");
sections.push(encode(rest));
sections.push(encode(restWithTrigger));
}
return sections.join("\n\n");
}
+6 -3
View File
@@ -51,7 +51,7 @@ function buildRuntimeContext(ctx: InstructionsContext): string {
}
function buildEventData(event: PayloadEvent): string {
const { title, body, ...rest } = event;
const { title, body, trigger, ...rest } = event;
const sections: string[] = [];
// render title + body as markdown
@@ -66,10 +66,13 @@ function buildEventData(event: PayloadEvent): string {
sections.push(trimmedBody);
}
// include trigger in rest unless it's workflow_dispatch (not informative)
const restWithTrigger = trigger === "workflow_dispatch" ? rest : { trigger, ...rest };
// separator and toon-encoded remaining fields
if (Object.keys(rest).length > 0) {
if (Object.keys(restWithTrigger).length > 0) {
if (sections.length > 0) sections.push("---");
sections.push(toonEncode(rest));
sections.push(toonEncode(restWithTrigger));
}
return sections.join("\n\n");