Skip to content

feat(PRO-547): bidirectional comment sync between the CLI and GitHub - #70

Open
dastratakos wants to merge 48 commits into
mainfrom
dean/pro-547-bidirectional-comment-sync-between-the-cli-and-github
Open

feat(PRO-547): bidirectional comment sync between the CLI and GitHub#70
dastratakos wants to merge 48 commits into
mainfrom
dean/pro-547-bidirectional-comment-sync-between-the-cli-and-github

Conversation

@dastratakos

@dastratakos dastratakos commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements PRO-547: the CLI now works with a PR's GitHub review live instead of keeping a local mirror, surfacing three clearly-labeled comment states — Local (CLI-only, offline), Pending (your unsubmitted GitHub review draft, only you see it), and Submitted (published) — faithful to GitHub's own review model.

Changes

  • Added a live GitHub review layer over gh api graphql (github/review.ts): one paginated query loads pending + submitted threads, plus mutations to create/reply/edit/delete pending comments, submit a review (Comment / Approve / Request changes), discard it, and resolve/reopen threads.
  • Added a merged read model + routes (runs/review.ts, routes/review.ts, GET /api/runs/:id/review) that combine local DB threads with the PR's live GitHub threads, degrading to local-only when gh is offline or the run isn't a PR.
  • Rebuilt the comment UI (vendored from hosted Stage): per-state badges, a review tray (submit popover with a pending-comments list, own-PR guard, Cmd⏎), and "Comment on the PR" / "Start a review" composer toggles; GitHub comments link to their permalink and render GitHub's server HTML.
  • Local comments stay CLI-only and work offline; no GitHub state is mirrored, so there is no DB schema change.

Testing

pnpm typecheck, pnpm lint, pnpm test (385 tests, including new route-integration tests for the review API against a faked gh), and pnpm build all pass. Not yet exercised against a live PR.


Open in Stage

Summary by cubic

Bidirectional comment sync between the CLI and GitHub PR reviews for PRO‑547. The CLI now merges local and live review state, keeps them in sync after writes, and adds strong guardrails, PR‑scoped cross‑process locks, and origin‑bound recovery so comments don’t get lost or mis‑anchored.

  • New Features

    • Live GitHub review via gh api graphql (paginated read; add/reply/edit/delete pending; submit/discard; resolve/reopen). Uses separate deadlines for reads (ghReadOrThrow) and writes (ghWriteOrThrow), refreshes PR/review after writes, shows comments on closed PRs but blocks writes, gates on the run’s diff matching the PR head, and rejects cross‑origin reads of private draft content.
    • Merged endpoint GET /api/runs/:runId/review: overlays local threads on GitHub; falls back to local‑only when gh is unavailable, the PR is unresolvable, the run isn’t a PR, or the run’s diff isn’t at the PR head. Preserves “GitHub unavailable” states and enforces same‑origin for private draft content and local bodies.
    • Guardrails, locks, and recovery: require a clean working tree, committed scope, and matching PR head; reject empty “Comment” reviews and require a summary for “Request changes”; count anchorless pending drafts so valid reviews aren’t rejected as empty; preserve pending drafts across edits/failures; resume interrupted promotions using stored GitHub IDs and reply counts bound to the same origin repo/PR; sequence updates and serialize actions across clones/worktrees with PR‑scoped locks via proper-lockfile; tolerant read‑path git errors; scoped PR‑query invalidation; hardened state transitions.
    • Rebuilt UI: badges for Local/Pending/Submitted; review panel with a pending list and submit flow (own‑PR guard); “Comment on the PR” / “Start a review” toggles with remembered choice and clear destinations; GitHub threads render authors and server HTML with permalinks; preserves unposted replies; suggestion tool when on a PR.
    • Types: @stagereview/types adds review models that encode review source invariants.
  • Migration

    • DB: add repoRoot to comment_thread with index (repoRoot, scopeKey); backfill where unique; add promotionThreadNodeId, promotionRootCommentNodeId, promotionReplyCount to safely resume promotions; replaces comment_thread_scope_key_idx.
    • Routes: local resolve/reopen moved to PATCH /api/comment-threads/:threadId; new review routes under /api/runs/:runId/review.
    • Web: replace comment threads context/hooks with ReviewProvider and useReview; remove legacy components.

Written for commit d8cd3a4. Summary will update on new commits.

Review in cubic

@stage-review

stage-review Bot commented Jun 22, 2026

Copy link
Copy Markdown

@dastratakos
dastratakos marked this pull request as ready for review June 22, 2026 18:40
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/routes/comments.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

8 issues found across 29 files

Linked issue analysis

Linked issue: PRO-547: Bidirectional comment sync between the CLI and GitHub

Status Acceptance criteria Notes
Pull existing PR review comments into the local/merged review view (load pending + submitted GitHub threads and merge with local threads). New GitHub read layer, merged read model, and a review route are added; the UI switches to the new ReviewProvider. These changes show the PR fetches and surfaces pending/submitted GitHub threads alongside local threads.
Push locally-authored comments back to the PR (create/reply/edit/delete pending comments, submit or discard a review). The diff adds write mutations and server handlers for creating/replying/editing/deleting pending comments and submitting/discarding reviews, plus UI for drafting/submitting reviews — indicating the PR implements push paths to GitHub.
Guardrails before pushing: ensure the working tree is clean and the local state matches the PR head (prevent mis-anchored/stale pushes, only push committed-scope comments). New git helper functions to read HEAD SHA and check working-tree cleanliness are added, and the runs/review layer and summary mention scope-key/commit-scope checks and push guardrails, indicating these safety checks are implemented server-side before writes to GitHub.
⚠️ Surface a clear result of what was pushed / skipped / failed to the user. The code adds a ReviewResponse model and routing plus UI feedback (toasts, submit popover), suggesting structured results are produced and surfaced. The diff provides some evidence but the exact shape and completeness of a per-comment pushed/skipped/failed report is not fully verifiable from the shown diffs (and the PR hasn’t been exercised against a live PR).
Mirror and sync thread resolution state (resolve/reopen threads mirrored between CLI and GitHub). Resolve/reopen flows are routed and wired into the GitHub review layer and the merged run review API, indicating thread resolution is synced.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/web/src/lib/use-view-state.ts Outdated
Comment thread packages/web/src/components/pull-request/review-panel.tsx
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/routes/comments.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aaf624e93f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/github/review.ts
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/github/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 11 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 105f8ac7a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/github/review.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2654445bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/web/src/lib/use-review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/web/src/lib/use-review.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 545fcf6f27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts
@dastratakos
dastratakos enabled auto-merge (squash) June 22, 2026 21:00
@dastratakos
dastratakos disabled auto-merge June 22, 2026 21:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c4afec41d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/github/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/cli/src/runs/review.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/cli/src/github/review.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b251314c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/github/review.ts Outdated
Comment thread packages/types/src/comments.ts
Comment thread packages/types/src/index.ts
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/web/src/components/pull-request/review-panel.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot found 2 unresolved medium-severity issues, review comments remain open, and this GitHub review sync change exceeds the medium approval threshold. Assigned reviewers charleslpan and onequbitaway for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor
cursor Bot requested a review from charleslpan July 28, 2026 01:24

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot found 2 unresolved medium-severity issues, review comments remain open, and this GitHub review sync change exceeds the medium approval threshold. Assigned reviewer charleslpan for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/web/src/components/comments/__tests__/comment-form.test.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17a288b156

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/web/src/lib/use-view-state.ts Outdated
Comment thread packages/cli/src/__tests__/review.routes.test.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/web/src/components/comments/comment-form.tsx
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/web/src/components/pull-request/review-panel.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment — not approving because Cursor Bugbot completed as skipped, two Bugbot findings remain unresolved, and this bidirectional GitHub sync + migration work is above the medium approval threshold. Human review is needed; assigning reviewers.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef39db990c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/web/src/components/comments/review-thread.tsx Outdated
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/github/review.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with unresolved findings, open review comments remain, and this GitHub comment-sync change exceeds the medium approval threshold. Assigned an additional reviewer; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with unresolved findings, open review comments remain, and this GitHub comment-sync change exceeds the medium approval threshold. Human review is needed; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Comment thread packages/cli/src/runs/review.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with an unresolved high-severity finding, Security Agent passed, and this GitHub comment-sync + migration work exceeds the medium approval threshold. Assigned an additional reviewer; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with an unresolved high-severity finding, Security Agent passed, and this GitHub comment-sync + migration work exceeds the medium approval threshold. Human review is needed; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09f4196086

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/web/src/components/comments/review-thread.tsx Outdated
Comment thread packages/cli/src/runs/review.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 22 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/web/src/components/comments/review-thread.tsx Outdated
Comment thread packages/web/src/components/pull-request/review-panel.tsx Outdated
Comment thread packages/cli/src/routes/comments.ts
Comment thread packages/cli/src/runs/review.ts
Comment thread packages/cli/src/runs/review.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with two unresolved findings, Security Agent passed, and open review comments remain on this high-risk GitHub comment-sync change. Assigned an additional reviewer; charleslpan was already requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with two unresolved findings, Security Agent passed, and open review comments remain on this high-risk GitHub comment-sync change. Human review is needed; charleslpan was already requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9181124fa5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/web/src/components/comments/review-thread.tsx Outdated
Comment thread packages/web/src/lib/use-review.ts Outdated
Comment thread packages/cli/src/runs/review.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 11 total unresolved issues (including 10 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7ba804c. Configure here.

Comment thread packages/cli/src/runs/review.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped with an unresolved finding, Security Agent passed, and this GitHub comment-sync + migration work exceeds the medium approval threshold. Assigned an additional reviewer; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ba804c81f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/web/src/lib/__tests__/use-review-reconciliation.test.tsx Outdated
Comment thread packages/cli/src/runs/review.ts Outdated
Comment thread packages/cli/src/runs/review.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped, Security Agent passed, and this GitHub comment-sync + migration work exceeds the medium approval threshold. Assigned an additional reviewer; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: high. Left a non-blocking comment (not approved): Cursor Bugbot completed as skipped, Security Agent passed, and this GitHub comment-sync + migration work exceeds the medium approval threshold. Human review is needed; charleslpan remains requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8cd3a4975

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +512 to +515
if (!remoteThread || !persistedRoot) {
clearPromotionProgress(db, localThreadId);
addedThread = null;
promotedReplyCount = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind promotion checkpoints to their pull request

When the same diff scope is associated with two PRs, an interrupted promotion started through PR A can be retried through a run targeting PR B. Because the persisted checkpoint contains only remote node IDs, this lookup searches B, treats the missing A thread as manual deletion, clears the checkpoint, and reposts the local thread to B while the original remains on A. Persist the repository and PR identity with the checkpoint and reject or resume recovery only against that target.

Useful? React with 👍 / 👎.

Comment on lines +252 to +255
<ResolveButton
isResolved={thread.isResolved}
onToggle={handleResolveToggle}
disabled={isGitHub && !canWriteToGitHub}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor GitHub's per-thread resolve permission

On an open, matching PR, a reviewer who neither authored the PR nor has repository write access can still get canWriteToGitHub: true, so this enables the resolve/reopen control even though GitHub denies that thread mutation. The click then reaches the server and surfaces as a 500. Load GitHub's per-thread resolve/unresolve capability and use it both to gate the UI and validate the route.

Useful? React with 👍 / 👎.

Comment on lines +227 to +231
const openDraft = useCallback(
(anchor: CommentDraft) => {
setDrafts((prev) => upsertDraft(prev, anchor, canPushToReview));
},
[canPushToReview],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hide the GitHub destination for lines outside the diff

When a file is expanded to show unchanged regions between hunks, Pierre still exposes the comment gutter on those lines, and this initializes every draft from the run-wide canPushToReview flag. The composer therefore offers and defaults to a pending GitHub comment even though GitHub cannot anchor a line review comment outside the PR diff, so submission fails after the user has written it; local threads created there also later offer an unusable promotion action. Determine GitHub eligibility from the selected anchor's actual hunk as well as the global review state.

Useful? React with 👍 / 👎.

className="rounded-xl border border-border bg-card transition-shadow has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-2 has-[textarea:focus-visible]:ring-ring/20"
textareaClassName="max-h-[12rem] overflow-y-auto"
previewClassName="max-h-[12rem] overflow-y-auto"
showSuggestion={activeDestination?.isGitHub === true}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hide suggested changes from reply composers

Every GitHub destination enables the suggestion toolbar, including the reply forms in ReviewThreadView. A reply does not carry its own diff-line anchor, so a suggestion block inserted there cannot be applied as a GitHub suggested change and is rendered as misleading comment content instead. Pass suggestion eligibility separately from destination type and enable it only for a new line-anchored root comment.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant