From bc99dfba1898123ea824de98a2d5a06e996ed667 Mon Sep 17 00:00:00 2001 From: Agando Date: Fri, 23 Oct 2026 20:59:29 +0200 Subject: fix(newos4): outboxResult scoped, markdown mime, old reply path retired (v4.6.81) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit delegateTask declared `const outboxResult` inside the AI branch and returned it outside, so a delegation with the AI module missing threw 'outboxResult is not defined'. The catch turned that into _handleAgentFailure: the worker stayed idle with no result while spawn_agent reported ok — the reported symptom exactly. Now function-scoped, and the no-module path returns 'queued — AI module not loaded, nothing executed' rather than claiming 'completed'. Also: nginx served _docs/*.md as application/octet-stream (no .md type) — now text/markdown + nosniff; agent-replies.php returns 410 for GET as well as POST, so there is one reply path. Verified: with the AI module deleted at runtime, delegateTask returns the queued string and throws nothing. --- api/debug/agent-replies.php | 59 ++++++++++++------------------------- help.html | 18 +++++++++++ main.html | 6 ++-- modules/core/core-bundle.js | 9 ++++-- modules/core/module-loader.js | 2 +- modules/core/module-orchestrator.js | 9 ++++-- 6 files changed, 55 insertions(+), 48 deletions(-) diff --git a/api/debug/agent-replies.php b/api/debug/agent-replies.php index 2d2e2b2..b996a29 100644 --- a/api/debug/agent-replies.php +++ b/api/debug/agent-replies.php @@ -1,45 +1,24 @@ ($r['created_at'] ?? '') > $since)); - } - json_response(['success' => true, 'replies' => array_slice($all, -100)]); -} - -if ($method !== 'POST') { - error_response('Method not allowed', 405); -} - -// v4.6.71: retired. Two write paths meant two truths — messages written here never -// reached the chat thread, so they looked like a conversation nobody answered. -// One write path now: /api/chat/post.php (contract: _docs/chat-contract.md). http_response_code(410); -header('Content-Type: application/json'); +header('Content-Type: application/json; charset=utf-8'); echo json_encode([ - 'success' => false, - 'code' => 'gone', - 'error' => 'POST /api/debug/agent-replies.php is retired', - 'use' => '/spaces/newos4/api/chat/post.php', - 'contract'=> '/spaces/newos4/_docs/chat-contract.md', - 'read' => '/spaces/newos4/api/chat/poll.php', -]); -exit; + 'success' => false, + 'code' => 'gone', + 'error' => 'agent-replies.php is retired — the chat channel replaced it', + 'use' => '/spaces/newos4/api/chat/post.php and /api/chat/poll.php', + 'contract' => '/spaces/newos4/_docs/chat-contract.md', + 'host' => 'python3 /var/www/webx11.duckdns.org/spaces/newos4/scripts/chat.py list', +], JSON_UNESCAPED_SLASHES); diff --git a/help.html b/help.html index c70b641..a989b5b 100644 --- a/help.html +++ b/help.html @@ -1688,6 +1688,24 @@ listmods

📋 Changelog

+
+
v4.6.81 — October 2026 + two silent failures
+
    +
  • Delegation no longer lies. outboxResult was declared inside + the branch that needs the AI module but read outside it, so any delegation with the module + missing threw outboxResult is not defined — caught as an agent failure, leaving + the worker idle with no result. It now returns + queued — AI module not loaded, nothing executed instead of a crash or a false + "completed".
  • +
  • Markdown renders. _docs/*.md was served as + application/octet-stream, so every document opened as a download. Now + text/markdown, with nosniff.
  • +
  • One reply path. agent-replies.php answers + 410 Gone for reads as well as writes, pointing at the chat channel.
  • +
+
+
v4.6.72–80 — October 2026 hardening after review
diff --git a/main.html b/main.html index f27008a..5f57851 100644 --- a/main.html +++ b/main.html @@ -1349,13 +1349,13 @@ - + - + - +