fix: add 'hooks' to CODEX_SYSTEM_RESOURCE_ENTRIES (#7120)

This commit is contained in:
Soichi Sumi
2026-07-03 17:06:09 -07:00
committed by GitHub
parent 547afc2264
commit 5e9db83c48
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -217,4 +217,16 @@ describe('syncSystemCodexResourcesIntoManagedHome', () => {
expect(lstatSync(runtimeProfilePath).isSymbolicLink()).toBe(false)
expect(readFileSync(runtimeProfilePath, 'utf-8')).toBe('second\n')
})
it('mirrors hooks directory into the managed runtime home (regression test for 127 exit)', () => {
const systemHooksPath = join(getSystemCodexHomePath(), 'hooks')
const runtimeHooksPath = join(getRuntimeCodexHomePath(), 'hooks')
mkdirSync(systemHooksPath, { recursive: true })
writeFileSync(join(systemHooksPath, 'observe-tool-use.sh'), '#!/bin/bash\necho ok\n')
syncSystemCodexResourcesIntoManagedHome()
expect(lstatSync(runtimeHooksPath).isSymbolicLink()).toBe(true)
expectSymbolicLinkTargetIfLinked(runtimeHooksPath, systemHooksPath)
})
})
+1
View File
@@ -16,6 +16,7 @@ import { dirname, join } from 'node:path'
const CODEX_SYSTEM_RESOURCE_ENTRIES = [
'skills',
'hooks',
'plugins',
'plugin-state',
'profile-v2',