Skip to content

🤖 feat: notify workspaces about GitHub pull request reviews - #3851

Open
coadler wants to merge 6 commits into
mainfrom
notifications-r9mc
Open

🤖 feat: notify workspaces about GitHub pull request reviews#3851
coadler wants to merge 6 commits into
mainfrom
notifications-r9mc

Conversation

@coadler

@coadler coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add opt-in GitHub pull request review notifications for repository-backed workspaces.
The service delivers new submitted reviews through the workspace chat.

Background

Users need review updates without manual refresh.
The experiment and workspace setting keep this feature disabled by default.

Implementation

  • Add the github-pr-review-notifications experiment.
  • Add a workspace setting, menu toggle, and keyboard shortcut.
  • Hide the setting for SSH, Docker, and multi-project devcontainer runtimes.
  • Poll gh pr view --json number,url,reviews from eligible workspace runtimes.
  • Skip stopped devcontainers and unsupported remote runtimes.
  • Persist review checkpoints in each workspace session directory.
  • Establish a baseline for existing reviews and reviews posted while disabled.
  • Keep reviews pending until a provider stream registers successfully.
  • Retry pending reviews after a process restart before stream registration.
  • Treat aborted or unregistered startup as a retryable failure.
  • Queue one synthetic chat turn for new submitted reviews.
  • Use turn-end dispatch so active provider calls can finish.
  • Resolve the selected agent and model settings for each notification.
  • Remove queued review turns when the setting is disabled.
  • Retry canceled and failed notification batches.
  • Mark GitHub review text as external content.

Validation

  • make static-check
  • Targeted notification, queue, agent session, runtime, and workspace menu tests.
  • git diff --check

Risks

  • Polling runs every 30 seconds for enabled workspaces.
  • A crash after provider stream startup can cause one duplicate notification.
  • The feature requires authenticated gh access in eligible runtimes.
  • Remote, stopped, and multi-project devcontainer runtimes do not start for polling.
  • The experiment remains disabled by default.

Pains

  • Queue callbacks and durable checkpoints require ordered writes.
  • Runtime polling must not start stopped infrastructure.

Generated with mux • Model: openai:gpt-5.6-luna • Thinking: max • Cost: $16.46

@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the complete pull request.

@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: 2630d4403f

ℹ️ 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 src/node/services/githubReviewNotificationService.ts Outdated
Comment thread src/node/services/githubReviewNotificationService.ts Outdated
Comment thread src/node/services/githubReviewNotificationService.ts Outdated
Comment thread src/browser/components/WorkspaceMenuBar/WorkspaceMenuBar.tsx Outdated
Comment thread src/browser/components/WorkspaceMenuBar/WorkspaceMenuBar.tsx Outdated
@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed all five Codex findings in commit 0a5af97e.

  • PRRT_kwDOPxxmWM6ZK1Ba: The GitHub query no longer converts every command failure into no-pr. The service clears a checkpoint only after an explicit no-pull-request error. Transient network and authentication errors preserve the checkpoint.
  • PRRT_kwDOPxxmWM6ZK1Be: Review sends now use getGoalContinuationKickoffSendOptions(). This resolves the selected agent, model, thinking level, reasoning mode, and configured fallbacks.
  • PRRT_kwDOPxxmWM6ZK1Bg: Each workspace poll runs inside its own try/catch. One workspace failure no longer stops later workspaces.
  • PRRT_kwDOPxxmWM6ZK1Bj: Added Ctrl+Alt+G on Windows and Linux, or Cmd+Option+G on macOS. The shortcut appears in Settings and in the toggle label. The label hides on touch mobile screens.
  • PRRT_kwDOPxxmWM6ZK1Bv: Removed manual useCallback memoization from the new handler. The global shortcut reads the latest handler through a ref.

Validation passed:

  • make static-check
  • Focused notification and workspace menu tests
  • git diff --check

@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

The five review findings are addressed in commit 0a5af97e.
Please review the latest push.

@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: 0a5af97edb

ℹ️ 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 src/node/services/githubReviewNotificationService.ts
Comment thread src/node/services/workspaceService.ts
Comment thread src/browser/utils/ui/keybinds.ts Outdated
@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the three new Codex findings in commit a48c3667.

  • PRRT_kwDOPxxmWM6ZLBQb: GitHub polling now skips stopped devcontainers and all remote or Docker runtimes without a passive status probe. Local and worktree runtimes still poll. This prevents executeBash() from starting stopped infrastructure.
  • PRRT_kwDOPxxmWM6ZLBQh: Disabling the workspace setting now removes queued GitHub review entries by dedupe-key prefix. The existing cancellation callback releases the in-flight batch while keeping durable pending reviews for retry after re-enable.
  • PRRT_kwDOPxxmWM6ZLBQl: The shortcut now matches physical KeyG, so macOS Option key mapping does not break Cmd+Option+G.

Validation passed:

  • make static-check
  • Focused notification, queue, and workspace menu tests
  • git diff --check

@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

The three latest findings are addressed in commit a48c3667.
Please review the latest push.

@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: a48c366702

ℹ️ 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 src/node/services/githubReviewNotificationService.ts
Comment thread src/node/services/githubReviewNotificationService.ts
Comment thread src/node/services/workspaceService.ts
@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the three new findings in commit 02472b17.

  • Roll back accepted review IDs when provider startup fails before streaming.
  • Recheck the current setting and reset the workspace baseline before sending.
  • Reset durable review state when notifications are disabled.

Validation passed:

  • make static-check
  • Targeted notification, queue, and workspace menu tests
  • git diff --check

@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: 02472b1722

ℹ️ 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 src/node/services/githubReviewNotificationService.ts Outdated
Comment thread src/node/services/githubReviewNotificationService.ts
@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the two latest findings in commit b173a64b8.

  • Hide the review notification control and keyboard shortcut for SSH and Docker runtimes. The poller also fails closed for unsupported runtimes.
  • Keep reviews in durable pendingReviews until provider stream startup succeeds. A new onStreamStarted callback moves them to knownReviewIds, so a process restart before stream startup retries the full review payload.

Validation passed:

  • make static-check
  • Targeted notification, queue, agent session, and workspace menu tests
  • git diff --check

@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

The two latest findings are addressed in b173a64b8.
Please review the updated runtime gating and stream-start delivery flow.

@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: b173a64b8a

ℹ️ 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 src/node/services/agentSession.ts Outdated
Comment thread src/common/types/runtime.ts Outdated
@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the two latest findings in commit 9f4b9bcd5.

  • Confirm AIService.isStreaming(workspaceId) before invoking onStreamStarted. Treat a successful but unregistered startup as retryable.
  • Exclude multi-project devcontainers from review polling and hide their toggle. The passive status probe covers only one container, while multi-project execution can start every project runtime.

Validation passed:

  • make static-check
  • Targeted notification, queue, agent session, runtime, and workspace menu tests
  • git diff --check

@coadler

coadler commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

The latest Codex findings are addressed in 9f4b9bcd5.
Please review the stream registration guard and the multi-project devcontainer gate.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 9f4b9bcd5b

ℹ️ 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".

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