fix: make Prisma import lazy in playground to prevent module initialization failures
- Remove top-level Prisma import from dynamic-tool-loader.ts - Use dynamic import in reportToolFailure function instead - Prevents entire module from failing if DATABASE_URL is missing - Fixes API route timeout issue caused by module initialization failure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
e6c1be6a53
commit
e3b6ff6d25
1 changed files with 3 additions and 1 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { prisma } from '@tpmjs/db';
|
||||
import { jsonSchema, tool } from 'ai';
|
||||
|
||||
// Cache for tool wrappers (process-level)
|
||||
|
|
@ -49,6 +48,9 @@ async function reportToolFailure(
|
|||
phase: 'import' | 'execution'
|
||||
): Promise<void> {
|
||||
try {
|
||||
// Lazy load Prisma to avoid module initialization failures
|
||||
const { prisma } = await import('@tpmjs/db');
|
||||
|
||||
// Find the tool in the database
|
||||
const tool = await prisma.tool.findFirst({
|
||||
where: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue