Reduce turn latency: cap recent events (10→5) + concise-reasoning constraint (v0.9.0)
CI / build + unit + e2e (pull_request) Successful in 2m9s

Fixes #22
This commit is contained in:
2026-10-11 20:59:18 +00:00
parent 858b901b8d
commit e38cc5933f
4 changed files with 46 additions and 3 deletions
+2 -1
View File
@@ -59,6 +59,7 @@ export function buildSystemPrompt(preset: Preset): string {
'HARD CONSTRAINTS',
'- Use only nation ids and ISO_A3 codes that exist in the provided state.',
'- Prefer 1-4 events per turn; keep each text 1-3 sentences.',
'- Keep your internal reasoning brief (a few sentences) and go straight to the JSON result; do not over-deliberate or re-derive facts already present in the state.',
'- Keep every stat value between 0 and 100.',
'- Only change borders when war or a decisive political shift justifies it.',
'- If a field is not relevant this turn, set it to an empty array.',
@@ -95,7 +96,7 @@ export function buildUserPrompt(state: GameState, items: RoundItem[]): string {
nations: Object.fromEntries(
Object.entries(state.nations).map(([id, n]) => [id, nationForPrompt(n)]),
),
recentEvents: state.events.slice(-10).map((e) => ({
recentEvents: state.events.slice(-5).map((e) => ({
turn: e.turn,
date: e.date,
nation: e.nation,