{"record":{"id":"987dd89c8f543c54","repo":"nexu-io/open-design","slug":"unsupported-local-file-refresh-tool-toolname","errorCode":null,"errorMessage":"unsupported local_file refresh tool: ${toolName}","messagePattern":"unsupported local_file refresh tool: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/live-artifacts/refresh.ts","lineNumber":710,"sourceCode":"  if (!response.ok) {\n    throw new Error(`public_github_repository_metric request failed with ${response.status}`);\n  }\n  const parsed = await response.json() as Record<string, unknown>;\n  const output: BoundedJsonObject = { toolName: 'public_github_repository_metric' };\n  for (const field of selectGithubFields(input)) {\n    const value = parsed[field];\n    if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) {\n      output[field] = value;\n    }\n  }\n  return asBoundedRefreshOutput(output);\n}\n\nexport async function executeLocalDaemonRefreshSource(options: ExecuteLocalDaemonRefreshSourceOptions): Promise<BoundedJsonObject> {\n  if (options.source.type === 'local_file') {\n    const toolName = options.source.toolName ?? 'project_files.read_json';\n    if (toolName !== 'project_files.read_json') {\n      throw new Error(`unsupported local_file refresh tool: ${toolName}`);\n    }\n    return executeProjectFilesReadJson({\n      ...options,\n      source: {\n        ...options.source,\n        type: 'daemon_tool',\n        toolName,\n      },\n    });\n  }\n\n  if (options.source.type !== 'daemon_tool') {\n    throw new Error('local daemon refresh sources require source.type daemon_tool or local_file');\n  }\n  if (!isLocalDaemonRefreshToolName(options.source.toolName)) {\n    throw new Error(`unsupported local daemon refresh tool: ${options.source.toolName ?? '<missing>'}`);\n  }\n","sourceCodeStart":692,"sourceCodeEnd":728,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/live-artifacts/refresh.ts#L692-L728","documentation":"Thrown by executeLocalDaemonRefreshSource when source.type is 'local_file' but source.toolName is set to anything other than 'project_files.read_json' (the only currently-supported local_file tool; toolName defaults to project_files.read_json when omitted). Any other toolName under local_file is rejected before dispatch because no handler exists.","triggerScenarios":"source = { type: 'local_file', toolName: 'git.summary' }; source = { type: 'local_file', toolName: 'project_files.search' }; source = { type: 'local_file', toolName: 'public_github_repository_metric' }.","commonSituations":"Model assumes any daemon tool can run against a local file source; config copy-pasted from a daemon_tool entry but type left as local_file; misunderstanding that local_file is a narrow alias only for read_json.","solutions":["For non-read_json tools, set source.type to 'daemon_tool' (the general case).","If you want JSON-from-file behavior, either omit toolName or set it explicitly to 'project_files.read_json'.","Re-check the supported matrix: local_file -> project_files.read_json only; daemon_tool -> project_files.search, project_files.read_json, git.summary, public_github_repository_metric."],"exampleFix":"// before\nsource: { type: 'local_file', toolName: 'git.summary', input: {...} }\n// after\nsource: { type: 'daemon_tool', toolName: 'git.summary', input: {...} }","handlingStrategy":"validation","validationCode":"function coerceLocalFileSource(s: { type: string; toolName?: string }) {\n  if (s.type === 'local_file' && s.toolName && s.toolName !== 'project_files.read_json') {\n    return { ...s, type: 'daemon_tool' };\n  }\n  return s;\n}","typeGuard":"function isLocalFileReadJson(s: unknown): boolean {\n  return typeof s === 'object' && s !== null\n    && (s as any).type === 'local_file'\n    && ((s as any).toolName ?? 'project_files.read_json') === 'project_files.read_json';\n}","tryCatchPattern":null,"preventionTips":["Remember local_file is an alias for project_files.read_json only.","For all other tools, use type 'daemon_tool'.","Validate source shape against a schema before queuing a refresh."],"tags":["validation","routing","live-artifacts","refresh-source"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}