mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-25 17:18:11 +00:00
fmt(js): npm run fix on merge (#71099)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
2c1a38a3cc
commit
bb4765d21c
4 changed files with 21 additions and 25 deletions
|
|
@ -75,6 +75,7 @@ test('buildDesktopBackendEnv forces PYTHONUTF8 unless the user set it explicitly
|
|||
platform: 'darwin',
|
||||
pathModule: path.posix
|
||||
})
|
||||
|
||||
assert.equal(defaulted.PYTHONUTF8, '1')
|
||||
|
||||
const optedOut = buildDesktopBackendEnv({
|
||||
|
|
@ -83,6 +84,7 @@ test('buildDesktopBackendEnv forces PYTHONUTF8 unless the user set it explicitly
|
|||
platform: 'darwin',
|
||||
pathModule: path.posix
|
||||
})
|
||||
|
||||
assert.equal(optedOut.PYTHONUTF8, '0')
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -2985,6 +2985,7 @@ function preflightStateDb(hermesHome, rememberLog) {
|
|||
|
||||
if (!fileExists(stateDbPath)) {
|
||||
rememberLog('[updates] state.db pre-flight: not found (fresh install?)')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -3015,23 +3016,19 @@ function preflightStateDb(hermesHome, rememberLog) {
|
|||
|
||||
// Emergency timestamped backup, separate from the Python-level snapshot.
|
||||
const ts = new Date().toISOString().replace(/[:.]/g, '-')
|
||||
const emergencyPath = path.join(
|
||||
hermesHome,
|
||||
`state.db.pre-update-emergency-${ts}.bak`
|
||||
)
|
||||
|
||||
const emergencyPath = path.join(hermesHome, `state.db.pre-update-emergency-${ts}.bak`)
|
||||
|
||||
try {
|
||||
fs.copyFileSync(stateDbPath, emergencyPath)
|
||||
const emergStat = fs.statSync(emergencyPath)
|
||||
|
||||
rememberLog(
|
||||
`[updates] emergency state.db backup: ${emergencyPath} ` +
|
||||
`(${emergStat.size} bytes)`
|
||||
)
|
||||
rememberLog(`[updates] emergency state.db backup: ${emergencyPath} ` + `(${emergStat.size} bytes)`)
|
||||
|
||||
// Prune to the 2 most recent emergency backups.
|
||||
try {
|
||||
const homeDir = fs.readdirSync(hermesHome)
|
||||
|
||||
const backups = homeDir
|
||||
.filter(
|
||||
f =>
|
||||
|
|
@ -3053,19 +3050,13 @@ function preflightStateDb(hermesHome, rememberLog) {
|
|||
void 0
|
||||
}
|
||||
} catch (copyErr) {
|
||||
rememberLog(
|
||||
`[updates] emergency state.db backup failed: ${copyErr.message}`
|
||||
)
|
||||
rememberLog(`[updates] emergency state.db backup failed: ${copyErr.message}`)
|
||||
}
|
||||
} else {
|
||||
rememberLog(
|
||||
`[updates] state.db too small (${stat.size} bytes) for a valid SQLite database`
|
||||
)
|
||||
rememberLog(`[updates] state.db too small (${stat.size} bytes) for a valid SQLite database`)
|
||||
}
|
||||
} catch (statErr) {
|
||||
rememberLog(
|
||||
`[updates] could not stat state.db before update: ${statErr.message}`
|
||||
)
|
||||
rememberLog(`[updates] could not stat state.db before update: ${statErr.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3083,6 +3074,7 @@ async function applyUpdatesPosixInApp(opts: any) {
|
|||
|
||||
if (!hermes) {
|
||||
emitUpdateProgress({ stage: 'manual', message: 'hermes update', percent: null })
|
||||
|
||||
return { ok: true, manual: true, command: 'hermes update', hermesRoot: updateRoot }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ const mockComposerApi = { setText: vi.fn() }
|
|||
|
||||
vi.mock('@assistant-ui/react', () => ({
|
||||
useAui: () => ({ composer: () => mockComposerApi }),
|
||||
useAuiState: (selector: (state: { composer: { text: string } }) => unknown) =>
|
||||
selector({ composer: { text: '' } }),
|
||||
useAuiState: (selector: (state: { composer: { text: string } }) => unknown) => selector({ composer: { text: '' } }),
|
||||
useComposerRuntime: () => ({
|
||||
getState: () => ({ text: '' }),
|
||||
subscribe: () => () => undefined
|
||||
|
|
@ -60,11 +59,7 @@ describe('useComposerDraft — attachment scope stays coherent with the committe
|
|||
const snapshots: ComposerAttachment[][] = []
|
||||
|
||||
const { rerender } = render(
|
||||
<ProbeHarness
|
||||
activeQueueSessionKey="session-A"
|
||||
onLayoutSnapshot={s => snapshots.push(s)}
|
||||
sessionId="session-A"
|
||||
/>
|
||||
<ProbeHarness activeQueueSessionKey="session-A" onLayoutSnapshot={s => snapshots.push(s)} sessionId="session-A" />
|
||||
)
|
||||
|
||||
// Mount loads session A's stashed attachment into the (module-level) main
|
||||
|
|
@ -98,18 +93,24 @@ describe('useComposerDraft — rehydrate diagnostic log stays redacted', () => {
|
|||
|
||||
it('logs counts/kinds/scope on restore but never the raw url, refText, or label', () => {
|
||||
const secretUrl = 'https://secret.example.com/private-workspace-path'
|
||||
|
||||
const attachment: ComposerAttachment = {
|
||||
id: 'url-secret',
|
||||
kind: 'url',
|
||||
label: 'do-not-leak-label',
|
||||
refText: `@url:${secretUrl}`
|
||||
}
|
||||
|
||||
stashSessionDraft('session-secret', '', [attachment])
|
||||
|
||||
const debugSpy = vi.spyOn(console, 'debug').mockImplementation(() => undefined)
|
||||
|
||||
render(
|
||||
<ProbeHarness activeQueueSessionKey="session-secret" onLayoutSnapshot={() => undefined} sessionId="session-secret" />
|
||||
<ProbeHarness
|
||||
activeQueueSessionKey="session-secret"
|
||||
onLayoutSnapshot={() => undefined}
|
||||
sessionId="session-secret"
|
||||
/>
|
||||
)
|
||||
|
||||
const rehydrateCalls = debugSpy.mock.calls.filter(call => call[0] === '[composer-rehydrate]')
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ export function useSessionStateCache({
|
|||
selectedStoredSessionIdPropRef.current = selectedStoredSessionId
|
||||
selectedStoredSessionIdRef.current = selectedStoredSessionId
|
||||
}
|
||||
|
||||
const sessionStateByRuntimeIdRef = useRef(new Map<string, ClientSessionState>())
|
||||
const runtimeIdByStoredSessionIdRef = useRef(new Map<string, string>())
|
||||
const pendingViewStateRef = useRef<{ sessionId: string; state: ClientSessionState } | null>(null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue