fix(ai): register execute_sql tool in Electron tool registry

sqlQueryTool (execute_sql) was listed in BUILTIN_TOOL_CATALOG and
available in the CLI AGENT_TOOL_REGISTRY, but was never imported or
registered in the Electron-specific TOOL_REGISTRY. Users who enabled
the tool via the assistant config panel would trigger a missing-tool
error at inference time.

Add sqlQueryTool to the Electron registry following the same
adaptSharedTool pattern used by all other analysis tools. Add a
catalog/registry drift guard test (name + category) covering all
BUILTIN_TOOL_CATALOG entries, enabled via
--experimental-test-module-mocks to mock Electron runtime deps.
Document the general-over-specific assertion rule in AGENTS.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
diguaandClaude Sonnet 4.6 committed 2026-06-10 00:15:25 +08:00
1 parent 7af7fb1f10
commit f5e83748ff
5 files changed
+40 -2

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ export function collectDefaultTestFiles(rootDir = process.cwd()) {
}
export function buildNodeTestArgs(testArgs) {
return ['--import', 'tsx', '--test', ...testArgs]
return ['--experimental-test-module-mocks', '--import', 'tsx', '--test', ...testArgs]
}
function run() {
+1
View File
@@ -23,6 +23,7 @@ test('default test collection excludes e2e, smoke, and real external tests', ()
test('explicit test arguments are passed through without default exclusions', () => {
assert.deepEqual(buildNodeTestArgs(['tests/e2e/helpers/app-launcher.test.js']), [
'--experimental-test-module-mocks',
'--import',
'tsx',
'--test',