{"record":{"id":"42a4efd8359166c8","repo":"ComposioHQ/composio","slug":"proxy-requires-a-non-empty-toolkit-string","errorCode":null,"errorMessage":"proxy() requires a non-empty toolkit string.","messagePattern":"proxy\\(\\) requires a non-empty toolkit string\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli/src/services/run-helpers-runtime.ts","lineNumber":395,"sourceCode":"    } else if (Predicate.isRecord(inputSchema)) {\n      structuredSchema = inputSchema;\n    } else {\n      throw new Error('experimental_subAgent() schema must be a Zod schema or JSON Schema object.');\n    }\n  }\n  return {\n    ...(requestedTarget === undefined ? {} : { target: requestedTarget }),\n    ...(typeof options.model === 'string' ? { model: options.model } : {}),\n    ...(options.schema === undefined ? {} : { schema: options.schema }),\n    ...(options.jsonSchema === undefined ? {} : { jsonSchema: options.jsonSchema }),\n    ...(structuredSchema === undefined ? {} : { structuredSchema }),\n    ...(zodSchema === undefined ? {} : { zodSchema }),\n  };\n};\n\nconst normalizeProxyToolkit = (toolkit: string) => {\n  if (typeof toolkit !== 'string' || toolkit.trim().length === 0) {\n    throw new Error('proxy() requires a non-empty toolkit string.');\n  }\n  return toolkit.trim();\n};\n\nconst normalizeFetchHeaders = (headers: HeadersInit | undefined) => {\n  if (!headers) return [];\n  const normalized: Array<{ name: string; type: string; value: string }> = [];\n  new Headers(headers).forEach((value, name) => {\n    normalized.push({ name, type: 'header', value });\n  });\n  return normalized;\n};\n\nconst normalizeFetchBody = async (body: unknown) => {\n  if (body === undefined || body === null) return undefined;\n  if (typeof body === 'string' || typeof body === 'number' || typeof body === 'boolean')\n    return body;\n  if (typeof Blob !== 'undefined' && body instanceof Blob) return await body.text();","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli/src/services/run-helpers-runtime.ts#L377-L413","documentation":"The proxy() helper's first argument is a toolkit name string. normalizeProxyToolkit throws when the value is not a string or trims to empty, before any network call is made.","triggerScenarios":"Calling proxy('') , proxy('   '), or passing a non-string (undefined variable, number, null) as the toolkit slug.","commonSituations":"Toolkit name read from config/env that is unset or blank; template literal producing empty string; passing a toolkit object instead of its slug name.","solutions":["Pass a non-empty toolkit slug, e.g. proxy('github')","Default the variable: toolkitName || 'github'","Log/validate the toolkit name at config load time when it comes from user input"],"exampleFix":"// before\nconst tk = process.env.TOOLKIT ?? '';\nproxy(tk);\n// after\nconst tk = process.env.TOOLKIT;\nif (!tk) throw new Error('TOOLKIT env var is required');\nproxy(tk);","handlingStrategy":"validation","validationCode":"if (typeof toolkit !== 'string' || toolkit.trim().length === 0) throw new RangeError('toolkit slug required');\nproxy(toolkit);","typeGuard":"const isNonEmptyToolkit = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Default toolkit names at config load","Treat blank env values as missing (env.VAR?.trim() || null)"],"tags":["proxy","toolkit","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}