Commit Graph

288 Commits

Author SHA1 Message Date
john 5485cc563b merge origin/main: 合并 runtime bundle 修复与本地图片物化/build 修复 2026-07-07 09:09:32 +08:00
tkmind 0edd531ed9 Merge pull request 'fix(ops): 将 goose session postgres ensure 脚本打入 runtime 包' (#8) from fix/goose-session-postgres-runtime-bundle into main 2026-07-06 09:11:59 +00:00
john 84bc03c9ba fix(ops): 将 goose session postgres ensure 脚本打入 runtime 包
发版后 Portal live 目录为无源码 runtime,ensure 脚本需随包发布;文档与发布检查改为引用 goosed-prod 稳定路径作为 103 兜底。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:11:40 +08:00
john 3befb0e257 fix(build): runtime 清理失败时回退 shell rm -rf
避免 macOS 上 pnpm node_modules 树导致 ENOTEMPTY 阻断发布构建。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:06:06 +08:00
john 0ae7a6a677 fix(mindspace): 公开页上传图片物化到 static 路径供转发访问
Finish 同步与首次访问时将私有资产 API 图片复制到 public/.tmp-images,
避免其他用户转发链接后因无登录态无法加载页面内图片。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:03:47 +08:00
tkmind 1077dd9b97 Merge pull request 'fix(ops): 自愈 goosed 会话 PostgreSQL,防止 H5 卡在创建新对话' (#7) from fix/goose-session-postgres-ensure into main 2026-07-06 09:01:25 +00:00
john b6def0f25b fix(ops): 自愈 goosed 会话 PostgreSQL,防止 H5 卡在创建新对话
103 Colima goosed 依赖宿主机 postgresql@17;库停止时 /agent/start 会 pool timeout 约 60s。新增 ensure 脚本、接入监控与发布前检查,并补充拓扑文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:57:38 +08:00
john ecf553754c docs: 记录 103 发布 0706007 备份路径与回退步骤
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:14:07 +08:00
john 14a00774d9 feat(h5): web 联网能力、实时查询路由与 session Finish 对齐
- 新增 web 能力并挂载 platform/web(web_search/fetch_url)
- 实时查询强制 web skill,router fallback 与 await session Finish
- Session Broker 覆盖率/指标、stream replay 与相关单测/E2E 脚本

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:06:26 +08:00
john 08feae8bef feat(h5-session): Session Broker、run SSE replay 与 Finish 竞态修复
落地 H5 Session 架构 Patch 1–5(Broker 收口、Router decision、SSE taxonomy、goosed 边界检查),
并新增可选 MEMIND_RUN_STREAM_REPLAY run 事件回放与 H5 假交付 guard;修复 Finish 先于 agent-run
gate 导致 UI 永久 loading 的竞态,接入 verify:h5-session-patches 回归脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 14:19:48 +08:00
john e2ad3bf62b feat(mindspace): 公开页分享组件、workspace 路径与 Plaza 发布增强
- 新增 public share widget 与 workspace relative path 解析
- 增强 publications/chat-plaza 发布链路与缩略图 demo
- 补充 schema、cover 检查脚本与回归测试

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 23:14:41 +08:00
tkmind 69be1e5293 Merge pull request 'feat(plaza-ops): 运营后台帖子管理 API' (#6) from feature/plaza-ops-admin into main
Merge pull request #6: Plaza 运营后台帖子管理 API
2026-07-05 12:18:22 +00:00
john 0c2cb9e283 feat(plaza-ops): add post management API for admin console
Expose categories listing, category filter on review queue, and invalidate
feed caches when ops hides a published post.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:18:02 +08:00
tkmind dd091e6e2c Merge pull request 'feat(chat): Plaza 一键发布 + publication RPC 错误映射' (#5) from feature/rpc-publication-errors into main
Merge pull request #5: Plaza 一键发布 + publication RPC 错误映射
2026-07-05 12:01:42 +00:00
john 8755928405 fix(mindspace): expose findPageBySourceMessage on remote pageService adapter.
Quick Plaza publish resolves existing chat pages by session/message id; production remote adapter rejected the RPC because the binding contract omitted this method.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 19:58:42 +08:00
john 3318c04490 feat(chat): add one-click Plaza publish for HTML page messages.
Speed up the quick-plaza path with session snapshot reads, publish timeouts, and a modal fix so parent re-renders no longer abort in-flight requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 19:58:39 +08:00
john 53eb0014ba fix(mindspace): map publication RPC errors to HTTP status codes
Return 404/401/403 from MindSpace RPC for known publication errors and
preserve error codes through the Portal remote adapter.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 19:44:58 +08:00
john 85061dfa9f fix: stream Goosed page replies into chat without waiting for agent run
Subscribe session SSE as soon as the Goosed session is known, keep request
context during waiting, and poll session snapshots so page results appear
in the conversation while generation is still running.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 12:25:52 +08:00
john 1165ebf684 fix: normalize Goosed reply payload and restart agent-run worker on release
Add id/created defaults for user_message, ensure metadata in agent-run
gateway before submit, and kickstart the agent-run worker after portal deploy
so queued page-generation runs use the latest runtime bundle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 12:04:31 +08:00
john cb7a446d3e fix: ensure userVisible metadata on Goosed session replies
Goosed rejects /sessions/:id/reply when user_message.metadata lacks
userVisible. Normalize metadata before submit and during agent orchestration
so page-generation runs no longer fail before streaming starts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:58:17 +08:00
john 5f8ef9ddb0 fix: make MindSpace docx repair script runtime-safe
Avoid importing mindspace-public-finish-sync in production runtime so release
link repair can copy oa docx files or strip broken anchors without extra deps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:29:17 +08:00
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