diff --git a/app/api/0pt/documents/structure/route.ts b/app/api/0pt/documents/structure/route.ts index 51689f3..53ffe79 100644 --- a/app/api/0pt/documents/structure/route.ts +++ b/app/api/0pt/documents/structure/route.ts @@ -244,6 +244,7 @@ export async function POST(request: NextRequest) { ); } + console.log('[0pt-workbench] doc0 source read:', sources.sources.length, 'segments'); const sourceChars = sources.sources.reduce((total, source) => total + source.text.length, 0); const estimatedInputTokens = Math.ceil(JSON.stringify(sources.sources).length / 4) + 1024; if (estimatedInputTokens > policy.maxInputTokens) { @@ -433,6 +434,7 @@ export async function POST(request: NextRequest) { } } const message = error instanceof Error ? error.message : 'Structuring failed'; + console.error('[0pt-workbench] structure failed:', message); return NextResponse.json( { error: 'STRUCTURE_FAILED', message, reservation_id: reservationId }, { status: 502 },