Skip to content

feat(container): integrate plugin interception into container resolution#12

Merged
markshust merged 1 commit intodevelopfrom
feature/plugin-update
Apr 5, 2026
Merged

feat(container): integrate plugin interception into container resolution#12
markshust merged 1 commit intodevelopfrom
feature/plugin-update

Conversation

@markshust
Copy link
Copy Markdown
Collaborator

@markshust markshust commented Apr 5, 2026

Summary

  • Wires PluginInterceptor into Container::resolve() so plugins actually intercept method calls on resolved objects — previously plugins were discovered and registered but never applied
  • Adds setPluginInterceptor() setter on Container (avoids circular dependency with PluginInterceptor needing ContainerInterface)
  • Wraps resolved instances with PluginProxy in both autowiring and closure binding code paths; singleton caching stores the proxy
  • Pre-registered instances via instance() are excluded from wrapping (explicit over implicit)
  • Adds PluginProxy::getPluginTarget() so reflection-based code (like Router) can inspect the real object
  • Router unwraps PluginProxy before reflecting on controller method parameters
  • Prevents plugins from targeting other plugin classes with a loud PluginException suggesting Preferences instead
  • 22 new tests covering container integration, end-to-end interception, and plugin-on-plugin validation

Test plan

  • All 4985 existing + new tests pass in parallel
  • Verified plugin discovery, proxy wrapping, and interception in MarkoTalk app
  • Confirmed X-Plugin-Intercepted header appears on proxied controller response
  • Verify MarkoTalk's MarkdownPlugin and MentionExtractorPlugin fire during message save

🤖 Generated with Claude Code

Wire PluginInterceptor into Container::resolve() so plugins actually
intercept method calls on resolved objects. Previously, plugins were
discovered and registered but never applied during resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 5, 2026
@markshust markshust merged commit 41c3301 into develop Apr 5, 2026
2 checks passed
@markshust markshust deleted the feature/plugin-update branch April 5, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant