Overview #
An Agent Host Protocol (AHP) connection lets aiKonnector talk to an agent host running on your machine, such as the one built into VS Code. Setup takes three steps: start and share the host in VS Code, add it in aiKonnector, then authenticate it if the host asks.
Before you start, you need:
- VS Code installed, with access to a terminal
- An aiKonnector account with access to the Admin area of the aiKonnector Human Approval Platform
- A GitHub account, if you plan to use VS Code models (needed for Step 3)
Step 1: Prepare the agent host in VS Code #
Start the agent host on a port, then share that port publicly so aiKonnector can reach it.
Start the agent host #
- Open a terminal in VS Code.
- Run the following command:
code-tunnel agent host --port 36692
You can use a different port. If you do, use that port number everywhere this guide says 36692.
Forward and share the port #
- Open the Ports panel. It sits next to the Terminal panel at the bottom of VS Code.
- Click Forward a Port.
- Type
36692(or the port you started the agent host on) and press Enter. - Right-click the forwarded port and choose Port Visibility > Public. Click OK to confirm.
- Copy the Forwarded Address VS Code shows for the port. You will paste it into aiKonnector in Step 2.
Note: Public visibility means anyone with this address can reach the port. Treat the address, including its
tkn=value, like a password and don’t share it.
Step 2: Add the host in aiKonnector #
Add the host under Admin > AHP Hosts, using a WebSocket version of the address you copied from VS Code.
- Sign in to the aiKonnector Human Approval Platform and go to Admin > AHP Hosts.
- Click Add Host.
- In Name, enter a name that’s easy to recognize, such as
My VS Code. - In URL, paste the address you copied from VS Code, then edit it:
- Change the protocol from
https://towss://. - Add the port
:443right after the hostname.
- Change the protocol from
- Click Save.
Example URL #
| Address | |
|---|---|
| Copied from VS Code | https://exhostname-36692.use.devtunnels.ms?tkn=f08d9876-cb17-4e01-9a5d-ec12e39b1234 |
| Entered in aiKonnector | wss://exhostname-36692.use.devtunnels.ms:443?tkn=f08d9876-cb17-4e01-9a5d-ec12e39b1234 |
Keep the ?tkn= part of the address exactly as VS Code gave it. If the copied address has a / before ?tkn=, put :443 before that slash.
Step 3: Authenticate the host (if required) #
Some hosts need extra authentication before aiKonnector can use them, and VS Code models do. If so, the host shows an Authentication required notice on the AHP Hosts screen. For VS Code, you authenticate with a GitHub token from the GitHub CLI.
- Install the GitHub CLI (
gh). - In a terminal, sign in to GitHub:
gh auth login
- Follow the prompts to finish signing in.
- Print your token:
gh auth token
- Copy the token from the output.
- In aiKonnector, go to Admin > AHP Hosts and open the host to edit it.
- Paste the token into the authentication field at the bottom of the AHP Host edit screen.
- Click Save. The Authentication required notice should clear.
Note: This token gives access to your GitHub account. Don’t share it or paste it anywhere other than aiKonnector.
Step 4: Use AHP host from the web #
Now that the host is configured, it is ready to be used from the web.
- Browse to the aiKonnector Human Approval Platform and log in
- Click “New Chat”
- In the Model selector (bottom right), click the drop-down that shows models
- At the bottom of the list, you will now see your machine name (as configured in “AHP Hosts”) and each model that is available to select
- For VSCode, Free will show a single Microsoft model, Paid will show all 20+ models available from within VSCode
- Select one of these models
- At the bottom of the list, you will now see your machine name (as configured in “AHP Hosts”) and each model that is available to select
- Start chatting with the agent on the host. As this is an agent (and not just an LLM), you can ask it such as:
- Ask it what directory its in
- To change directory
- To open a file and read or summarize it
- To create an app
- NOTE – You can also configure different folders (in Admin) that are select-able in the “Tool” menu for new chats.
Troubleshooting #
| Problem | What to check |
|---|---|
| aiKonnector can’t connect to the host | Make sure the agent host is still running in VS Code and the port is still forwarded. Stopping either one closes the connection. |
| Connection is refused | Confirm the port’s visibility is Public, not Private. |
| URL won’t connect | Confirm it starts with wss://, includes :443, and keeps the full ?tkn= value. |
| Wrong port | The port in the forwarded address must match the --port value you used to start the agent host. |
| Authentication required notice returns | Your GitHub token may have been revoked or you may have signed out. Run gh auth login and gh auth token again, then paste the new token. |