Skip to content

Commit 5de7cb1

Browse files
committed
fix: strip command from revision feedback
1 parent 9231be5 commit 5de7cb1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

api/src/orchestrator/orchestrator.service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,17 @@ export class OrchestratorService {
240240
// the job is parked (AWAITING_PR_APPROVAL). If an agent is already running the
241241
// feedback is persisted and will be picked up on the next handleImplement call.
242242
if (command.kind === 'revise' && job.prNumber) {
243+
const prefix = this.config.get('COMMAND_PREFIX');
244+
const strippedBody = evt.body
245+
.split('\n')
246+
.filter((l) => !l.trim().toLowerCase().startsWith(prefix.toLowerCase()))
247+
.join('\n')
248+
.trim();
249+
const feedbackBody = command.text
250+
? `${command.text}${strippedBody ? `\n\n${strippedBody}` : ''}`
251+
: strippedBody || evt.body;
243252
await this.prisma.prRevisionFeedback.create({
244-
data: { jobId: job.id, author: evt.author, body: command.text || evt.body },
253+
data: { jobId: job.id, author: evt.author, body: feedbackBody },
245254
});
246255
await this.safeCommentReaction(ref, evt.commentId, 'eyes');
247256
if (job.state === 'AWAITING_PR_APPROVAL') {

0 commit comments

Comments
 (0)