refactor: server-side user prompt construction with @pullfrog tag check (#123)

- Move prompt construction logic from action-side to server-side (webhook handler and trigger page)
- Include issue/comment body in USER PROMPT only if @pullfrog was tagged (checked server-side using containsTriggerPhrase)
- Add repoInstructions as separate REPO-LEVEL INSTRUCTIONS section in FULL prompt
- Macro-expand repoInstructions server-side before sending to action
- Trigger page never includes body (manual triggers)
- Remove redundant customInstructions field (now combined into prompt server-side)

files changed:
- action/external.ts: add repoInstructions to WriteablePayload, remove customInstructions
- action/utils/payload.ts: add repoInstructions to JsonPayload schema, remove customInstructions
- action/utils/repoSettings.ts: add repoInstructions to RepoSettings interface
- action/utils/instructions.ts: use payload.prompt directly, add repo section to full prompt, add repo field to ResolvedInstructions
- utils/webhooks/handleWebhook.ts: check @pullfrog tag and include body if tagged, macro-expand repoInstructions
- app/trigger/[owner]/[repo]/[number]/page.tsx: macro-expand repoInstructions (never include body)
This commit is contained in:
Colin McDonnell
2026-01-19 17:16:20 +00:00
committed by pullfrog[bot]
parent 26ced25a8f
commit 995b39a122
5 changed files with 38 additions and 3 deletions
+3 -1
View File
@@ -246,8 +246,10 @@ export interface WriteablePayload {
"~pullfrog": true;
/** agent slug identifier (e.g., "claude", "codex", "gemini") */
agent: AgentName | null;
/** the prompt/instructions for the agent to execute */
/** the prompt/instructions for the agent to execute (body if @pullfrog tagged + per-trigger instructions) */
prompt: string;
/** repo-level instructions (macro-expanded server-side) */
repoInstructions?: string | undefined;
/** event data from webhook payload - discriminated union based on trigger field */
event: PayloadEvent;
/** effort level for model selection (mini, auto, max) - defaults to "auto" */