Merge pull request #68 from schergr/fix/osint-signal-truncation

Fix remaining OSINT signal text truncation
This commit is contained in:
Calesthio
2026-03-25 10:21:02 -07:00
committed by GitHub
5 changed files with 75 additions and 18 deletions

View File

@@ -88,10 +88,20 @@ function compactSweepForLLM(data, delta, previousIdeas) {
sections.push(`SUPPLY_CHAIN: GSCPI=${data.gscpi.value} (${data.gscpi.interpretation})`);
}
// Geopolitical signals
// Geopolitical signals (cap total OSINT text to ~1500 chars to keep prompt compact)
const urgentPosts = (data.tg?.urgent || []).slice(0, 5);
if (urgentPosts.length) {
sections.push(`URGENT_OSINT:\n${urgentPosts.map(p => `- ${(p.text || '').substring(0, 120)}`).join('\n')}`);
const MAX_OSINT_CHARS = 1500;
let remaining = MAX_OSINT_CHARS;
const lines = [];
for (const p of urgentPosts) {
const text = p.text || '';
if (remaining <= 0) break;
const trimmed = text.length > remaining ? text.substring(0, remaining) + '…' : text;
lines.push(`- ${trimmed}`);
remaining -= trimmed.length;
}
sections.push(`URGENT_OSINT:\n${lines.join('\n')}`);
}
// Thermal / fire detections