Update CLI chat session bridge (#697)
* feat: add CLI chat sessions with Python agent bridge Introduce a new CLI chat mode that connects Web UI directly to Hermes Agent's AIAgent via a Python bridge subprocess and Socket.IO, bypassing the API Server /v1/responses path. Supports streaming, slash commands (/new, /undo, /retry, /branch, /compress, /save, /title), interrupt, and steer. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat: update CLI chat session bridge * fix: extend agent bridge startup timeouts * docs: update bridge chat session design * feat: align bridge compression and provider registry * chore: bump version to 0.5.20 --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import { setGroupChatServer } from './routes/hermes/group-chat'
|
||||
import { setChatRunServer } from './routes/hermes/chat-run'
|
||||
import { GroupChatServer } from './services/hermes/group-chat'
|
||||
import { ChatRunSocket } from './services/hermes/chat-run-socket'
|
||||
import { startAgentBridgeManager } from './services/hermes/agent-bridge'
|
||||
import { logger } from './services/logger'
|
||||
|
||||
// Injected by esbuild at build time; fallback to reading package.json in dev mode
|
||||
@@ -46,6 +47,7 @@ process.on('unhandledRejection', (reason) => {
|
||||
let server: any = null
|
||||
let servers: any[] = []
|
||||
let chatRunServer: any = null
|
||||
let agentBridgeManager: any = null
|
||||
|
||||
interface ListenResult {
|
||||
primary: any
|
||||
@@ -94,6 +96,13 @@ export async function bootstrap() {
|
||||
|
||||
await initGatewayManager()
|
||||
console.log('[bootstrap] gateway manager initialized')
|
||||
try {
|
||||
agentBridgeManager = await startAgentBridgeManager()
|
||||
console.log('[bootstrap] agent bridge started')
|
||||
} catch (err) {
|
||||
logger.warn(err, '[bootstrap] agent bridge failed to start')
|
||||
console.warn('[bootstrap] agent bridge failed to start:', err instanceof Error ? err.message : err)
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||
// Initialize all web-ui SQLite tables
|
||||
const { initAllStores } = await import('./db/hermes/init')
|
||||
@@ -102,11 +111,6 @@ export async function bootstrap() {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||
console.log('[bootstrap] all stores initialized')
|
||||
|
||||
// Sync Hermes sessions from all profiles (only if local DB is empty)
|
||||
const { syncAllHermesSessionsOnStartup } = await import('./services/hermes/session-sync')
|
||||
await syncAllHermesSessionsOnStartup()
|
||||
console.log('[bootstrap] Hermes session sync completed')
|
||||
|
||||
app.use(cors({ origin: config.corsOrigins }))
|
||||
app.use(bodyParser())
|
||||
console.log('[bootstrap] cors + bodyParser registered')
|
||||
@@ -187,7 +191,7 @@ export async function bootstrap() {
|
||||
})
|
||||
})
|
||||
|
||||
bindShutdown(servers, groupChatServer, chatRunServer)
|
||||
bindShutdown(servers, groupChatServer, chatRunServer, agentBridgeManager)
|
||||
startVersionCheck()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user