fix(mcp): resolve userId before JWT generation for agent block auth#3932
fix(mcp): resolve userId before JWT generation for agent block auth#3932waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds a unit test that mocks Reviewed by Cursor Bugbot for commit f182eb5. Configure here. |
Greptile SummaryThis PR fixes a bug where MCP tools called from Agent blocks would fail authentication because Key changes:
Confidence Score: 5/5Safe to merge — the fix is correct, minimal, and well-tested with a focused regression test. The change is a 3-line reorder with no new logic: moving resolveToolScope above JWT generation so the fallback to params._context.userId is exercised. The regression test directly validates the fixed behavior. No P0/P1 concerns remain. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "test(mcp): add regression test for agent..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ 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 f182eb5. Configure here.
…3932) * fix(mcp): resolve userId before JWT generation for agent block auth * test(mcp): add regression test for agent block JWT userId resolution
Summary
executeMcpToolwas relying on that fallback whenexecutionContextisn't passed (agent block path)params._context.userId) before generating the JWT token, so userId is embedded in the token itselfFixes #3922
Type of Change
Testing
Tested manually
Checklist