Skip to content

Provide remote connector tools to package workflows - #433

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/package-workflow-connector-tools-081d
May 10, 2026
Merged

kentcdodds merged 1 commit into
mainfrom
cursor/package-workflow-connector-tools-081d

Conversation

@kentcdodds

@kentcdodds kentcdodds commented May 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Restore attached remote connector refs when dynamic package workflows execute inline code or package exports.
  • Thread connector refs through package invocation caller contexts so codemode can synthesize connector tools such as Bond shade controls.
  • Add regression coverage for inline/package workflow connector propagation and package export caller contexts.

Testing

  • npx vitest run packages/worker/src/package-runtime/package-workflows.node.test.ts packages/worker/src/package-invocations/service.node.test.ts --config vitest.node.config.ts
  • npm run format:check
  • npm run typecheck
  • npm run lint
Open in Web Open in Cursor 

Summary by CodeRabbit

Release Notes

  • New Features

    • Remote connectors now propagate through package invocations, enabling them in saved package exports and inline workflow execution.
    • Attached remote connectors are automatically restored and available during package and workflow execution.
  • Tests

    • Added smoke tests to verify remote connector propagation in workflow execution paths.

Review Change Stack

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented May 10, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c7c4df9c-3b1d-492d-bf37-3fea944401af

📥 Commits

Reviewing files that changed from the base of the PR and between 51042c7 and 720b136.

📒 Files selected for processing (4)
  • packages/worker/src/package-invocations/service.node.test.ts
  • packages/worker/src/package-invocations/service.ts
  • packages/worker/src/package-runtime/package-workflows.node.test.ts
  • packages/worker/src/package-runtime/package-workflows.ts

📝 Walkthrough

Walkthrough

This PR adds support for propagating user-attached remote connectors through package invocation execution. Remote connectors are fetched from user settings at workflow entry points and threaded through invocation service types, MCP caller context, and nested package invoke tools.

Changes

Remote Connectors Propagation

Layer / File(s) Summary
Type System & Data Contract
packages/worker/src/package-invocations/service.ts
PackageInvocationTokenScope and PackageInvocationActor are extended with optional remoteConnectors?: Array<RemoteConnectorRef> field.
MCP Caller Context Wiring
packages/worker/src/package-invocations/service.ts
remoteConnectors from actor context are passed into createMcpCallerContext for MCP tool initialization.
Nested Package Invocation Tools
packages/worker/src/package-invocations/service.ts
remoteConnectors flow through nested packages.invoke tool creation and into invokePackageExportForPackageRuntime for recursive package calls.
Token-based External Invocation
packages/worker/src/package-invocations/service.ts
remoteConnectors from token scope are passed into invokePackageExport for external package invocation.
Workflow Entry Point Wiring
packages/worker/src/package-runtime/package-workflows.ts
safelyListAttachedRemoteConnectorRefs fetches user-attached connectors at workflow execution entry points and wires them into both package export invocation and inline code execution.
Test Coverage
packages/worker/src/package-invocations/service.node.test.ts, packages/worker/src/package-runtime/package-workflows.node.test.ts
Tests mock remote connector settings, verify remoteConnectors are supplied to invocation factories, and assert propagation through inline code and package export execution paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • kentcdodds/kody#423: Both PRs modify package invocation service wiring to propagate additional invocation context (remoteConnectors vs. runtimeDebug).
  • kentcdodds/kody#275: PR #275 introduces the external invokePackageExport API and token types; this PR extends those token types to propagate remoteConnectors.
  • kentcdodds/kody#429: Both PRs modify package invocation service to extend invocation context wiring—PR #429 adds runtime package-invoke tooling, and this PR propagates remoteConnectors into those same tools and contexts.

Poem

A rabbit's burrow grows with care,
Remote connectors thread the air,
Through tokens, workflows, MCP flows—
How far the connection goes! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: providing remote connector tools to package workflows, which aligns with the core objective of threading connector refs through the system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/package-workflow-connector-tools-081d

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@kentcdodds
kentcdodds marked this pull request as ready for review May 10, 2026 16:07
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-433.kentcdodds.workers.dev

Worker: kody-pr-433
D1: kody-pr-433-db
KV: kody-pr-433-oauth-kv

Mocks:

@kentcdodds
kentcdodds merged commit 6c44480 into main May 10, 2026
8 checks passed
@kentcdodds
kentcdodds deleted the cursor/package-workflow-connector-tools-081d branch May 10, 2026 16:12
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.

2 participants