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:
ekko
2026-05-14 09:03:57 +08:00
committed by GitHub
parent e0fcc0040b
commit eae7195ba8
31 changed files with 3906 additions and 1040 deletions
+10 -1
View File
@@ -27,7 +27,7 @@ function shouldStopGatewaysOnShutdown(signal: string): boolean {
return shouldStop
}
export function bindShutdown(server: any, groupChatServer?: any, chatRunServer?: any): void {
export function bindShutdown(server: any, groupChatServer?: any, chatRunServer?: any, agentBridgeManager?: any): void {
let isShuttingDown = false
const shutdown = async (signal: string) => {
@@ -58,6 +58,15 @@ export function bindShutdown(server: any, groupChatServer?: any, chatRunServer?:
logger.info('Skipping gateway shutdown for %s', signal)
}
if (agentBridgeManager) {
try {
await agentBridgeManager.stop()
logger.info('Agent bridge stopped')
} catch (err) {
logger.warn(err, 'Failed to stop agent bridge (non-fatal)')
}
}
// Close ChatRunSocket first to abort all active runs and close EventSource connections
if (chatRunServer) {
chatRunServer.close()