Skip to content

improvement(integrations): validate and expand devin, cursor, and greptile#4820

Merged
waleedlatif1 merged 6 commits into
stagingfrom
waleedlatif1/validate-integration-endpoints
May 31, 2026
Merged

improvement(integrations): validate and expand devin, cursor, and greptile#4820
waleedlatif1 merged 6 commits into
stagingfrom
waleedlatif1/validate-integration-endpoints

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Devin: fixed a critical bug — every session endpoint was missing the required {org_id} path segment (all requests would 404). Added an orgId param across all tools and the block.
  • Devin: expanded from 4 to 11 session operations — list messages, list attachments, get/append/replace tags, archive, and terminate — plus cursor pagination (first/after, endCursor/hasNextPage/total) and is_archived output.
  • Devin: normalized array outputs to default [] (not null), added .trim() on all path IDs, tightened types, and added a NaN guard on numeric coercion.
  • Cursor: added get_api_key_info, list_models, and list_repositories tools (registered + block wiring).
  • Greptile: aligned block and docs.
  • Validated all three integrations against the live service API docs.

Type of Change

  • Bug fix
  • Improvement

Testing

Tested manually. Full tsc --noEmit passes (0 errors); biome clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ptile

- devin: fix missing org_id path segment on all session endpoints, add 7 session sub-resource tools (list messages/attachments, get/append/replace tags, archive, terminate), pagination, and is_archived output
- cursor: add get_api_key_info, list_models, list_repositories tools
- greptile: align block and docs
- normalize array outputs to default [] and tighten types
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 31, 2026 1:47am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 31, 2026

PR Summary

Medium Risk
Devin now requires orgId on all operations (breaking for existing workflows) and adds terminate/archive endpoints; otherwise integration and documentation changes with limited security surface.

Overview
Devin fixes broken API routing by inserting the required orgId into every /v3/organizations/{orgId}/... path (previously calls would fail). The block and all tools now require Organization ID, and coverage grows from four to eleven operations: list messages/attachments, get/append/replace tags, archive, and terminate—with cursor pagination (after, endCursor, hasNextPage, total), isArchived, safer numeric coercion, and normalized tags (string or array).

Cursor adds List Models, List Repositories, and Get API Key Info (legacy + v2 tools, block dropdowns, registry, docs, landing catalog). Artifact download metadata now includes base64 data in typed outputs.

Greptile updates branding to #5DE195 and deduplicates index/status sub-block fields in the block UI; docs match.

Docs (cursor, devin, greptile MDX) and integrations.json operation counts are updated accordingly.

Reviewed by Cursor Bugbot for commit a14e058. Configure here.

Comment thread apps/sim/blocks/blocks/devin.ts Outdated
Comment thread apps/sim/blocks/blocks/devin.ts Outdated
Comment thread apps/sim/tools/devin/append_session_tags.ts Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 31, 2026

Greptile Summary

This PR fixes a critical URL construction bug in the Devin integration (missing {org_id} path segment causing all requests to 404) and significantly expands all three integrations with new tools and improved schemas.

  • Devin: Added orgId param to all tools, corrected all endpoint URLs, expanded from 4 to 11 operations (list messages, attachments, get/append/replace tags, archive, terminate), added cursor pagination, and normalized array outputs from null to [].
  • Cursor: Added get_api_key_info, list_models, and list_repositories tools in both v1/v2 variants, wired into both the CursorBlock and CursorV2Block via the createVersionedToolSelector pattern.
  • Greptile: Deduplicated remote/repository/branch subblock definitions that were repeated for both index_repo and status operations into a single conditional definition.

Confidence Score: 5/5

Safe to merge — the critical 404 bug fix is correct, all new tools follow established patterns, and block/registry wiring is complete and consistent.

All Devin URL paths now correctly include the {org_id} segment. New tools for both Devin and Cursor are properly registered, exposed in the blocks, and their types, transforms, and pagination logic are consistent with the rest of the codebase. The NaN guard on numeric coercion and normalizeTags utility are clean additions. No logic errors or broken contracts found.

No files require special attention. list_session_attachments.ts has a minor dual-format response extraction that differs from sibling tools but is functionally safe.

Important Files Changed

Filename Overview
apps/sim/tools/devin/list_sessions.ts Switches response extraction from data.sessions to data.items (aligned with Devin's paginated API shape), adds after cursor param, and extends each session item with acusConsumed, pullRequests, playbookId, isArchived, statusDetail.
apps/sim/tools/devin/types.ts Adds orgId to all param interfaces, new param interfaces for 7 new tools, extended output property maps, and correct typed response interfaces including `statusDetail: string
apps/sim/tools/devin/utils.ts New utility normalizeTags cleanly handles both comma-separated string and string-array inputs; correctly filters empty strings after trim.
apps/sim/tools/devin/list_session_attachments.ts New tool for listing session attachments. Defensively handles both direct-array and {items:[]} response shapes; the dual-format check suggests some uncertainty about the API response structure.
apps/sim/tools/devin/list_session_messages.ts New paginated message listing tool; consistently uses data.items extraction and cursor pagination fields matching the list_sessions pattern.
apps/sim/tools/devin/terminate_session.ts New terminate tool using DELETE with optional archive query param; archive=true correctly omitted when false via the if (params.archive) guard.
apps/sim/tools/cursor/get_api_key_info.ts Adds v1/v2 get_api_key_info using Basic auth (consistent with other Cursor tools); uses a shared getApiKeyInfoBase object spread pattern matching the codebase convention.
apps/sim/tools/cursor/list_models.ts New v1/v2 list models tool following the shared-base spread pattern; v2 returns models[] directly, v1 wraps in {content, metadata}.
apps/sim/tools/cursor/list_repositories.ts New v1/v2 list repositories tool; v2 response type correctly typed as Array<{owner, name, repository}>.
apps/sim/blocks/blocks/devin.ts Block correctly wires all 11 tool operations; sessionId condition inverted to not: ['create_session', 'list_sessions'] elegantly covers all new session-scoped ops; terminateArchivearchive boolean conversion is correct.
apps/sim/blocks/blocks/cursor.ts V1 block dropdown updated with 3 new operations; V2 block inherits dropdown via ...CursorBlock spread and createVersionedToolSelector appends _v2 to map to correct tool IDs.
apps/sim/blocks/blocks/greptile.ts Deduplicates remote/repository/branch subblock definitions by merging conditions to ['greptile_index_repo', 'greptile_status']; removes duplicated status-operation blocks.
apps/sim/tools/registry.ts Correctly registers all 7 new Devin tools and 6 new Cursor tools (v1 + v2 pairs) under their expected string IDs.

Sequence Diagram

sequenceDiagram
    participant Block as Devin/Cursor Block
    participant Registry as Tool Registry
    participant Tool as Tool (e.g. devin_list_sessions)
    participant API as External API

    Block->>Registry: "lookup tool by `devin_${operation}` or `cursor_${operation}`"
    Registry-->>Block: ToolConfig

    Block->>Tool: params (incl. orgId, apiKey, sessionId, ...)
    Note over Tool: URL: /v3/organizations/${orgId}/sessions/${sessionId}

    Tool->>API: "GET/POST/PUT/DELETE request, Authorization: Bearer {apiKey}"
    API-->>Tool: "JSON response ({ items: [...], end_cursor, has_next_page, total })"

    Tool->>Tool: transformResponse() - normalize arrays, map snake_case to camelCase
    Tool-->>Block: "{ success: true, output: { sessions/messages/attachments, endCursor, hasNextPage } }"
Loading

Reviews (3): Last reviewed commit: "docs(integrations): regenerate tool docs..." | Re-trigger Greptile

Comment thread apps/sim/tools/devin/list_sessions.ts
Collapse the redundant `?? []` + `Array.isArray` double-guard into a
single Array.isArray check, per PR review feedback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tag inputs

- Only map sessionTags into the tools tags param for append/replace operations,
  preventing stale sessionTags state from clobbering create_session tags
- Fall back to a wired tags value when sessionTags is empty for tag operations
- Normalize tag inputs (string or wired string[]) via normalizeTags so array
  values from other blocks no longer throw on .split

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/devin.ts Outdated
Comment thread apps/sim/tools/cursor/download_artifact.ts
…adata

The legacy CursorBlock exposes only content + metadata (no v2 file
output), so metadata.data was the only way legacy-block workflows could
access downloaded artifact bytes. Restore the base64 data field and
document it in the outputs/type instead of dropping it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a14e058. Configure here.

@waleedlatif1 waleedlatif1 merged commit 20a8d85 into staging May 31, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/validate-integration-endpoints branch May 31, 2026 01:53
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