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
Showing the changes to packages/kernel/runtime-quickjs/src (2 of 9 files). Show all
Unified · Split
| @@ -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 | ); |
| @@ -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) {", |