Skip to content

fix: resolve codemode providers before executor execution - #54

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/codemode-provider-resolution-1e28
Mar 26, 2026
Merged

kentcdodds merged 2 commits into
mainfrom
cursor/codemode-provider-resolution-1e28

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Mar 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • resolve the codemode capability registry into a ResolvedProvider before calling executor.execute()
  • keep the existing codemode namespace behavior while removing the deprecated raw function path

Testing

  • npm exec -- tsc -p tsconfig.json --noEmit
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Refactor
    • Improved internal codemode provider architecture to enhance handler function management and execution flow.

@coderabbitai

coderabbitai Bot commented Mar 26, 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

Run ID: b4c0289c-e8aa-417c-8445-a1ec2cfe6583

📥 Commits

Reviewing files that changed from the base of the PR and between 8d04436 and 56ffa05.

📒 Files selected for processing (1)
  • packages/worker/src/mcp/run-codemode-registry.ts

📝 Walkthrough

Walkthrough

A new buildCodemodeProvider function extracts registry-derived capability handlers into a normalized ToolProvider named "codemode". The runCodemodeWithRegistry function is refactored to use this resolved provider instead of a raw functions map during execution.

Changes

Cohort / File(s) Summary
MCP Provider Refactoring
packages/worker/src/mcp/run-codemode-registry.ts
Introduced new buildCodemodeProvider function that converts registry handler functions into a normalized ToolProvider. Updated runCodemodeWithRegistry to invoke the resolved provider instead of using a raw functions map.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A provider is born from the registry's care,
Tools wrapped and normalized, handlers laid bare,
Old functions transform to a structure so clean,
The finest refactor this bunny has seen! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: resolving codemode providers before executor execution, which aligns with the primary objective and code modifications.

✏️ 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/codemode-provider-resolution-1e28

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

Copy link
Copy Markdown
Owner Author

@cursoragent delete the test

@cursor

cursor Bot commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Deleted the codemode registry regression test per the GitHub instruction and removed its Vitest include entry, while keeping the runtime provider-resolution fix intact. run-codemode-registry.ts:1-64 vitest.node.config.ts:29-44
  • Committed the removal as d3a4531 and pushed it to the PR branch.

Testing

  • ✅ npm exec -- tsc -p tsconfig.json --noEmit — re-ran typecheck after removing the test to confirm the remaining implementation still compiles cleanly.
  • ✅ git status --short && git log -2 --oneline — verified the new removal commit is on the branch; the only leftover uncommitted item is the unrelated untracked bun.lock.
  • I did not perform manual testing because this follow-up only removed automated test coverage and left the server-side implementation unchanged; a targeted compile check was the highest-signal validation for this request.
Open in Web Open in Cursor 

cursoragent and others added 2 commits March 26, 2026 03:28
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor
cursor Bot force-pushed the cursor/codemode-provider-resolution-1e28 branch from d3a4531 to 56ffa05 Compare March 26, 2026 03:28
@kentcdodds
kentcdodds marked this pull request as ready for review March 26, 2026 04:02
@kentcdodds
kentcdodds merged commit 2de6157 into main Mar 26, 2026
13 of 16 checks passed
@kody-bot
kody-bot deleted the cursor/codemode-provider-resolution-1e28 branch March 29, 2026 20:43
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