Files
hermes-agent/apps/desktop/src/lib/code-skew-error.ts
T
xxxigm bcecd675f7 fix(desktop): unwrap Models-page code-skew 503 and recycle the owned backend (#97046)
Show a Restart backend action that kills the SSH serve before the local child
so reconnect cannot reuse a stale lockfile, instead of dumping raw IPC JSON.
2026-08-31 20:43:36 -05:00

13 lines
378 B
TypeScript

/** True when a backend error is the post-update stale-module 503 (#97046). */
export function isCodeSkewRestartRequired(error: unknown): boolean {
return /Restart required:/i.test(errorText(error))
}
function errorText(error: unknown): string {
if (error instanceof Error) {
return error.message
}
return typeof error === 'string' ? error : String(error ?? '')
}