You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: curation fails with 'unexpected end of JSON input' — VertexSynthesizer MaxTokens hardcoded at 4096 #76
dewey curate fails for any vault with moderate content density. The VertexSynthesizer.Synthesize method hardcodes MaxTokens: 4096, but real-world curation extractions consistently produce responses larger than 4,096 output tokens. Claude truncates mid-JSON array → ParseExtractionResponse fails with parse LLM response as JSON array: unexpected end of JSON input.
Reproduction
Configure a knowledge store with rich markdown content (pursuits, dossier, account context — ~9-42 documents). Run dewey curate. Observe the error:
❌ <store>: parse extraction response: parse LLM response as JSON array: unexpected end of JSON input
Confirmed with stores containing as few as 9 documents when those documents contain rich markdown (dossiers, agreements, email context).
Root Cause
llm/vertex.go:
reqBody:=vertexSynthRequest{
AnthropicVersion: "vertex-2023-10-16",
MaxTokens: 4096, // ← hardcoded, too small for curation...
}
A store with 9 richly-structured documents (134KB input) produced 16,000 output tokens — hitting the cap mid-JSON array. The stop_reason returned by Vertex is max_tokens.
Fix
Raise MaxTokens to 16000 (or make it configurable). Curation extraction is the primary consumer of Synthesize() and produces large JSON arrays; other callers (compile) produce shorter outputs.
MaxTokens: 16000,
Context
Discovered while running curation against several knowledge stores on Vertex AI with claude-sonnet-4-6@default. The max_tokens: 4096 limit was appropriate when the Vertex synthesizer was primarily used for compile operations but is insufficient for curation extraction.
Activity
fix(curate): improve Vertex AI reliability for large curation extract…
fix(curate): improve Vertex AI reliability for large curation extract…