feat(hashline): change hashline_edit default from true to false
Hashline edit tool and companion hooks now require explicit opt-in via `"hashline_edit": true` in config. Previously enabled by default. - tool-registry: hashline edit tool not registered unless opted in - create-tool-guard-hooks: hashline-read-enhancer disabled by default - Updated config schema comment and documentation - Added TDD tests for default behavior
This commit is contained in:
@@ -100,7 +100,7 @@ export function createToolGuardHooks(args: {
|
||||
: null
|
||||
|
||||
const hashlineReadEnhancer = isHookEnabled("hashline-read-enhancer")
|
||||
? safeHook("hashline-read-enhancer", () => createHashlineReadEnhancerHook(ctx, { hashline_edit: { enabled: pluginConfig.hashline_edit ?? true } }))
|
||||
? safeHook("hashline-read-enhancer", () => createHashlineReadEnhancerHook(ctx, { hashline_edit: { enabled: pluginConfig.hashline_edit ?? false } }))
|
||||
: null
|
||||
|
||||
const jsonErrorRecovery = isHookEnabled("json-error-recovery")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const { describe, expect, test } = require("bun:test")
|
||||
const { createToolExecuteBeforeHandler } = require("./tool-execute-before")
|
||||
const { createToolRegistry } = require("./tool-registry")
|
||||
|
||||
describe("createToolExecuteBeforeHandler", () => {
|
||||
test("does not execute subagent question blocker hook for question tool", async () => {
|
||||
@@ -219,4 +220,54 @@ describe("createToolExecuteBeforeHandler", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("createToolRegistry", () => {
|
||||
function createRegistryInput(overrides = {}) {
|
||||
return {
|
||||
ctx: {
|
||||
directory: process.cwd(),
|
||||
client: {},
|
||||
},
|
||||
pluginConfig: {
|
||||
...overrides,
|
||||
},
|
||||
managers: {
|
||||
backgroundManager: {},
|
||||
tmuxSessionManager: {},
|
||||
skillMcpManager: {},
|
||||
},
|
||||
skillContext: {
|
||||
mergedSkills: [],
|
||||
availableSkills: [],
|
||||
browserProvider: "playwright",
|
||||
disabledSkills: new Set(),
|
||||
},
|
||||
availableCategories: [],
|
||||
}
|
||||
}
|
||||
|
||||
describe("#given hashline_edit is undefined", () => {
|
||||
describe("#when creating tool registry", () => {
|
||||
test("#then should not register edit tool", () => {
|
||||
const result = createToolRegistry(createRegistryInput())
|
||||
|
||||
expect(result.filteredTools.edit).toBeUndefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given hashline_edit is true", () => {
|
||||
describe("#when creating tool registry", () => {
|
||||
test("#then should register edit tool", () => {
|
||||
const result = createToolRegistry(
|
||||
createRegistryInput({
|
||||
hashline_edit: true,
|
||||
}),
|
||||
)
|
||||
|
||||
expect(result.filteredTools.edit).toBeDefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
export {}
|
||||
|
||||
@@ -113,7 +113,7 @@ export function createToolRegistry(args: {
|
||||
}
|
||||
: {}
|
||||
|
||||
const hashlineEnabled = pluginConfig.hashline_edit ?? true
|
||||
const hashlineEnabled = pluginConfig.hashline_edit ?? false
|
||||
const hashlineToolsRecord: Record<string, ToolDefinition> = hashlineEnabled
|
||||
? { edit: createHashlineEditTool() }
|
||||
: {}
|
||||
|
||||
Reference in New Issue
Block a user