sf agent preview hangs on "Starting Session"
Summary
After following the configuration as instructed on the CLI using sf agent preview --help, which by the way doesn't exactly match the configuration on https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html
I was finally able to try to connect without getting a 404
But now it hangs when starting the session
Steps To Reproduce
Configure connected app and authorize as instructed here https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html
run sf agent preview
Not only it hangs and the session never starts but hitting esc doesn't exit and doesn't close the session.
Expected result
To be able to preview and chat with the agent
Actual result
Hangs
System Information
I'm using bash on macOS
{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.93.7",
"nodeVersion": "node-v22.12.0",
"osVersion": "Darwin 24.5.0",
"rootPath": "/usr/local/lib/node_modules/@salesforce/cli",
"shell": "zsh",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.30 (core)",
"@oclif/plugin-commands 4.1.26 (core)",
"@oclif/plugin-help 6.2.28 (core)",
"@oclif/plugin-not-found 3.2.56 (core)",
"@oclif/plugin-plugins 5.4.40 (core)",
"@oclif/plugin-search 1.2.24 (core)",
"@oclif/plugin-update 4.6.43 (core)",
"@oclif/plugin-version 2.2.29 (core)",
"@oclif/plugin-warn-if-update-available 3.1.41 (core)",
"@oclif/plugin-which 3.2.35 (core)",
"@salesforce/cli 2.93.7 (core)",
"agent 1.22.8 (user) published 19 days ago (Tue Jun 03 2025) (latest is 1.23.0)",
"apex 3.6.19 (core)",
"api 1.3.3 (core)",
"auth 3.7.0 (core)",
"code-analyzer 5.1.0 (user) published 27 days ago (Tue May 27 2025) (latest is 5.2.1)",
"custom-metadata 3.3.46 (user) published 106 days ago (Sun Mar 09 2025) (latest is 3.3.58)",
"data 4.0.39 (core)",
"deploy-retrieve 3.22.22 (core)",
"info 3.4.66 (core)",
"limits 3.3.56 (core)",
"marketplace 1.3.8 (core)",
"org 5.8.0 (core)",
"packaging 2.15.4 (core)",
"schema 3.3.66 (core)",
"settings 2.4.31 (core)",
"signups 2.6.13 (user) published 135 days ago (Sat Feb 08 2025) (latest is 2.6.32)",
"sobject 1.4.60 (core)",
"telemetry 3.6.44 (core)",
"templates 56.3.50 (core)",
"trust 3.7.98 (core)",
"user 3.6.25 (core)",
"@salesforce/sfdx-scanner 4.8.0 (user) published 161 days ago (Mon Jan 13 2025) (latest is 4.12.0)",
"sfdmu 4.38.0 (user) published 176 days ago (Sun Dec 29 2024)",
"sfdx-git-delta 6.1.1 (user) published 158 days ago (Thu Jan 16 2025) (latest is 6.13.1)",
"sfdx-plugin-source-read 1.4.2 (user) published 144 days ago (Thu Jan 30 2025) (latest is 1.5.4)"
]
}
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
After following the configuration as instructed on the CLI using sf agent preview --help, which by the way doesn't exactly match the configuration on https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html
these docs were updated to use the new feature to link multiple connected apps to authenticated users in the CLI in sf v2.93.7:
https://github.com/forcedotcom/cli/tree/main/releasenotes/#2937-june-18-2025-stable
the previous workaround (that you may be seeing in sf agent preview --help if on an old version) was to create a new salesforce user for each agent you wanted to preview, which isn't supported on sf >= v2.93.7
"agent 1.22.8 (user) published 19 days ago (Tue Jun 03 2025) (latest is 1.23.0)",
this shows you also have an old version of plugin-agent, make sure to remove it by running:
sf plugins uninstall @salesforce/plugin-agent
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.