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:
@@ -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> = {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user