{"record":{"id":"801aaee6cfe3d215","repo":"can1357/oh-my-pi","slug":"vibe-tools-are-unavailable-in-this-session","errorCode":null,"errorMessage":"Vibe tools are unavailable in this session.","messagePattern":"Vibe tools are unavailable in this session\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/session/session-tools.ts","lineNumber":572,"sourceCode":"\t\t\t\tscope: \"temporary\",\n\t\t\t\torigin: \"top-level\",\n\t\t\t};\n\t\t\treturn { name, description: tool.description, parameters: tool.parameters, sourceInfo };\n\t\t});\n\t}\n\n\t#wrapRuntimeTool(tool: AgentTool): AgentTool {\n\t\tconst wrapped = wrapToolWithMetaNotice(tool);\n\t\tconst extensionRunner = this.#host.extensionRunner();\n\t\treturn extensionRunner ? new ExtensionToolWrapper(wrapped, extensionRunner) : wrapped;\n\t}\n\n\t/** Installs and activates the ephemeral vibe tool set. */\n\tactivateVibeTools(baseToolNames: string[]): Promise<void> {\n\t\treturn this.runToolRegistryMutation(async () => {\n\t\t\tconst createVibeTools = this.#createVibeTools;\n\t\t\tif (!createVibeTools) {\n\t\t\t\tthrow new Error(\"Vibe tools are unavailable in this session.\");\n\t\t\t}\n\n\t\t\tconst tools = createVibeTools();\n\t\t\tconst vibeToolNames = tools.map(tool => tool.name);\n\t\t\tif (new Set(vibeToolNames).size !== vibeToolNames.length) {\n\t\t\t\tthrow new Error(\"Vibe tool names must be unique.\");\n\t\t\t}\n\n\t\t\tfor (const tool of tools) {\n\t\t\t\tif (this.#toolRegistry.has(tool.name)) continue;\n\t\t\t\tthis.#toolRegistry.set(tool.name, this.#wrapRuntimeTool(tool));\n\t\t\t\tthis.#builtInToolNames.add(tool.name);\n\t\t\t\tthis.#installedVibeToolNames.add(tool.name);\n\t\t\t}\n\n\t\t\tawait this.#applyActiveToolsByName([...new Set([...baseToolNames, ...vibeToolNames])]);\n\t\t});\n\t}","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/session/session-tools.ts#L554-L590","documentation":"SessionTools.activateVibeTools() installs an ephemeral 'vibe' tool set, but the factory that creates those tools (#createVibeTools) is only injected when the session is constructed with vibe support enabled. When it is undefined, the method throws this Error before touching the tool registry, indicating this session simply cannot host vibe tools.","triggerScenarios":"Calling activateVibeTools on a SessionTools instance whose createVibeTools factory was never supplied at construction — e.g. sessions created without the vibe-tools option, or in builds/modes where the vibe toolset is not registered.","commonSituations":"SDK consumers enabling vibe mode on a plain session instead of a vibe-capable one; running an older/newer build where vibe tools are gated; a plugin or extension calling activateVibeTools unconditionally without checking availability.","solutions":["Check whether the session supports vibe tools before activating (e.g. expose/inspect an availability flag or try to construct the factory yourself and pass it in).","Create the session with vibe tool support enabled (supply createVibeTools factory at SessionTools construction).","If vibe tools are intentionally unsupported here, skip activation rather than calling it.","Update the package if a newer version gates the factory differently than your code expects."],"exampleFix":"// before\nawait sessionTools.activateVibeTools(baseNames);\n// after\nif (sessionTools.hasVibeTools) {\n  await sessionTools.activateVibeTools(baseNames);\n} else {\n  logger.warn(\"Vibe tools not available in this session\");\n}","handlingStrategy":"validation","validationCode":"// gate the call on capability, e.g. via an exposed flag or option used at construction\nif (!sessionOptions.createVibeTools) {\n  logger.warn(\"Session created without vibe tool support; skipping activation\");\n} else {\n  await sessionTools.activateVibeTools(baseToolNames);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await sessionTools.activateVibeTools(baseToolNames);\n} catch (err) {\n  if (err.message.includes(\"Vibe tools are unavailable\")) {\n    logger.warn(\"Vibe tools not supported in this session; continuing without them\");\n  } else throw err;\n}","preventionTips":["Construct sessions with the vibe factory when you intend to use vibe mode.","Check availability before activating rather than relying on the throw.","Keep package versions aligned between the session creator and vibe activation code.","In shared/extension code, make vibe activation opt-in via configuration."],"tags":["session","tools","configuration","feature-flag"],"backgroundTag":"feature-unavailable","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}