mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
fix(tui): show /browser connect progress like CLI
Return CLI-style browser connect status messages from the gateway and render them in the TUI so local Chrome launch attempts are visible instead of ending in a silent delayed failure.
This commit is contained in:
parent
69ff114ee2
commit
7d39a45749
5 changed files with 85 additions and 14 deletions
|
|
@ -108,12 +108,15 @@ export const opsCommands: SlashCommand[] = [
|
|||
|
||||
if (action === 'connect') {
|
||||
payload.url = requested || 'http://127.0.0.1:9222'
|
||||
ctx.transcript.sys(`checking Chrome remote debugging at ${payload.url}...`)
|
||||
}
|
||||
|
||||
ctx.gateway
|
||||
.rpc<BrowserManageResponse>('browser.manage', payload)
|
||||
.then(
|
||||
ctx.guarded<BrowserManageResponse>(r => {
|
||||
r.messages?.forEach(message => ctx.transcript.sys(message))
|
||||
|
||||
if (action === 'status') {
|
||||
return ctx.transcript.sys(
|
||||
r.connected
|
||||
|
|
@ -124,13 +127,14 @@ export const opsCommands: SlashCommand[] = [
|
|||
|
||||
if (action === 'connect') {
|
||||
if (r.connected) {
|
||||
ctx.transcript.sys(`browser connected: ${r.url || '(url unavailable)'}`)
|
||||
ctx.transcript.sys(`Browser connected to live Chrome via CDP`)
|
||||
ctx.transcript.sys(`Endpoint: ${r.url || '(url unavailable)'}`)
|
||||
ctx.transcript.sys('next browser tool call will use this CDP endpoint')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
return ctx.transcript.sys('browser connect failed')
|
||||
return
|
||||
}
|
||||
|
||||
ctx.transcript.sys('browser disconnected')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue