Repository navigation
[BugFix] Wire database tools into MCP reference template execution (backport #1468) - #1561
mergify[bot] wants to merge 1 commit into
Conversation
…1468) * fix(mcp): wire db tool into reference template execution - Connect `db_tool` to `reference_template_tool` in `ToolContextManager` and `DatusMCPServer` so rendered SQL executes consistently with Chat API agents. - Remove the redundant `close_all` docstring in `ToolContextManager`. * test(mcp): Override collaborative initialization of reference templates and database tools - Override dynamic and static tool initialization paths in MCP service tests - Verify that reference templates can execute rendered SQL and reuse database tool instances - Ensure remaining available tools are retained when a tool is missing or fails to initialize * test(mcp-server): import lightweight server in unit tests * fix(mcp): defer pinned context cleanup during shutdown - Update `ToolContextManager.close_all` in `datus/mcp_server.py` to drop cache ownership without immediate connector teardown, allowing active requests and workers to release contexts safely. - Add regression coverage in `tests/unit_tests/test_mcp_server.py` for deferred connector cleanup and live-context draining after final release. --------- Co-authored-by: 李长福 <lichangfu@pinpianyi.com> (cherry picked from commit ab336ed) # Conflicts: # tests/unit_tests/test_mcp_server.py
|
Cherry-pick of ab336ed has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Test Audit ReportMode: diff-only (P0 blocks, P1 warns) ✅ No issues detected. Static test-quality audit — rules from xUnit Test Patterns / Google Hermetic Tests / F.I.R.S.T. / Khorikov. Source: ci/audit_tests.py. |
|
@mergify[bot]: Conflict detected, please resolve the conflict and resubmit the PR |
Automated backport of #1468 to
release/0.4.0.