Skip to content

fix(mcp): delete the McpContext copy nothing here can load - #24

Merged
Snider merged 1 commit into
mainfrom
fix/delete-shadowed-mccontext
Aug 8, 2026
Merged

fix(mcp): delete the McpContext copy nothing here can load#24
Snider merged 1 commit into
mainfrom
fix/delete-shadowed-mccontext

Conversation

@Snider

@Snider Snider commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Pairs with dAppCore/mcp#22, which takes the methods and every test first. Behaviour exists in one place before it stops existing here.

The reference check

php/Mcp/Transport/McpContext.php and its McpToolHandler contract declare Core\Front\Mcp\McpContext and Core\Front\Mcp\Contracts\McpToolHandlera namespace this package maps nowhere. composer.json declares Core\Mcp\, Core\Mod\Agentic\ and Core\Service\Agentic\, and nothing else:

php -r 'require "vendor/autoload.php"; var_dump(class_exists("Core\Front\Mcp\McpContext"));'
bool(false)

Their tests only ran because they hand-loaded the files:

mcpRequire('Mcp/Transport/McpContext.php');

That is the third manual-require-around-broken-autoload found in this repo today, after loadAgenticPhpClass() and LivewireTestCase::livewireComponent(). The pattern is reliable evidence that a file cannot be reached the normal way.

dappcore/mcp declares the same two FQCNs and, unlike this package, actually maps them — so in any consumer application mcp's copies are what load. Two packages owning one class name is settled by autoload order, silently, and this side lost twice over: shadowed where both were installed, unloadable where only this one was.

Nothing else touches them. Worth stating: the fifty-odd other toMcpContext hits in this repo are a model method of the same name on AgentPlan, BrainMemory and friends — unrelated, and a careless grep would have read them as callers.

What moved before this deletes

Agent's copy carried getScopes() and hasScope() that mcp's lacked. Those and every test in both files went to mcp#22 — 12 tests, where that package previously had none for this class.

That PR also fixes a property_exists() visibility bug in the scope helpers, which is why four of the eight McpContextTest cases removed here were failing rather than passing.

Verification

result
suite 127 failed, 1190 passed
main (freshly measured) 131 failed, 1197 passed
delta 11 tests removed, 4 of them failing; nothing else changed

Baseline taken fresh rather than reused — an earlier stale-baseline comparison in this sequence produced a wrong claim I had to correct, so the number here is from a run of main today.

🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io

php/Mcp/Transport/McpContext.php and its McpToolHandler contract declared
Core\Front\Mcp\McpContext and Core\Front\Mcp\Contracts\McpToolHandler — a
namespace this package maps nowhere. composer.json declares Core\Mcp\,
Core\Mod\Agentic\ and Core\Service\Agentic\, and nothing else, so
class_exists('Core\Front\Mcp\McpContext') is false here and always has been.

Their tests only ran because they hand-loaded the files:

    mcpRequire('Mcp/Transport/McpContext.php');

which is the third manual-require-around-broken-autoload found in this repo
today, after loadAgenticPhpClass() and LivewireTestCase::livewireComponent().
The pattern is reliable evidence that a file cannot be reached the normal way.

dappcore/mcp declares the same two FQCNs and, unlike this package, actually
maps them — so in any consumer application mcp's copies are what load. Two
packages owning one class name is settled by autoload order, silently, and this
side lost twice over: shadowed where both were installed, unloadable where only
this one was.

The reference check found nothing else touching them. The fifty-odd other
toMcpContext hits in this repo are a model method of the same name on
AgentPlan, BrainMemory and friends — unrelated, and worth stating because a
careless grep would have read them as callers.

Agent's copy carried getScopes() and hasScope() that mcp's lacked. Those, and
every test in both files, moved to dAppCore/mcp#22 first, so the behaviour
exists in one place before it stops existing here. That PR also fixes a
property_exists() visibility bug in the scope helpers, which is why four of the
eight McpContextTest cases removed here were failing rather than passing.

Suite 127 failed / 1190 passed, from 131 / 1197 on a freshly measured main —
eleven tests removed, of which four were failing, and no other change.

Co-Authored-By: Virgil <virgil@lethean.io>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Snider, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e023ddd9-618c-4952-83bb-dff980a90e09

📥 Commits

Reviewing files that changed from the base of the PR and between 8b966a3 and 4608ab7.

📒 Files selected for processing (4)
  • php/Mcp/Transport/Contracts/McpToolHandler.php
  • php/Mcp/Transport/McpContext.php
  • php/tests/Feature/Mcp/Transport/McpContextTest.php
  • php/tests/Feature/Mcp/Transport/McpToolHandlerTest.php

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Snider
Snider merged commit e9ded30 into main Aug 8, 2026
6 of 8 checks passed
@Snider
Snider deleted the fix/delete-shadowed-mccontext branch August 8, 2026 12:39
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