Skip to content

Commit e87316a

Browse files
committed
fix: simplify rerun review flow
1 parent 66957ab commit e87316a

13 files changed

Lines changed: 64 additions & 369 deletions

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ When a prior Codex review exists on the PR, reruns only reuse **unresolved Codex
132132

133133
1. **Inline semantic dedup** — prior unresolved Codex comments are passed to the model's structured-output turn so it can avoid reposting the same issue as a new finding.
134134
2. **Re-adjudicated carry-forward** — the model separately marks which of those prior unresolved Codex comments are still relevant now. Only those count toward the PR summary.
135-
3. **Auto-resolved Codex threads** — when a prior unresolved Codex comment now looks fixed, the rerun can resolve that GitHub review thread automatically.
136-
4. **Separated counts** — the summary reports new findings, still-relevant prior findings, and auto-resolved prior findings separately.
135+
3. **Separated counts** — the summary reports new findings and still-relevant prior findings separately.
137136

138137
## Security & Permissions
139138

cli/clients/github_client.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ def reply_to_review_comment(
4343
comment_id: int,
4444
text: str,
4545
) -> None: ...
46-
def resolve_review_thread(
47-
self,
48-
pr: PullRequestLikeProtocol,
49-
thread_id: str,
50-
) -> None: ...
5146
def post_issue_comment(self, pr: PullRequestLikeProtocol, text: str) -> None: ...
5247

5348

@@ -163,22 +158,6 @@ def reply_to_review_comment(
163158
exc,
164159
) from exc
165160

166-
def resolve_review_thread(
167-
self,
168-
pr: PullRequestLikeProtocol,
169-
thread_id: str,
170-
) -> None:
171-
try:
172-
pr._requester.graphql_query(
173-
_RESOLVE_REVIEW_THREAD_MUTATION,
174-
{"threadId": thread_id},
175-
)
176-
except Exception as exc:
177-
raise _wrap_github_error(
178-
f"failed resolving review thread {thread_id} on PR #{pr.number}",
179-
exc,
180-
) from exc
181-
182161
def post_issue_comment(
183162
self,
184163
pr: PullRequestLikeProtocol,
@@ -233,17 +212,6 @@ def _post_pr_resource(
233212
}
234213
"""
235214

236-
_RESOLVE_REVIEW_THREAD_MUTATION = """
237-
mutation ResolveReviewThread($threadId: ID!) {
238-
resolveReviewThread(input: { threadId: $threadId }) {
239-
thread {
240-
id
241-
isResolved
242-
}
243-
}
244-
}
245-
"""
246-
247215

248216
@dataclass(frozen=True)
249217
class ReviewThreadsPage:

cli/core/models.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,12 @@ class ReviewRunResult:
317317
overall_confidence_score: float | None
318318
findings: list[ReviewFinding]
319319
carried_forward: list[CarriedForwardReviewComment] = field(default_factory=list)
320-
resolved_comment_ids: list[str] = field(default_factory=list)
321320

322321
@classmethod
323322
def from_payload(cls, payload: Mapping[str, Any]) -> ReviewRunResult:
324323
required_fields = {
325324
"findings",
326325
"carried_forward",
327-
"resolved_comment_ids",
328326
"overall_correctness",
329327
"overall_explanation",
330328
"overall_confidence_score",
@@ -391,24 +389,12 @@ def from_payload(cls, payload: Mapping[str, Any]) -> ReviewRunResult:
391389
current_evidence=current_evidence,
392390
)
393391
)
394-
resolved_comment_ids_raw = payload.get("resolved_comment_ids")
395-
if not isinstance(resolved_comment_ids_raw, list):
396-
raise ReviewContractError("Review output field 'resolved_comment_ids' must be an array")
397-
resolved_comment_ids: list[str] = []
398-
for index, item in enumerate(resolved_comment_ids_raw):
399-
if not isinstance(item, str):
400-
raise ReviewContractError(
401-
"Review output field 'resolved_comment_ids' "
402-
f"item at index {index} must be a string"
403-
)
404-
resolved_comment_ids.append(item)
405392
return cls(
406393
overall_correctness=overall_correctness,
407394
overall_explanation=overall_explanation,
408395
overall_confidence_score=overall_confidence_score,
409396
findings=findings,
410397
carried_forward=carried_forward,
411-
resolved_comment_ids=resolved_comment_ids,
412398
)
413399

414400
def as_dict(self) -> dict[str, Any]:
@@ -424,7 +410,6 @@ def as_dict(self) -> dict[str, Any]:
424410
}
425411
for item in self.carried_forward
426412
],
427-
"resolved_comment_ids": list(self.resolved_comment_ids),
428413
}
429414

430415
@property
@@ -484,18 +469,13 @@ def carried_forward_comment_ids(self) -> list[str]:
484469
"additionalProperties": False,
485470
},
486471
},
487-
"resolved_comment_ids": {
488-
"type": "array",
489-
"items": {"type": "string"},
490-
},
491472
"overall_correctness": {"type": "string"},
492473
"overall_explanation": {"type": "string"},
493474
"overall_confidence_score": {"type": ["number", "null"]},
494475
},
495476
"required": [
496477
"findings",
497478
"carried_forward",
498-
"resolved_comment_ids",
499479
"overall_correctness",
500480
"overall_explanation",
501481
"overall_confidence_score",

cli/main.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,10 @@ def _run_mode_workflow(config: ReviewConfig) -> int:
298298
result = workflow.process_review(config.pr_number)
299299

300300
summary = result.summary
301-
if (
302-
summary.carried_forward_count > 0
303-
or summary.resolved_count > 0
304-
or summary.resolution_failure_count > 0
305-
):
301+
if summary.carried_forward_count > 0:
306302
extra_parts: list[str] = []
307303
if summary.carried_forward_count > 0:
308304
extra_parts.append(f"{summary.carried_forward_count} prior findings still relevant")
309-
if summary.resolved_count > 0:
310-
extra_parts.append(f"{summary.resolved_count} prior findings auto-resolved")
311-
if summary.resolution_failure_count > 0:
312-
extra_parts.append(f"{summary.resolution_failure_count} resolution failures")
313305
print(
314306
"\nReview completed: "
315307
f"{summary.overall_correctness}, "

cli/review/dedupe.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ def render_prior_codex_comments_for_prompt(
9191
applicable_comments = [
9292
comment for comment in existing_comments if comment.is_currently_applicable
9393
]
94-
resolved_candidates = [
95-
comment for comment in existing_comments if not comment.is_currently_applicable
96-
]
9794
lines: list[str] = []
9895
if applicable_comments:
9996
lines.append("<prior_codex_review_comments>")
@@ -112,23 +109,6 @@ def render_prior_codex_comments_for_prompt(
112109
)
113110
)
114111
lines.append("</prior_codex_review_comments>")
115-
if resolved_candidates:
116-
lines.append("<prior_codex_review_comments_candidate_resolutions>")
117-
for comment in resolved_candidates[:200]:
118-
lines.append(
119-
json.dumps(
120-
{
121-
"id": comment.id,
122-
"thread_id": comment.thread_id,
123-
"path": comment.path,
124-
"line": comment.line,
125-
"current_code": comment.current_code,
126-
"body": comment.body,
127-
},
128-
ensure_ascii=True,
129-
)
130-
)
131-
lines.append("</prior_codex_review_comments_candidate_resolutions>")
132112
return "\n".join(lines)
133113

134114

0 commit comments

Comments
 (0)