Fix issue w/ new comments being created in Prompt mode

This commit is contained in:
Colin McDonnell
2025-12-03 15:21:38 -08:00
parent 306285577e
commit 046de13bb3
2 changed files with 11 additions and 8 deletions
+7 -6
View File
@@ -12,19 +12,17 @@ function buildCommentFooter(payload: Payload): string {
const agentName = payload.agent;
const agentInfo = agentName ? agentsManifest[agentName] : null;
const agentDisplayName = agentInfo?.displayName || "Unknown Agent";
const agentDisplayName = agentInfo?.displayName || "Unknown agent";
const agentUrl = agentInfo?.url || "https://pullfrog.ai";
// build workflow run link or show unavailable message
const workflowRunPart = runId
? `[View workflow run](https://github.com/${repoContext.owner}/${repoContext.name}/actions/runs/${runId})`
: "(workflow link unavailable)";
: "View workflow run";
return `
${PULLFROG_DIVIDER}
---
<sup>🐸 Triggered by [Pullfrog](https://pullfrog.ai) | 🤖 [${agentDisplayName}](${agentUrl}) | ${workflowRunPart} | [𝕏](https://x.com/pullfrogai)</sup>`;
<sup><a href="https://pullfrog.ai"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pullfrog.ai/logos/frog-white-full-128px.png"><img src="https://pullfrog.ai/logos/frog-green-full-128px.png" width="9px" height="9px" style="vertical-align: middle; " alt="Pullfrog"></picture></a>&nbsp;&nbsp; Triggered by [Pullfrog](https://pullfrog.ai) Using [${agentDisplayName}](${agentUrl}) ${workflowRunPart} [𝕏](https://x.com/pullfrogai)</sup>`;
}
function stripExistingFooter(body: string): string {
@@ -167,7 +165,10 @@ export const ReportProgressTool = tool({
const issueNumber = ctx.payload.event.issue_number;
if (issueNumber === undefined) {
// fail silently
return { suggess: true };
return {
success: false,
message: "cannot create progress comment: no issue_number found in the payload event",
};
// throw new Error(
// "cannot create progress comment: no issue_number found in the payload event"
// );
+4 -2
View File
@@ -90,10 +90,12 @@ export const modes: Mode[] = [
{
name: "Prompt",
description:
"Fallback for tasks that don't fit other workflows, direct prompts via comments, or requests requiring general assistance without a specific workflow pattern",
"Fallback for tasks that don't fit other workflows, e.g. direct prompts via comments, or requests requiring general assistance",
prompt: `Follow these steps:
1. Perform the requested task. Only take action if you have high confidence that you understand what is being asked. If you are not sure, ask for clarification. Take stock of the tools at your disposal.
2. When creating comments, always use report_progress. Do not use create_issue_comment.
2. If the task involves making code changes:
- Create a branch for your work. The branch name should be prefixed with "pullfrog/". The rest of the name should reflect the exact changes you are making. It should be specific to avoid collisions with other branches. Never commit to directly to main, master, or production.
- Make the necessary code changes. Create intermediate commits if called for.
@@ -102,6 +104,6 @@ export const modes: Mode[] = [
3. ${reportProgressInstruction}
4. Call report_progress one final time with a summary of the results and links to any created issues, PRs, etc.`,
4. When finished with the task, use report_progress one final time to update the comment with a summary of the results and links to any created issues, PRs, etc.`,
},
];