fix(hooks): remove gpt permission continuation hook

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-19 11:37:30 +09:00
parent 521a1f76a9
commit ccaf759b6b
31 changed files with 45 additions and 928 deletions
+27
View File
@@ -289,6 +289,19 @@ describe("migrateHookNames", () => {
expect(removed).toHaveLength(1)
})
test("removes gpt-permission-continuation from disabled hooks", () => {
// given: Config with removed GPT permission continuation hook
const hooks = ["gpt-permission-continuation", "comment-checker"]
// when: Migrate hook names
const { migrated, changed, removed } = migrateHookNames(hooks)
// then: Removed hook should be filtered out
expect(changed).toBe(true)
expect(migrated).toEqual(["comment-checker"])
expect(removed).toEqual(["gpt-permission-continuation"])
})
test("handles mixed migration and removal", () => {
// given: Config with both legacy rename and removed hooks
const hooks = ["anthropic-auto-compact", "preemptive-compaction", "sisyphus-orchestrator"]
@@ -413,6 +426,20 @@ describe("migrateConfigFile", () => {
expect(rawConfig.disabled_hooks).toEqual(["comment-checker"])
})
test("removes gpt-permission-continuation from disabled_hooks", () => {
// given: Config with removed GPT permission continuation hook
const rawConfig: Record<string, unknown> = {
disabled_hooks: ["gpt-permission-continuation", "comment-checker"],
}
// when: Migrate config file
const needsWrite = migrateConfigFile(testConfigPath, rawConfig)
// then: Removed hook should be filtered out
expect(needsWrite).toBe(true)
expect(rawConfig.disabled_hooks).toEqual(["comment-checker"])
})
test("does not write if no migration needed", () => {
// given: Config with current names
const rawConfig: Record<string, unknown> = {
+1
View File
@@ -10,6 +10,7 @@ export const HOOK_NAME_MAP: Record<string, string | null> = {
// Removed hooks (v3.0.0) - will be filtered out and user warned
"empty-message-sanitizer": null,
"delegate-task-english-directive": null,
"gpt-permission-continuation": null,
}
export function migrateHookNames(