Skip to content

fix: improve Devin check status with session URL and blocked state handling#2081

Merged
yujonglee merged 1 commit into
mainfrom
devin/1764723239-fix-devin-check-status
Dec 3, 2025
Merged

fix: improve Devin check status with session URL and blocked state handling#2081
yujonglee merged 1 commit into
mainfrom
devin/1764723239-fix-devin-check-status

Conversation

@yujonglee
Copy link
Copy Markdown
Contributor

@yujonglee yujonglee commented Dec 3, 2025

fix: add Devin session URL to check summary and handle blocked state

Summary

Addresses two complaints about the "Devin is working" GitHub check:

  1. 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.

  2. Blocked sessions not tracked: Previously, checkDevinSession only tracked sessions with status_enum === "working", but the poller's discoverExistingDevinPRs tracked both "working" and "blocked". This inconsistency meant blocked sessions might not get a check created. Now both use the same criteria via a new isDevinSessionActive() 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

  • Verify the session URL format https://app.devin.ai/sessions/{id} is correct and will auto-link in GitHub's check summary
  • Confirm that tracking blocked sessions (in addition to working) is the desired behavior
  • Test with a real PR that has an active Devin session to verify the URL appears in the check summary
  • Monitor bot logs after deployment to ensure the poller is running and updating check statuses correctly

Notes

…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-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 3, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit e43f1cc
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/692f8b8c2eb62a0008bd88c6
😎 Deploy Preview https://deploy-preview-2081--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 3, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit e43f1cc
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692f8b8c4959f2000816cd06
😎 Deploy Preview https://deploy-preview-2081--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 3, 2025

📝 Walkthrough

Walkthrough

A new function isDevinSessionActive() is added to identify sessions in Working or Blocked status. Session URLs are appended to Devin session status update summaries across multiple branches. The devin-status feature is updated to use the new active-state function and include session URLs in status details.

Changes

Cohort / File(s) Summary
Devin session state detection
apps/bot/src/devin/detail.ts
New public function isDevinSessionActive() returns true for Working or Blocked status states.
Session URL integration in status updates
apps/bot/src/devin/poller.ts
Session URLs in format https://app.devin.ai/sessions/{session_id} are constructed and appended to status summaries across Finished, Expired, and generic ended status branches.
Devin status feature update
apps/bot/src/features/devin-status.ts
Replaces isDevinSessionWorking with isDevinSessionActive; adds blocked state detection using DevinSessionStatus.Blocked; derives sessionUrl from session_id and uses it as details_url; updates output to distinguish "Devin is blocked" title and blocked vs. working summaries with appended session URL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify that all relevant status branches in poller.ts consistently include the session URL pattern
  • Confirm the blocked state logic in devin-status.ts correctly maps to DevinSessionStatus.Blocked
  • Ensure the new isDevinSessionActive() function signature matches all call sites in devin-status.ts

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding session URL to Devin check status and implementing blocked state handling.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about why the changes were made and what they address.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1764723239-fix-devin-check-status

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/bot/src/devin/poller.ts (1)

214-246: Centralize Devin session URL construction to avoid duplication

The same URL pattern is now built in several places (e.g., Lines 214, 226, 238, 342, 390 and again in updateCheckStatus at 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

isDevinSessionActive currently treats only Working and Blocked as active, excluding Resumed / ResumeRequested* states even though they’re present in DevinSessionStatus.

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 helper

The 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 both devin-status.ts and poller.ts stay 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9034f2a and e43f1cc.

📒 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.ts
  • apps/bot/src/devin/poller.ts
  • apps/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, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/bot/src/devin/detail.ts
  • apps/bot/src/devin/poller.ts
  • apps/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

@yujonglee yujonglee merged commit 779951b into main Dec 3, 2025
13 of 14 checks passed
@yujonglee yujonglee deleted the devin/1764723239-fix-devin-check-status branch December 3, 2025 01:16
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