feat(desktop): point the no-agents link at the Hermes Cloud instance-setup page

Per review: the empty-state "create an agent" link went to the generic portal
agents list; point it at the Hermes Cloud create-instance flow
({portal}/cloud?setup=instance) instead. Derive the host from the portalBaseUrl
that cloud.status() already echoes so it honors HERMES_PORTAL_BASE_URL rather
than hardcoding a second copy of the portal host. Link text/copy → "Hermes
Cloud" (en + zh).
This commit is contained in:
Brooklyn Nicholson 2026-07-10 01:55:44 -05:00
parent 0ff097439e
commit 703487d7a6
3 changed files with 15 additions and 6 deletions

View file

@ -119,6 +119,9 @@ export function GatewaySettings() {
const [cloudAgents, setCloudAgents] = useState<DesktopCloudAgent[]>([])
const [cloudDiscover, setCloudDiscover] = useState<CloudDiscoverStatus>('idle')
const [cloudConnectingId, setCloudConnectingId] = useState<null | string>(null)
// Portal base URL echoed by cloud.status() — used to build the "create an
// agent" link so it honors HERMES_PORTAL_BASE_URL instead of a hardcoded host.
const [cloudPortalUrl, setCloudPortalUrl] = useState('')
// Multi-org users: when discovery returns needsOrgSelection, we hold the org
// list here and show a picker. `cloudOrg` is the chosen org slug/id (null =
// not yet chosen / single-org user).
@ -210,6 +213,11 @@ export function GatewaySettings() {
const isConnectedAgent = (agent: DesktopCloudAgent) =>
Boolean(connectedCloudUrl && agent.dashboardUrl && normalizeCloudUrl(agent.dashboardUrl) === connectedCloudUrl)
// "Create an agent" target: the Hermes Cloud instance-setup page, derived from
// the portal base URL (cloud.status echoes it) so it honors
// HERMES_PORTAL_BASE_URL; falls back to the canonical host before status lands.
const createCloudAgentUrl = `${(cloudPortalUrl || 'https://portal.nousresearch.com').replace(/\/+$/, '')}/cloud?setup=instance`
useEffect(() => {
if (state.mode !== 'remote' || !trimmedUrl || !/^https?:\/\//i.test(trimmedUrl)) {
setProbeStatus('idle')
@ -526,6 +534,7 @@ export function GatewaySettings() {
return
}
setCloudPortalUrl(status.portalBaseUrl)
setCloudSignedIn(status.signedIn)
if (status.signedIn) {
@ -864,7 +873,7 @@ export function GatewaySettings() {
<AlertCircle className="mt-0.5 size-4 shrink-0" />
<span>
{g.cloudNoAgents.before}
<ExternalLink href="https://portal.nousresearch.com/agents" showExternalIcon={false}>
<ExternalLink href={createCloudAgentUrl} showExternalIcon={false}>
{g.cloudNoAgents.linkText}
</ExternalLink>
{g.cloudNoAgents.after}

View file

@ -550,8 +550,8 @@ export const en: Translations = {
cloudOrgRole: role => `Role: ${role}`,
cloudLoadingAgents: 'Loading your agents…',
cloudNoAgents: {
before: 'No agents found on this account. Create one in the ',
linkText: 'Nous portal',
before: 'No agents found on this account. Create one in ',
linkText: 'Hermes Cloud',
after: ', then refresh.'
},
cloudRefresh: 'Refresh',

View file

@ -739,9 +739,9 @@ export const zh: Translations = {
cloudOrgRole: role => `角色:${role}`,
cloudLoadingAgents: '正在加载你的智能体…',
cloudNoAgents: {
before: '此账户下未找到智能体。请在',
linkText: 'Nous 门户',
after: '创建一个,然后刷新。'
before: '此账户下未找到智能体。前往 ',
linkText: 'Hermes Cloud',
after: ' 创建一个,然后刷新。'
},
cloudRefresh: '刷新',
cloudConnect: '连接',