Skip to content

refactor(gateway): decouple extension tool wiring via IAgentToolContributor#146

Merged
sytone merged 4 commits into
mainfrom
refactor/gateway-extension-decoupling
May 5, 2026
Merged

refactor(gateway): decouple extension tool wiring via IAgentToolContributor#146
sytone merged 4 commits into
mainfrom
refactor/gateway-extension-decoupling

Conversation

@sytone

@sytone sytone commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

Removes compile-time \ProjectReference\ from \BotNexus.Gateway\ to 4 extension projects (Skills, Mcp, McpInvoke, WebTools), replacing hardwired tool instantiation with a runtime contribution contract.

Changes

  • New contract: \IAgentToolContributor\ / \AgentToolContributionContext\ / \AgentToolContribution\ in Gateway.Contracts
  • Extension self-registration: Each extension now implements \IAgentToolContributor\ to contribute tools at runtime
  • Runtime discovery: \AssemblyLoadContextExtensionLoader\ discovers and registers contributors from extension assemblies
  • InProcessIsolationStrategy: Invokes contributors via DI instead of directly
    ew-ing extension types
  • Removed: 4 <ProjectReference>\ entries from Gateway.csproj

Motivation

The architecture review (Leela) identified this as the #1 highest-impact structural issue: Gateway was violating its own documented rule that extensions depend on the gateway, not vice versa. With 16 project references, Gateway had become a monolithic gravity well.

Verification

  • \dotnet build BotNexus.slnx\ ✅ passes
  • \dotnet test BotNexus.slnx\ — 1193 passed, 6 failed (all pre-existing: snapshot path mismatch + SQLite file-lock issues unrelated to this change)
  • No new test failures introduced

Follow-up

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

sytone and others added 4 commits May 4, 2026 12:21
Introduce IAgentToolContributor for runtime extension tool contribution and register it through the extension loader so Gateway no longer compiles against Skills/MCP/WebTools extension projects.

Move extension-specific tool construction into extension-owned contributor classes and update InProcessIsolationStrategy to aggregate contributor output and dispose session-scoped resources.

Update gateway tests for the new strategy constructor and add coverage that contributor-provided tools are included.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Orchestration logs for Leela, Farnsworth, Hermes
- Session log for gateway-decoupling work
- Merged 7 decisions from inbox to decisions.md
- Updated agent history.md with cross-agent signals
- Dependency review findings, IAgentToolContributor introduction, test audit results
…espace alignment)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nsion-decoupling

# Conflicts:
#	src/gateway/BotNexus.Gateway/Isolation/InProcessIsolationStrategy.cs
#	tests/BotNexus.Gateway.Tests/InProcessIsolationStrategyTests.cs
@sytone sytone merged commit 377edb0 into main May 5, 2026
10 checks passed
@sytone sytone deleted the refactor/gateway-extension-decoupling branch May 26, 2026 22:10
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