Skip to content

fix: ensure user providers are registered in the root scope for proper dependency resolution#424

Merged
frontegg-david merged 2 commits into
mainfrom
fix/403-providers-propagate-to-app
May 15, 2026
Merged

fix: ensure user providers are registered in the root scope for proper dependency resolution#424
frontegg-david merged 2 commits into
mainfrom
fix/403-providers-propagate-to-app

Conversation

@frontegg-david
Copy link
Copy Markdown
Contributor

@frontegg-david frontegg-david commented May 14, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed provider registration to ensure user-declared providers are correctly registered and discoverable throughout the application scope hierarchy.
  • Tests

    • Added regression test suite for provider propagation, covering provider resolution and scope compatibility.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8522385-99f0-443d-87b4-994695bc8d40

📥 Commits

Reviewing files that changed from the base of the PR and between 0f0da91 and 9829dc9.

📒 Files selected for processing (2)
  • libs/sdk/src/scope/__tests__/scope-providers-propagation.spec.ts
  • libs/sdk/src/scope/scope.instance.ts

📝 Walkthrough

Walkthrough

This PR fixes provider registration ordering in the Scope constructor to ensure user-declared providers don't accidentally shadow framework defaults, and adds a comprehensive regression test suite validating provider propagation behavior and framework default protection.

Changes

Provider Propagation and Framework Default Protection

Layer / File(s) Summary
Provider ordering fix in Scope constructor
libs/sdk/src/scope/scope.instance.ts
ProviderRegistry initialization now includes user-declared providers before framework defaults, relying on last-write-wins semantics to ensure framework bindings are not shadowed.
Regression test suite for provider propagation and framework protection
libs/sdk/src/scope/__tests__/scope-providers-propagation.spec.ts
Test suite validates user-declared class and factory providers are resolvable from root scope, back-compat when no providers specified, and critically that user providers cannot override framework defaults like FrontMcpLogger.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A rabbit hops through scopes so deep,
Where providers wake from ordered sleep,
User first, then frameworks stand,
Last one wins, by gentle hand,
Tests confirm the dance is right,
No shadowing in the light! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main fix: ensuring user providers are registered in the root scope for proper dependency resolution, which aligns with the core changes in scope.instance.ts and the regression test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 fix/403-providers-propagate-to-app

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Performance Test Results

Status: ✅ All tests passed

Summary

Project Tests Passed Warnings Failed Leaks
✅ demo-e2e-agents 4 4 0 0 0
✅ demo-e2e-cache 11 11 0 0 0
✅ demo-e2e-codecall 4 4 0 0 0
✅ demo-e2e-config 4 4 0 0 0
✅ demo-e2e-direct 3 3 0 0 0
✅ demo-e2e-elicitation 1 1 0 0 0
✅ demo-e2e-errors 4 4 0 0 0
✅ demo-e2e-hooks 3 3 0 0 0
✅ demo-e2e-multiapp 4 4 0 0 0
✅ demo-e2e-notifications 3 3 0 0 0
✅ demo-e2e-openapi 2 2 0 0 0
✅ demo-e2e-providers 4 4 0 0 0
✅ demo-e2e-public 4 4 0 0 0
✅ demo-e2e-redis 15 15 0 0 0
✅ demo-e2e-remember 4 4 0 0 0
✅ demo-e2e-remote 5 5 0 0 0
✅ demo-e2e-serverless 2 2 0 0 0
✅ demo-e2e-skills 15 15 0 0 0
✅ demo-e2e-standalone 2 2 0 0 0
✅ demo-e2e-transport-recreation 3 3 0 0 0
✅ demo-e2e-ui 4 4 0 0 0

Total: 101 tests across 21 projects

📊 View full report in workflow run


Generated at: 2026-05-15T00:55:01.221Z
Commit: 97e2f9e5

@frontegg-david frontegg-david merged commit 8d00d19 into main May 15, 2026
32 checks passed
@frontegg-david frontegg-david deleted the fix/403-providers-propagate-to-app branch May 15, 2026 01:00
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.

@FrontMcp({ providers: [...] }) providers don't propagate to @App tools / resources

1 participant