From cdba58ccda05d10dd02f9dcb447f624377744b21 Mon Sep 17 00:00:00 2001 From: Agando Date: Fri, 23 Oct 2026 21:22:30 +0200 Subject: fix(newos4): world_model_query default path parses again (v4.6.83-84) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _modelDigest() returned JSON.stringify(...) cut at 4000 chars plus '…(digest truncated)'. The tool then did JSON.parse() on it, so the default detail threw 'Unexpected end of JSON input' every single call; detail:'full' worked only because it returned the object untouched. The digest now returns an OBJECT (_modelSnapshot) and shrinks by reducing list lengths, then by dropping whole sections with an explicit 'omitted' list. The string form is generated at the edge and is always valid JSON. Verified: default call -> no error, 13-key snapshot, facts answered; caps 400/1200/4000 all under cap and parseable; the residual floor at cap 200 is identity fields only. --- modules/core/module-aiassist.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/core/module-aiassist.js') diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index c3ebe1f..55dde6f 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -3170,7 +3170,10 @@ buildSystemPrompt() { facts: wm._answerQuery(a.question || ''), version: wm._model.version, synthesized: wm._model.synthesized, - snapshot: (a.detail === 'full') ? wm._model : JSON.parse(wm._modelDigest()) + // v4.6.83: this was JSON.parse(wm._modelDigest()) and the digest was a + // string truncated mid-token, so the default path always threw + // "Unexpected end of JSON input". The model now hands back an object. + snapshot: (a.detail === 'full') ? wm._model : wm._modelSnapshot() }; return JSON.stringify(wmOut); } -- cgit v1.2.3