Commit Graph

267 Commits

Author SHA1 Message Date
john 00a00a1f69 fix: portal stability, session list DB fallback, and UX polish
- Free stale Memind listeners on 8081 before startup and exit cleanly on EADDRINUSE
- Backfill owned sessions missing from Goose via h5_conversation_messages summaries
- Strip Memind task orchestration prefixes from user-facing chat text
- Repair missing public docx links before release MindSpace link checks

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:26:34 +08:00
john bdeab23b83 fix: persist direct chat transcript before Goosed escalation
Prevent portal direct-chat history from being lost when snapshot cache
is invalidated on Goosed submit by writing non-empty messages to DB first,
and stop caching empty Goose placeholder messages in snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:16:55 +08:00
john 614837e199 fix: repair chat history from DB when Goose session has empty placeholders
Portal direct chat → goosed escalation can leave hollow Goose messages while
h5_conversation_messages retains the full dialogue. Backfill session detail
from DB, extend snapshot list fallback, and keep stored session id on transient
boot failures so refresh no longer looks like a blank new chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:04:25 +08:00
john d3239ff292 fix: MindSpace remote sync, thumbnail fallback, and Plaza URL guards
Ensure page sync runs via pageSyncService in remote mode, fall back to
workspace HTML when storage assets are missing, and prevent production
Portal from linking to loopback Plaza URLs baked in at build time.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 07:57:04 +08:00
john 4781bbc156 fix: stop chat hang after misrouted themed article requests
Route themed page/article prompts to agent orchestration, reject them
from portal direct chat, and finalize regular sessions to idle when a
direct chat turn already completed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 07:30:37 +08:00
john a29158d589 fix: unblock agent events after portal direct chat escalation
When a session starts with LLM direct chat then escalates to goosed,
invalidate the portal-direct-chat snapshot and stop replaying stale SSE
so page-generation turns stream and finish correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 23:15:44 +08:00
john e45c9300bf feat: LLM intent router, direct chat execution, and Memory V2 light intervention
Wire chat intent routing with direct_chat on regular sessions, skill-selected
short-circuit to Agent, memory light/heavy intervention tiers, and fix direct
chat UI stuck streaming after completion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 22:32:57 +08:00
john bfb6356f7d fix: wire memory v2 runtime helpers 2026-07-04 18:59:36 +08:00
john e4657c7e55 fix: rename h5 execution override to deep reasoning 2026-07-04 14:57:13 +08:00
john 12268110f7 fix: add goose execution override for h5 chat 2026-07-04 14:48:45 +08:00
john 927e16d861 fix(brand): force visible platform-brand footer on published pages
Inject serve-time CSS so author styles cannot hide TKMind · 智趣 with
low opacity, which made pages like weather.html look brandless.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 14:32:36 +08:00
john b782561d08 fix: skip goosed aux calls for direct chat sessions 2026-07-04 14:25:19 +08:00
john b5a88d9746 fix(brand): require TKMind platform marker on wechat page delivery
Backfill missing platform-brand footer at serve time and block service-
account links when the HTML file omits data-mindspace-page-tag.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 14:15:42 +08:00
john cd81c4b2bb fix(release): tolerate volatile persisted files during portal deploy 2026-07-04 14:13:17 +08:00
john 03c46b37c3 fix(og): fall back to thumbnail when declared cover file is missing
WeChat link cards were pointing og:image at mindspace-cover paths that
never landed on disk; serve-time injection now uses thumbnail.png instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 14:07:49 +08:00
john 29d9a87d4f feat: split h5 direct chat from goosed tasks 2026-07-04 14:02:18 +08:00
john eb8d760dd9 test(wechat): align page fixtures with share preview requirements
Mock HTML in wechat-mp tests now includes mindspace-cover metadata so
page link delivery assertions match production guard behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 14:01:39 +08:00
john 31fb0e02cf feat(wechat): require share preview meta before page link delivery
Block service-account page links when HTML lacks mindspace-cover and
description so WeChat forwards always get TKMind branding and thumbnail.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 14:00:26 +08:00
john 031c6e086a feat(wechat): migrate schedule and sync handlers into wechat package
Extract schedule, greeting/status/connectivity replies, chat-general prompt, and display-name helpers from wechat-mp.mjs. Route sync intents via classifyWechatIntent and add channel isolation CI check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 13:48:47 +08:00
tkmind fafc1fe7fd fix(guard): idempotent agent-run pause to stop portal restart loop
Skip repeat guard pause actions when code runs already disabled; add resume script and tests.
2026-07-04 05:41:51 +00:00
tkmind 2a3579c73a feat(wechat): channel split with stub-safe page delivery
Introduce wechat/ channel package; never send stub HTML links to service-account users.
2026-07-04 05:21:13 +00:00
john f36e8b9292 fix(build): externalize resvg when bundling wechat-mp runtime
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 12:54:27 +08:00
john 6bc5d128d2 fix(wechat): deliver failure notices and hot-swappable wechat-mp bundle
Notify users when HTML publish guards reject stub pages instead of silently
failing, send real page links when non-stub files exist, and split wechat-mp
into wechat-mp.bundle.mjs for fast production updates without full portal rebuilds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 12:52:59 +08:00
john 5ed655b6c3 fix(wechat): detect tool_calls errors in Finish reply and sanitize outbound text
When Goose surfaces session poison errors as assistant text instead of Error events,
assertWechatAgentReplyIsSendable now throws to trigger session recreation. Outbound
sanitization prevents raw API errors from reaching WeChat users.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 12:38:00 +08:00
john f3a55dce29 merge: fix/wechat-mp-perf 2026-07-04 12:21:19 +08:00
john 8c72d0c950 fix: tighten WeChat session rotation and defer snapshot refresh
Use session snapshot message counts alongside WeChat route counts so long-lived dedicated sessions rotate before Goose history bloats, and refresh snapshots asynchronously so customer replies are not blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 12:21:14 +08:00
john bef72b2768 fix wechat mp session rotation and bootstrap reuse 2026-07-04 12:10:22 +08:00
john 3139395b58 merge: fix/wechat-tool-calls-session-recovery
Auto-recover WeChat agent sessions when tool_calls history is poisoned.
2026-07-04 09:55:06 +08:00
john 7b09abeaa2 fix: auto-recover WeChat agent sessions poisoned by dangling tool_calls
When a dedicated WeChat session history leaves unmatched tool_calls, the next reply fails with a 400 LLM validation error; detect that pattern and recreate the session before retrying.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 09:53:59 +08:00
john 42baa3e468 test: align public image domain expectations 2026-07-04 00:23:13 +08:00
john 8d6e237128 merge: feature/generate-docx-sandbox into main for release 2026-07-04 00:21:12 +08:00
john 52c7082c70 feat: add generate_docx sandbox MCP tool for public Word downloads
Expose generate_docx in mindspace-sandbox-mcp so agents can write public/*.docx
before linking HTML download pages, with tests mirroring the Mark summary flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 00:18:43 +08:00
john 1ac9ad0277 fix: clarify upload errors and raise upload limits 2026-07-04 00:17:58 +08:00
john 702871a98c fix: restore public page share thumbnails from SVG sidecars
Serve missing *.thumbnail.png requests when the SVG sidecar exists, and schedule async PNG rasterization after public HTML is materialized so WeChat og:image URLs stop 404ing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 00:11:40 +08:00
john 553af7ca7a feat: improve H5 chat header with floating session rail and new chat entry
Move recent session chips below the nav on mobile H5/WeChat with three visible tabs and horizontal swipe, and add a new-chat icon next to notifications.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 23:21:50 +08:00
john c3c487a8fb fix: serve MindSpace public assets as same-origin relative URLs
Rewrite absolute tkmind asset download links to /api/... at delivery time
and strip base tags that violate public page CSP, so images load on any host.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 23:02:47 +08:00
john f543a91cc4 fix: allow inline page scripts in MindSpace public page CSP
Collect sha256 hashes from all inline scripts in published HTML so agent-generated
fade-in animations are not blocked while keeping the share-button CSP model.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 22:42:29 +08:00
john cd2cbdbe78 fix: restore m.tkmind.cn public base 2026-07-03 17:27:51 +08:00
john 145bf4eb01 Merge memind-0703-new01 2026-07-03 16:34:31 +08:00
john 9e4074474b fix: harden session event proxy errors 2026-07-03 16:34:05 +08:00
john ebf06b376b docs: clarify local and 103 runtime topology 2026-07-03 16:34:02 +08:00
john 996c83bbc8 Merge wechat mp page routing fix 2026-07-03 10:43:54 +08:00
john 72fc7cc618 fix wechat mp page reply routing 2026-07-03 10:43:13 +08:00
john 20116b161f Merge Memory V2 runtime facade 2026-07-03 09:46:03 +08:00
john 7005c2a834 Add MindSpace service runtime release chain 2026-07-03 09:29:00 +08:00
john ec5b1a6e3f feat: finalize mindspace service extraction phase a 2026-07-03 08:40:28 +08:00
john 506a551438 feat: polish mindspace decoupling flows 2026-07-03 00:34:03 +08:00
john b258004dad feat: complete mindspace conversation packages 2026-07-02 23:46:05 +08:00
john b084f6d23c Add page indexes to conversation manifests 2026-07-02 22:03:59 +08:00
john ab4dab6b38 Link page artifacts to preview route 2026-07-02 22:01:35 +08:00