From 2b5bf86b0f16ec980605ac307d03f8d0afd8d25a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Mar 2026 18:42:56 +0000 Subject: [PATCH] fix: bump maxTokens again (800/500) and add conciseness instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Post-restart logs show model still hitting 600-token ceiling on verbose responses — truncated JSON at exactly 599-600 output tokens. Average successful response was ~418 tokens but outliers reach 600+. Added explicit conciseness instructions to backstory prompt to reduce variance. Co-Authored-By: Claude Opus 4.6 --- server/src/llm/templates.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/llm/templates.ts b/server/src/llm/templates.ts index 856726a..f3ff6c8 100644 --- a/server/src/llm/templates.ts +++ b/server/src/llm/templates.ts @@ -69,11 +69,12 @@ export const templates: Record = { backstoryAndDesires: { name: 'backstoryAndDesires', - maxTokens: 600, + maxTokens: 800, systemPrompt: 'Write a brief backstory (1-2 sentences) and 1-2 initial desires for this settler. ' + 'The backstory should reflect their personality without referencing professions or institutions that do not exist. ' + 'Desires should be grounded in what is achievable or aspirational given the current world state.\n\n' + + 'Be concise. Keep backstory under 2 sentences. Keep desire descriptions short (under 10 words).\n\n' + 'Respond ONLY with a valid JSON object. No explanation, no markdown, just JSON.', userPrompt: 'New settler: {{npcName}}\n' + @@ -83,7 +84,7 @@ export const templates: Record = { '- Existing structures: {{structureList}}\n\n' + 'Respond with JSON:\n' + '{"backstory": "1-2 sentence backstory", "desires": [' + - '{"description": "human-readable desire", ' + + '{"description": "short desire", ' + '"category": "material|social|shelter|comfort|community|creative", ' + '"fulfillment": {"type": "own_item|structure_exists|building_exists|relationship_tier|recipe_exists|custom", ...criteria}, ' + '"priority": 0.0-1.0}]}', @@ -91,7 +92,7 @@ export const templates: Record = { desireGeneration: { name: 'desireGeneration', - maxTokens: 400, + maxTokens: 500, systemPrompt: 'Generate a new personal desire for this settler based on their personality and recent experiences.\n\n' + 'Respond ONLY with a valid JSON object. No explanation, no markdown, just JSON.',