History

Let an empty-query namespace search enumerate the full catalog (#1387)

tools.search refused empty queries outright, and the sandbox proxy hint pointed agents at it as the way to discover tools: a namespace catalog could be counted (integrations.list reports toolCount) but never listed. Agents were left unioning keyword searches to lower-bound a catalog they could not confirm. An empty query with a namespace now enumerates: the whole catalog, path-sorted at score 0, through the existing limit/offset paging, with total an exact census that reconciles against toolCount. An empty query without a namespace still returns nothing (no scope, no signal, no arbitrary workspace dump), and ranked search is untouched. The proxy enumeration hints in all three runtimes now mention the namespace form. Fixes #1383

Rhys Sullivan committed 4 months ago

Commit 4fd94dc1 parent 0b0dab49 files · +316 −23Browse files

Showing the changes to packages/kernel/runtime-quickjs/src (2 of 9 files). Show all

Unified · Split

2 files
  1. packages/kernel/runtime-quickjs/src/index.test.ts +2 −2
  2. packages/kernel/runtime-quickjs/src/index.ts +1 −1
packages/kernel/runtime-quickjs/src/index.test.ts+2−2
@@ -363,9 +363,9 @@ describe("quickjs executor", () => { · 362 unmodified lines
363 363
364 expect(result.error).toBeUndefined();364 expect(result.error).toBeUndefined();
365 expect(result.result).toEqual({365 expect(result.result).toEqual({
366 keys: 'tools is a lazy proxy and cannot be enumerated. Use tools.search({ query: "..." }) to find tools, or tools.executor.coreTools.connections.list({}) to list saved connections.',366 keys: 'tools is a lazy proxy and cannot be enumerated. Use tools.search({ query: "..." }) to find tools, tools.search({ namespace: "<integration>", query: "" }) to list every tool in an integration, or tools.executor.coreTools.connections.list({}) to list saved connections.',
367 spread:367 spread:
368 'tools.github is a lazy proxy and cannot be enumerated. Use tools.search({ query: "..." }) to find tools, or tools.executor.coreTools.connections.list({}) to list saved connections.',368 'tools.github is a lazy proxy and cannot be enumerated. Use tools.search({ query: "..." }) to find tools, tools.search({ namespace: "<integration>", query: "" }) to list every tool in an integration, or tools.executor.coreTools.connections.list({}) to list saved connections.',
369 });369 });
370 }),370 }),
371 );371 );
packages/kernel/runtime-quickjs/src/index.ts+1−1
@@ -170,7 +170,7 @@ const buildExecutionSource = (code: string): string => { · 169 unmodified lines
170 "};",170 "};",
171 "const __toolsEnumerationError = (path) => new Error(",171 "const __toolsEnumerationError = (path) => new Error(",
172 " (path.length === 0 ? 'tools' : 'tools.' + path.join('.')) +",172 " (path.length === 0 ? 'tools' : 'tools.' + path.join('.')) +",
173 " ' is a lazy proxy and cannot be enumerated. Use tools.search({ query: \"...\" }) to find tools, or tools.executor.coreTools.connections.list({}) to list saved connections.',",173 ' \' is a lazy proxy and cannot be enumerated. Use tools.search({ query: "..." }) to find tools, tools.search({ namespace: "<integration>", query: "" }) to list every tool in an integration, or tools.executor.coreTools.connections.list({}) to list saved connections.\',',
174 ");",174 ");",
175 "const __makeToolsProxy = (path = []) => new Proxy(() => undefined, {",175 "const __makeToolsProxy = (path = []) => new Proxy(() => undefined, {",
176 " get(_target, prop) {",176 " get(_target, prop) {",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t