feat: add gateway auto-start on boot and real health detection

- Auto-detect gateway connectivity on server startup, start gateway if not running
- Fix /health endpoint to actually check gateway reachability instead of just CLI version
- Fix MiniMax CN base_url from /anthropic to /v1
- Frontend connection status now reflects real gateway state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-13 20:08:32 +08:00
parent 5143a264c5
commit 0ff04758b6
5 changed files with 60 additions and 8 deletions
+11 -1
View File
@@ -182,7 +182,17 @@ export async function getVersion(): Promise<string> {
}
/**
* Update Hermes Agent
* Start Hermes gateway
*/
export async function startGateway(): Promise<string> {
const { stdout, stderr } = await execFileAsync('hermes', ['gateway', 'start'], {
timeout: 30000,
})
return stdout || stderr
}
/**
* Restart Hermes gateway
*/
export async function restartGateway(): Promise<string> {
const { stdout, stderr } = await execFileAsync('hermes', ['gateway', 'restart'], {