fix(tools): unify LangChain tool names with MCP — fix doc/tool drift from #2237 - #2239
Closed
HongmingWang-Rabbit wants to merge 1 commit into
Closed
fix(tools): unify LangChain tool names with MCP — fix doc/tool drift from #2237#2239HongmingWang-Rabbit wants to merge 1 commit into
HongmingWang-Rabbit wants to merge 1 commit into
Conversation
Addresses CP review Issues 2 + 3 from 2026-04-28: the LangChain runtimes exposed `delegate_to_workspace` / `check_delegation_status` / `search_memory` while the MCP server (a2a_mcp_server.py) and the docs in get_a2a_instructions / get_hma_instructions used `delegate_task` / `check_task_status` / `recall_memory`. Workers running on LangGraph/CrewAI/LangChain saw docs telling them to call tools that didn't exist, while MCP runtimes (claude-code) had matching docs. The previous PR (#2237) made the situation worse by injecting MCP-world docs as the default — half the runtimes would now have been actively misled. The fix: rename LangChain @tool functions to match MCP tool names. After this PR, both runtime worlds share a single tool naming, and the platform-injected docs are accurate everywhere. Renames: delegate_to_workspace -> delegate_task_async check_delegation_status -> check_task_status search_memory -> recall_memory New tool (closes Issue 3 — sync delegation was missing for LangChain): delegate_task — sync wrapper around a2a_tools.tool_delegate_task, returns the peer's response text directly (no task_id polling). Use this for QUICK questions; use delegate_task_async + check_task_status for longer-running work. Files touched (all under workspace/): builtin_tools/delegation.py — rename + add sync delegate_task builtin_tools/memory.py — rename search_memory -> recall_memory adapter_base.py — register all 7 tools (was 6) main.py — same coordinator.py — system-prompt text + import alias shared_runtime.py — peer-section instruction text policies/routing.py — routing description text tests/conftest.py — module mocks include delegate_task tests/test_delegation.py — name updates tests/test_memory.py — name updates tests/test_coordinator_routing.py — name updates tests/test_prompt.py — 2 new alignment regression tests: test_a2a_doc_lists_unified_tool_names test_hma_doc_lists_unified_tool_names These pin doc/tool alignment so a future drift breaks CI. Tests: 1225 pass, 2 xfailed (pre-existing). Together with the A2A/HMA injection in this same branch (commit 448709f), the platform now ships: - tool docs that ARE in the system prompt - tool names in those docs that match the actual @tool symbols - sync + async + poll variants for both runtime worlds Refs: CP review Issues 1, 2, 3, 5 (Issue 4 noted, deferred — no platform timeout for coordinator-level execution; could be by design).
HongmingWang-Rabbit
requested a review
from hongmingwang-moleculeai
as a code owner
April 28, 2026 23:54
HongmingWang-Rabbit
enabled auto-merge
April 28, 2026 23:55
Contributor
Author
|
Superseded by feat/platform-tool-registry — that PR does the same rename PLUS the registry-driven single-source-of-truth refactor the user asked for. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up fix for #2237 (just merged). That PR injected the A2A and HMA tool docs into the system prompt — necessary for workers to know how to use platform tools. But it shipped MCP-world tool names (`delegate_task`, `check_task_status`, `recall_memory`) while LangChain runtimes only had the older names (`delegate_to_workspace`, `check_delegation_status`, `search_memory`). Right now in production, LangChain workers see docs telling them to call tools that don't exist.
This PR lands the harmonization that should have shipped alongside #2237. After this PR, both MCP and LangChain runtimes share a single tool naming so the platform-injected docs are accurate everywhere.
Renames (per CP review Issues 2 + 3)
New tool: sync `delegate_task` (closes Issue 3)
Wraps `a2a_tools.tool_delegate_task` as a LangChain `@tool`. Returns the peer's response text directly — no `task_id` polling. Use for QUICK questions; use `delegate_task_async` + `check_task_status` for longer work.
Files touched
All under `workspace/`:
Tests
`WORKSPACE_ID=test pytest workspace/tests/` — 1225 passed, 2 xfailed.
Why this needed to be its own PR
#2237 reached the merge queue while I was still extending the branch. By the time I tried to add the harmonization, #2237 had already landed. Shipping as a follow-up to close the regression window ASAP.
Refs
🤖 Generated with Claude Code