diff --git a/src/main/codex/codex-home-paths.test.ts b/src/main/codex/codex-home-paths.test.ts index 139e06cae..bd12ae95c 100644 --- a/src/main/codex/codex-home-paths.test.ts +++ b/src/main/codex/codex-home-paths.test.ts @@ -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) + }) }) diff --git a/src/main/codex/codex-home-paths.ts b/src/main/codex/codex-home-paths.ts index 80e039d75..1f2cf9b29 100644 --- a/src/main/codex/codex-home-paths.ts +++ b/src/main/codex/codex-home-paths.ts @@ -16,6 +16,7 @@ import { dirname, join } from 'node:path' const CODEX_SYSTEM_RESOURCE_ENTRIES = [ 'skills', + 'hooks', 'plugins', 'plugin-state', 'profile-v2',