initializeAndValidate() is a no-op for extension sessions via joinSession()
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api, developer-experience
Research direction
Start with the base-class implementation and comment at rpc.ts:9235, then trace session.rpc.tools.initializeAndValidate for sessions created through joinSession(). Reproduce the MCP enable flow, wait for mcp_server_status_changed, and verify that the active tool list is rebuilt during the same turn rather than only after tools_changed_notice.
Written by the indexing model from the issue text.
Description
Summary
session.rpc.tools.initializeAndValidate() is callable from extensions that join sessions via joinSession(), but it behaves as a no-op — returning {} instantly without rebuilding the LLM's tool list. This prevents extensions from refreshing the tool list mid-turn after dynamically enabling/disabling MCP servers.
Expected Behavior
After an extension calls rpc.mcp.enable({ serverName }) and the MCP server connects (confirmed via mcp_server_status_changed event), calling initializeAndValidate() should rebuild the LLM's active tool list so that newly available tools are usable in the same turn.
Actual Behavior
initializeAndValidate()returns{}in ~29ms (consistent with the base-class no-op documented inrpc.ts:9235: "Default base-class implementation is a no-op for sessions that don't support tool validation")- Tools only become available via
tools_changed_notice, which fires exclusively between turns - Extensions have no mechanism to trigger a mid-turn tool list rebuild
Diagnostic Evidence
Built a diagnostic tool (mcp_api_probe) inside an extension to test the full rpc.tools namespace:
session.rpc.tools exists: true
.initializeAndValidate: function ← callable but no-op
.getCurrentMetadata: undefined ← not available
.handlePendingToolCall: function
all keys: [handlePendingToolCall, initializeAndValidate]
Full enable+verify cycle (mail MCP):
[17:08:09.150Z] calling rpc.mcp.enable...
[17:08:11.261Z] rpc.mcp.enable resolved
status events received: 2 — both "connected"
tools_updated events received: 0
[17:08:16.274Z] calling tools.initializeAndValidate()...
[17:08:17.126Z] initializeAndValidate returned: {}
Result: tools NOT visible same-turn
Live test results across 3 MCP servers:
| MCP Server | Connected? | Tools Same-Turn? | Appeared Via |
|---|---|---|---|
| ✅ | ❌ | tools_changed_notice (next turn) | |
| workiq | ✅ | ❌ | tools_changed_notice (~90s) |
| s360-breeze | ✅ | ❌ | tools_changed_notice (~90s) |
Request
Make initializeAndValidate() functional for extension sessions via joinSession(), or provide an alternative API (e.g., session.rpc.tools.rebuild()) that extensions can call to force a mid-turn tool list rebuild after MCP enable/disable operations.
Use Case
Constellation — a Copilot CLI extension that manages MCP server profiles for token optimization (saves 16K-33K tokens/turn by only loading needed MCPs). Everything works except tools require a wasted turn after each load.
Related: Feature request also filed on github/copilot-cli.
Environment
- Copilot CLI v1.0.56-1
@github/copilot-sdk/extensionviajoinSession()- OS: Windows 11
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 133
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot-sdk
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2709 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
github/copilot-sdk#2673 ·
-
bug testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/copilot-sdk#2628 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2627 · 1 comment ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
github/copilot-sdk#2493 ·
All issues in github/copilot-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·