Refresh pull request status when turns complete - #1025
Conversation
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
I am SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and end-to-end behavior.
Stack: #1025 — Refresh pull request status when turns complete.
I found no later pull requests in this stack. I skipped no pull requests.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Security review complete.
I found no security issues. The realtime event type has schema validation. The existing pull request route keeps its environment and workspace checks.
The change adds no new wire field, command input, data exposure, or cache write. It only invalidates an existing query after a completed turn.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Code-quality review complete.
I found one medium cache-scope issue. A sidebar pull request observer can exist without a cached thread-detail query.
The handler then cannot find the environment. The sidebar pull request badge stays stale after a completed turn.
I also confirmed one formatting issue. Prettier reports the changed registry file.
The focused test and the app type check pass.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Performance review complete.
I found no blocking performance issue. The handler uses one exact query key and causes no request without an active observer.
One low-cost concern remains. Each completed turn can run a GitHub lookup for a merged or closed pull request.
A burst from threads in one environment can also repeat the same invalidation. A later cache change should keep one request per environment.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
End-to-end review complete.
I opened the live app at the reviewed SHA. I sent a follow-up through the browser composer.
The browser received the turn/completed realtime message. It sent the environment pull request request one millisecond later.
The interface showed pull request #1025. The tested thread-detail flow passed.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Review result: one medium issue and one low issue.
- Medium: The handler reads only the thread-detail cache. A sidebar observer can exist without that cache entry.
- The sidebar pull request badge can stay stale for an unopened thread or a sibling thread.
- Low: Prettier reports the changed registry file.
- Performance: No blocking issue exists. Settled pull requests and shared environments can still cause extra GitHub lookups.
- Security: I found no security issue.
The main thread-detail flow passed the browser test. A turn/completed message caused a pull request request one millisecond later.
The focused test passed all 40 cases. The Turbo app type check passed.
Use the existing cached thread-list helper for the environment fallback. This avoids a new cache search pattern.
I recommend that the author add the fallback and run Prettier before merge.
Summary
gh pr createValidation
pnpm exec turbo run test --filter=@bb/app --force(312 files, 2,346 tests passed)pnpm exec turbo run typecheck --filter=@bb/appgit diff --check