fix session profile listing and cli sqlite warning (#971)

This commit is contained in:
ekko
2026-05-24 17:54:17 +08:00
committed by GitHub
parent f61a1d9454
commit a7f0a92fe6
6 changed files with 159 additions and 11 deletions
+9
View File
@@ -65,12 +65,21 @@ function shouldAttachProfileHeader(path: string, options: RequestInit): boolean
const url = new URL(path, 'http://hermes.local')
if (url.searchParams.has('profile')) return false
if (url.pathname.startsWith('/api/hermes/profiles')) return false
if (isProfileWideSessionCollection(url.pathname)) return false
} catch {
if (path.startsWith('/api/hermes/profiles')) return false
if (isProfileWideSessionCollection(path.split('?')[0] || path)) return false
}
return !bodyHasProfileSelector(options.body)
}
function isProfileWideSessionCollection(pathname: string): boolean {
return pathname === '/api/hermes/sessions' ||
pathname === '/api/hermes/search/sessions' ||
pathname === '/api/hermes/sessions/search' ||
pathname === '/api/hermes/sessions/conversations'
}
function emitAuthNotice(kind: 'expired' | 'forbidden') {
if (typeof window === 'undefined') return
window.dispatchEvent(new CustomEvent('hermes-auth-notice', { detail: { kind } }))