{"record":{"id":"bc63aa69b3e77990","repo":"slidevjs/slidev","slug":"no-active-slide-entry-found-please-set-an-active","errorCode":null,"errorMessage":"No active slide entry found. Please set an active slide entry before using this tool.","messagePattern":"No active slide entry found\\. Please set an active slide entry before using this tool\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vscode/src/lmTools.ts","lineNumber":115,"sourceCode":"      try {\n        const result = invoke(input)\n        return new LanguageModelToolResult([\n          new LanguageModelTextPart(result),\n        ])\n      }\n      catch (error: any) {\n        return new LanguageModelToolResult([\n          new LanguageModelTextPart(`Error: ${error.message || error.toString()}`),\n        ])\n      }\n    },\n  }))\n}\n\nfunction resolveProjectFromEntry(entry: string) {\n  if (entry === '' || entry === '$ACTIVE_SLIDE_ENTRY') {\n    if (!activeEntry.value) {\n      throw new Error('No active slide entry found. Please set an active slide entry before using this tool.')\n    }\n    entry = activeEntry.value\n  }\n\n  let project = projects.get(entry)\n  if (!project) {\n    entry = slash(entry)\n    const possibleProjects = [...projects.values()].filter(p => p.entry.includes(entry))\n    if (possibleProjects.length === 0) {\n      throw new Error(`No project found for entry: ${entry}. All entries: ${formatList(projects.keys())}`)\n    }\n    else if (possibleProjects.length > 1) {\n      throw new Error(`Multiple projects found for entry: ${entry}. Please specify the full path. All entries: ${formatList(projects.keys())}`)\n    }\n    else {\n      project = possibleProjects[0]\n    }\n  }","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/vscode/src/lmTools.ts#L97-L133","documentation":"Thrown by `resolveProjectFromEntry` (shared by most Slidev LM tools) when the entry is the sentinel `''` or `'$ACTIVE_SLIDE_ENTRY'` but no active entry has been set yet (`activeEntry.value` is falsy). These sentinels mean 'use whatever the user last chose'; if nothing was chosen, resolution cannot proceed.","triggerScenarios":"Any tool that calls `resolveProjectFromEntry` receives an empty string or `$ACTIVE_SLIDE_ENTRY` (e.g. the model omits a concrete path and relies on the default), but `activeEntry` was never populated because `slidev_chooseEntry` was not called successfully.","commonSituations":"The model calls `slidev_getSlideContent` / `slidev_findSlideNoByTitle` / etc. without first establishing which deck is active; the user opened a deck but never ran `chooseEntry`; the extension was reloaded and `activeEntry` reset to empty.","solutions":["Call `slidev_chooseEntry` with a concrete entry path first to populate `activeEntry`, then retry the original tool.","Alternatively, pass an explicit `entrySlidePath` to the tool instead of relying on `$ACTIVE_SLIDE_ENTRY`.","Use `slidev_listEntries` to discover a valid entry path if you don't know one."],"exampleFix":"// before: relying on the active sentinel before one is set\n{ entrySlidePath: '$ACTIVE_SLIDE_ENTRY', slideNo: 1 } // throws [47]\n// after: establish the active entry first\n// step 1: slidev_chooseEntry { entrySlidePath: '/abs/slides.md' }\n// step 2: slidev_getSlideContent { entrySlidePath: '$ACTIVE_SLIDE_ENTRY', slideNo: 1 }","handlingStrategy":"validation","validationCode":"// Before calling any tool with '$ACTIVE_SLIDE_ENTRY' or '', ensure one is set:\nimport { activeEntry } from './projects'\nfunction hasActiveEntry(): boolean {\n  return Boolean(activeEntry.value)\n}\n// if false, call slidev_chooseEntry first, or pass an explicit entrySlidePath.","typeGuard":"function activeEntryIsSet(): boolean {\n  return activeEntry.value != null && activeEntry.value !== ''\n}","tryCatchPattern":null,"preventionTips":["Establish the active entry with `slidev_chooseEntry` at the start of any tool session.","Prefer passing an explicit `entrySlidePath` over the `$ACTIVE_SLIDE_ENTRY` sentinel.","After an extension reload, re-choose the entry since `activeEntry` does not persist.","Use `slidev_listEntries` to confirm a project is loaded before relying on the active sentinel."],"tags":["slidev","vscode","language-model-tools","active-entry","state"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}