fix: improve Devin check status with session URL and blocked state handling#2081
Conversation
…ndling
- Add Devin session URL to check summary for easy access from GitHub check page
- Add isDevinSessionActive helper to handle both 'working' and 'blocked' states consistently
- Update devin-status.ts to use isDevinSessionActive instead of isDevinSessionWorking
- Show appropriate title ('Devin is working' vs 'Devin is blocked') based on session state
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughA new function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
apps/bot/src/devin/poller.ts (1)
214-246: Centralize Devin session URL construction to avoid duplicationThe same URL pattern is now built in several places (e.g., Lines 214, 226, 238, 342, 390 and again in
updateCheckStatusat Line 484). This is correct but a bit brittle if the base host/path ever changes.Consider extracting a small helper in this module (or a shared Devin utility) so all call sites share one implementation:
+function getDevinSessionUrl(sessionId: string): string { + return `https://app.devin.ai/sessions/${sessionId}`; +} @@ - const sessionUrl = `https://app.devin.ai/sessions/${session.session_id}`; + const sessionUrl = getDevinSessionUrl(session.session_id); @@ - const sessionUrl = `https://app.devin.ai/sessions/${session.session_id}`; + const sessionUrl = getDevinSessionUrl(session.session_id); @@ - const sessionUrl = `https://app.devin.ai/sessions/${session.session_id}`; + const sessionUrl = getDevinSessionUrl(session.session_id); @@ - const sessionUrl = `https://app.devin.ai/sessions/${pr.sessionId}`; + const sessionUrl = getDevinSessionUrl(pr.sessionId); @@ - const sessionUrl = `https://app.devin.ai/sessions/${session.session_id}`; + const sessionUrl = getDevinSessionUrl(session.session_id); @@ - const details_url = `https://app.devin.ai/sessions/${sessionId}`; + const details_url = getDevinSessionUrl(sessionId);This keeps the behavior identical while making future URL changes one‑line.
Also applies to: 342-376, 390-443, 484-485
apps/bot/src/devin/detail.ts (1)
49-54: Confirm the intended definition of “active” session states
isDevinSessionActivecurrently treats onlyWorkingandBlockedas active, excludingResumed/ResumeRequested*states even though they’re present inDevinSessionStatus.If that matches product semantics, this is perfect. If those additional states should still drive active/visible status (e.g., a resumed session that’s effectively working), you may want to include them here to keep all call sites consistent.
apps/bot/src/features/devin-status.ts (1)
61-63: Good blocked handling; consider reusing a shared session URL helperThe change to gate on
isDevinSessionActive(detail)and then distinguish blocked vs working for title/summary looks solid and aligns with the new “blocked” UX.As in
poller.ts, the Devin session URL is built inline:const sessionUrl = `https://app.devin.ai/sessions/${session.session_id}`;Since the same pattern is now used in multiple modules (and also inside
updateCheckStatus), consider reusing a small helper (e.g.,getDevinSessionUrl(sessionId)) exported from the Devin module so bothdevin-status.tsandpoller.tsstay in sync with a single source of truth.Also applies to: 78-93
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/bot/src/devin/detail.ts(1 hunks)apps/bot/src/devin/poller.ts(9 hunks)apps/bot/src/features/devin-status.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces
Files:
apps/bot/src/devin/detail.tsapps/bot/src/devin/poller.tsapps/bot/src/features/devin-status.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/bot/src/devin/detail.tsapps/bot/src/devin/poller.tsapps/bot/src/features/devin-status.ts
🧬 Code graph analysis (2)
apps/bot/src/devin/poller.ts (1)
apps/bot/src/devin/detail.ts (2)
DevinSessionStatus(4-14)DevinSessionStatus(16-17)
apps/bot/src/features/devin-status.ts (2)
apps/bot/src/devin/detail.ts (3)
isDevinSessionActive(49-54)DevinSessionStatus(4-14)DevinSessionStatus(16-17)apps/bot/src/github/check.ts (1)
createOrUpdateCheck(9-34)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Redirect rules - hyprnote
- GitHub Check: Header rules - hyprnote
- GitHub Check: Pages changed - hyprnote
- GitHub Check: fmt
- GitHub Check: ci
- GitHub Check: Devin
fix: add Devin session URL to check summary and handle blocked state
Summary
Addresses two complaints about the "Devin is working" GitHub check:
Session URL not easily accessible: The "View details" button on GitHub's check page goes to GitHub's check run page, not the Devin session. This PR adds the session URL directly to the check summary so it's visible and clickable when viewing the check details.
Blocked sessions not tracked: Previously,
checkDevinSessiononly tracked sessions withstatus_enum === "working", but the poller'sdiscoverExistingDevinPRstracked both "working" and "blocked". This inconsistency meant blocked sessions might not get a check created. Now both use the same criteria via a newisDevinSessionActive()helper.Note: The "stale status" issue may have operational causes (bot not running, API failures) that this code change cannot address. However, adding the session URL helps users verify the actual session status directly.
Review & Testing Checklist for Human
https://app.devin.ai/sessions/{id}is correct and will auto-link in GitHub's check summaryNotes
details_urlwe set appears as a separate link on that page.