Skip to content

Commit 17f33a1

Browse files
authored
fix(js/core): Fix DAP resolution (#5166)
1 parent 1edd267 commit 17f33a1

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

js/core/src/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class Registry {
197197
const parsedKey = parseRegistryKey(key);
198198
if (parsedKey?.dynamicActionHost) {
199199
const hostId = `/dynamic-action-provider/${parsedKey.dynamicActionHost}`;
200-
const dap = await this.actionsById[hostId];
200+
const dap = await this.lookupAction(hostId);
201201
if (!dap || !isDynamicActionProvider(dap)) {
202202
return [];
203203
}

js/core/tests/registry_test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,4 +634,25 @@ describe('registry class', () => {
634634
);
635635
});
636636
});
637+
638+
describe('resolveActionNames', () => {
639+
it('resolves dynamic actions from parent registry', async () => {
640+
const tool1 = action(
641+
{ name: 'fs/tool1', actionType: 'tool' },
642+
async () => {}
643+
);
644+
defineDynamicActionProvider(registry, 'my-dap', async () => ({
645+
tool: [tool1],
646+
}));
647+
648+
const childRegistry = new Registry(registry);
649+
650+
const resolved = await childRegistry.resolveActionNames(
651+
'/dynamic-action-provider/my-dap:tool/fs/tool1'
652+
);
653+
assert.deepStrictEqual(resolved, [
654+
'/dynamic-action-provider/my-dap:tool/fs/tool1',
655+
]);
656+
});
657+
});
637658
});

0 commit comments

Comments
 (0)