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
3 changes: 0 additions & 3 deletions internal/api/webhook_orchestrator_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,6 @@ func (wo *WebhookOrchestratorV2) formatReviewComments(comments []UnifiedReviewCo

for i, comment := range comments {
result += fmt.Sprintf("**%d. %s**", i+1, comment.FilePath)
if comment.Severity != "" {
result += fmt.Sprintf(" (%s)", comment.Severity)
}
result += "\n"
if comment.LineNumber > 0 {
result += fmt.Sprintf(" Line %d: ", comment.LineNumber)
Expand Down
29 changes: 14 additions & 15 deletions internal/provider_output/github/output_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ func (c *APIClient) PostCommentReply(event *UnifiedWebhookEventV2, token, replyT

apiURL := fmt.Sprintf("https://api.github.com/repos/%s/issues/%d/comments",
event.Repository.FullName, event.MergeRequest.Number)
requestBody := map[string]interface{}{
"body": replyText,
}

requestBody := make(map[string]interface{})
requestBody["body"] = replyText

if event.Comment.Position != nil {
replyTarget := event.Comment.ID
Expand All @@ -66,21 +66,20 @@ func (c *APIClient) PostCommentReply(event *UnifiedWebhookEventV2, token, replyT
} else {
apiURL = fmt.Sprintf("https://api.github.com/repos/%s/pulls/%d/comments",
event.Repository.FullName, event.MergeRequest.Number)
requestBody = map[string]interface{}{
"body": replyText,
"in_reply_to": inReplyToInt,
}
requestBody["in_reply_to"] = inReplyToInt
}
}
} else if event.Comment.InReplyToID != nil && *event.Comment.InReplyToID != "" {
inReplyToInt, err := strconv.Atoi(*event.Comment.InReplyToID)
if err != nil {
log.Printf("[WARN] Failed to convert in_reply_to ID to integer: %v, using issue comment endpoint without thread linkage", err)
} else {
requestBody = map[string]interface{}{
"body": replyText,
"in_reply_to": inReplyToInt,
} else {
// For general comments (Position == nil), GitHub doesn't support threaded replies via API for issue comments.
// Prefix the reply with a blockquote of the original comment body to indicate what we are replying to.
bodyText := strings.TrimSpace(event.Comment.Body)
if bodyText != "" {
var quoted strings.Builder
for _, line := range strings.Split(bodyText, "\n") {
quoted.WriteString("> " + line + "\n")
}
quoted.WriteString("\n\n")
requestBody["body"] = quoted.String() + replyText
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/review/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func (s *Service) postReviewResults(
FilePath: "",
Line: 0,
Content: result.Summary,
Severity: models.SeverityInfo,
Severity: "", // Summary doesn't need a severity header
Category: "summary",
}
summaryComment.Content = appendLearningAcknowledgment(summaryComment.Content)
Expand Down
13 changes: 10 additions & 3 deletions ui/src/pages/AIProviders/components/ConnectorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,18 @@ const ConnectorForm: React.FC<ConnectorFormProps> = ({
const usesCustomModel = !!currentModelValue && !providerModels.includes(currentModelValue);
const shouldShowCustomModelInput = customModelMode || usesCustomModel;

// Sync custom mode when provider changes or model becomes valid
React.useEffect(() => {
if (!usesCustomModel) {
setCustomModelMode(false);
}, [currentProvider]);

React.useEffect(() => {
// Auto-exit custom mode only if the model matches a standard one and is non-empty.
// This prevents the input from disappearing while the user is actively typing.
Comment thread
LinceMathew marked this conversation as resolved.
if (!usesCustomModel && formData.selectedModel !== '') {
setCustomModelMode(false);
}
}, [currentProvider, usesCustomModel]);
}, [usesCustomModel, formData.selectedModel]);

// Validation rules
const isValidForm = () => {
Expand Down Expand Up @@ -199,7 +206,7 @@ const ConnectorForm: React.FC<ConnectorFormProps> = ({
<select
name="selectedModel"
className="block w-full bg-slate-700 border border-slate-600 text-white rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
value={usesCustomModel ? '__custom__' : currentModelValue}
value={shouldShowCustomModelInput ? '__custom__' : currentModelValue}
onChange={(e) => {
const { value } = e.target;
if (value === '__custom__') {
Expand Down
Loading