Skip to content

refactor: extract MCP tool provider lifecycle - #4875

Open
Kokeip wants to merge 1 commit into
HKUDS:mainfrom
Kokeip:fix-4858-mcp-provider-lifecycle
Open

refactor: extract MCP tool provider lifecycle#4875
Kokeip wants to merge 1 commit into
HKUDS:mainfrom
Kokeip:fix-4858-mcp-provider-lifecycle

Conversation

@Kokeip

@Kokeip Kokeip commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • introduce MCPToolProvider to own MCP dynamic tool lifecycle state
  • route AgentLoop MCP connect, reload, close, and runtime-context behavior through the provider
  • update MCP lifecycle tests to assert provider-owned state

Closes #4858

Tests

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=. pytest -p pytest_asyncio.plugin tests\agent\test_mcp_connection.py tests\agent\tools\test_self_tool.py -q
  • ruff check nanobot\agent\loop.py nanobot\agent\context.py nanobot\agent\tools\mcp.py nanobot\agent\tools\self.py

@chengyongru chengyongru added priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. refactor test provider conflict labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. provider refactor test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor dynamic tool provider lifecycle out of AgentLoop

2 participants