microsoft / microsoft/foundry-dev-tools
Microsoft Foundry: Deploy Hosted Agent command is giving error "cannot create a new Capability Host with name" on VS code AI Toolkit
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 260
- Avg merge
- 42m
- Merged PRs (30d)
- 29
Description
Does this occur consistently? Yes
Repro steps:
Create an hosted agent(single agent) using Microsoft Foundry: Create new Hosted Agent command on VS code
Deploy agent to foundry using Microsoft Foundry: Deploy Hosted Agent command
Action: deploy-hosted-agent
Error type: 500
Error Message: 500: There is an existing Capability Host with name: agents, provisioning state: Succeeded for workspace: 95d97546-f67e-4555-8f77-8d2cead802c0/msfoundry-poc/roshfoundry@AML/accountcaphost, cannot create a new Capability Host with name: accountcaphost for the same ClientId.
Version: 0.18.0
OS: win32
OS Arch: x64
OS Release: 10.0.26100
Product: Visual Studio Code
Product Version: 1.109.4
Language: en
UTC time: Wed, 08 Apr 2026 05:07:13 GMT
Call stack:
AIFServiceClientV2.handleResponse extension.js:164885:19
AIFServiceClientV2.createCapabilityHost extension.js:164936:21
async ProjectService.createCapabilityHostWithRetry extension.js:184793:24
async ProjectService.tryCreateCapabilityHost extension.js:184758:24
async AgentLifecycleHelper.handleCapabilityHostCreation extension.js:181077:32
async AgentLifecycleHelper.ensureCapabilityHostReady extension.js:181056:16
extension.js:181094:27extension.js:181094:27
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the deployment from the listed Microsoft Foundry commands and inspect the named AIFServiceClientV2 and ProjectService capability-host flow in extension.js. Check how an existing Capability Host is handled during ensureCapabilityHostReady; done means deploying the hosted agent completes without the 500 error or duplicate-host failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100