Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion FILE_STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ interface Finding {
message: string; // Review message
severity: string; // Severity level (required, optional, nit, fyi)
suggestion?: string; // Optional code suggestion
code?: string; // Optional code snippet
}
```

Expand Down
19 changes: 5 additions & 14 deletions src/agent/agent-system-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function getInteractiveSystemPrompt(): string {
Your response should contain two main sections:
1. <comments> - new review comments to post
✦ Preserve the order in which issues appear in the diff.
✦ Omit <suggestion> and/or <code> if you have nothing useful to add.
✦ Omit <suggestion> if you have nothing useful to add.
✦ If the comment already exists in the <existingCommentsContext>, do not post it again.
2. <resolvedComments> - existing comments that are now resolved

Expand Down Expand Up @@ -206,21 +206,12 @@ export function getInteractiveSystemPrompt(): string {
make the prop required and avoid missing-description bugs.
</message>

<!-- OPTIONAL: concrete replacement or illustrative snippet -->
<!-- OPTIONAL: We'll use this code block as a replacement for what is currently there. It uses
Github's native code suggestion syntax, which a user can commit immediately. Therefore the code block generated
needs to be a 100% valid replacement for the current code that can be committed without modification. -->
<suggestion>
+ description: string;
description: string;
</suggestion>

<!-- OPTIONAL: side-by-side fix or longer example (use fenced code
so GitHub renders it nicely) -->
<code>
\`\`\`tsx
interface SEOProps {
title: string;
description: string; // required for correct meta tags
}
\`\`\`
</code>
</comment>

<!-- repeat additional <comment> blocks as needed -->
Expand Down
13 changes: 1 addition & 12 deletions src/system-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function getSystemPrompt(): string {

✦ DO NOT include any other top-level text.
✦ Preserve the order in which issues appear in the diff.
✦ Omit <suggestion> and/or <code> if you have nothing useful to add.
✦ Omit <suggestion> if you have nothing useful to add.
-->
<comment>
<!-- how serious is the issue?
Expand Down Expand Up @@ -158,17 +158,6 @@ export function getSystemPrompt(): string {
<suggestion>
+ description: string;
</suggestion>

<!-- OPTIONAL: side-by-side fix or longer example (use fenced code
so GitHub renders it nicely) -->
<code>
\`\`\`tsx
interface SEOProps {
title: string;
description: string; // required for correct meta tags
}
\`\`\`
</code>
</comment>

<!-- repeat additional <comment> blocks as needed -->
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface Finding {
message: string;
severity?: string;
suggestion?: string;
code?: string;
}

export interface ReviewConfig {
Expand Down
6 changes: 0 additions & 6 deletions src/xml-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function parseAgentResponse(xmlText: string): AgentResponse {
const suggestionMatch = commentContent.match(
/<suggestion>([\s\S]*?)<\/suggestion>/s,
);
const codeMatch = commentContent.match(/<code>([\s\S]*?)<\/code>/s);

if (!fileMatch || !lineMatch || !messageMatch) {
continue; // Skip incomplete comments
Expand All @@ -50,7 +49,6 @@ export function parseAgentResponse(xmlText: string): AgentResponse {
const suggestion = suggestionMatch
? suggestionMatch[1].trim()
: undefined;
const code = codeMatch ? codeMatch[1].trim() : undefined;
let lineToMatch: string | undefined;

// The line content is used for matching, we need to strip the diff marker.
Expand All @@ -72,7 +70,6 @@ export function parseAgentResponse(xmlText: string): AgentResponse {
message: message,
severity: severity,
suggestion: suggestion,
code: code,
});
}
}
Expand Down Expand Up @@ -138,7 +135,6 @@ export function parseAgentResponse(xmlText: string): AgentResponse {
const suggestionMatch = commentContent.match(
/<suggestion>([\s\S]*?)<\/suggestion>/s,
);
const codeMatch = commentContent.match(/<code>([\s\S]*?)<\/code>/s);

if (!fileMatch || !lineMatch || !messageMatch) {
continue; // Skip incomplete comments
Expand All @@ -150,7 +146,6 @@ export function parseAgentResponse(xmlText: string): AgentResponse {
const suggestion = suggestionMatch
? suggestionMatch[1].trim()
: undefined;
const code = codeMatch ? codeMatch[1].trim() : undefined;
let lineToMatch: string | undefined;

// The line content is used for matching, we need to strip the diff marker.
Expand All @@ -172,7 +167,6 @@ export function parseAgentResponse(xmlText: string): AgentResponse {
message: message,
severity: severity,
suggestion: suggestion,
code: code,
});
}
}
Expand Down
1 change: 0 additions & 1 deletion types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ export interface Finding {
message: string; // comment body (may include ```suggestion blocks)
severity?: string;
suggestion?: string;
code?: string;
}