refactor: narrow synchronous extension contracts

This commit is contained in:
Tianyi Cui
2026-07-13 11:58:55 +08:00
parent f7b9cea733
commit f32cfafa1a
33 changed files with 148 additions and 126 deletions
+2 -2
View File
@@ -677,7 +677,7 @@ describe('ToolRegistry', () => {
const dispose = ctx.tools.register({ ...echoTool, name: 'disposable' })
expect(ctx.tools.schemas().map(t => t.name)).toEqual(['echo', 'disposable'])
await dispose()
dispose()
expect(ctx.tools.schemas().map(t => t.name)).toEqual(['echo'])
})
@@ -698,7 +698,7 @@ describe('ToolRegistry', () => {
// exposed exactly once (the duplicate-name check is not wedged).
const dispose = ctx.tools.register(echoTool)
expect(ctx.tools.schemas().map(t => t.name)).toEqual(['echo'])
await dispose()
dispose()
expect(ctx.tools.get('echo')).toBeUndefined()
})