Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

fix(server): the session list marks WeChat-enabled conversations again (#759)

Yaowei Zheng35d07eb3de8a
diff --git a/changelog/unreleased/2026-09-16-wechat-sidebar-mark.md b/changelog/unreleased/2026-09-16-wechat-sidebar-mark.md
new file mode 100644
index 00000000..d3d09e7f
--- /dev/null
+++ b/changelog/unreleased/2026-09-16-wechat-sidebar-mark.md
@@ -0,0 +1,15 @@
+# The session list marks WeChat-enabled conversations again
+
+- **Date:** 2026-09-16
+- **Type:** fix
+- **Scope:** `server`
+- **PR:** [#759](https://github.com/Prism-Shadow/penguin-harness/pull/759)
+
+[中文版](2026-09-16-wechat-sidebar-mark.zh.md)
+
+A conversation with an enabled WeChat binding lost the messaging mark beside its title in the
+sidebar whenever the session list reloaded: the server named a row's enabled channel for Feishu,
+Telegram and QQ but not for WeChat, so the mark showed only from enabling the binding in the dialog
+until the next reload. WeChat was added back to that list; the rearrangement of the server into a
+module tree ([#599](https://github.com/Prism-Shadow/penguin-harness/pull/599)), released in 0.2.12,
+had dropped it.
diff --git a/changelog/unreleased/2026-09-16-wechat-sidebar-mark.zh.md b/changelog/unreleased/2026-09-16-wechat-sidebar-mark.zh.md
new file mode 100644
index 00000000..edff96e7
--- /dev/null
+++ b/changelog/unreleased/2026-09-16-wechat-sidebar-mark.zh.md
@@ -0,0 +1,13 @@
+# 会话列表重新为启用微信的对话打上标记
+
+- **Date:** 2026-09-16
+- **Type:** fix
+- **Scope:** `server`
+- **PR:** [#759](https://github.com/Prism-Shadow/penguin-harness/pull/759)
+
+[English](2026-09-16-wechat-sidebar-mark.md)
+
+启用了微信绑定的对话,每逢会话列表重新加载,侧栏里标题旁的消息渠道标记就会消失:服务端为会话行报出已启用的
+渠道时只认飞书、Telegram 与 QQ,不认微信,于是这枚标记只在对话框里启用绑定之后、下一次重新加载之前可见。
+这次把微信加回了这份渠道清单;它是在服务端重组为模块树时
+([#599](https://github.com/Prism-Shadow/penguin-harness/pull/599),随 0.2.12 发布)被漏掉的。
diff --git a/packages/server/src/runtime/session-manager.ts b/packages/server/src/runtime/session-manager.ts
index b660030d..e3fbdf8f 100644
--- a/packages/server/src/runtime/session-manager.ts
+++ b/packages/server/src/runtime/session-manager.ts
@@ -2397,12 +2397,16 @@ export class SessionsModule {
traceStore: this.traceStore,
proxyEnv: env.proxyEnv,
controlEnv: env.controlEnv,
+ // List rows carry the ENABLED channel's indicator (saved-but-dark configs stay off
+ // the row); a point query per row keeps the repo out of the service. An unknown
+ // stored channel reads as none (same defensive skip as the bridge and the routes).
messagingChannel: (sessionId) => {
const enabled = this.messagingRepo.findEnabled(sessionId);
return enabled !== null &&
(enabled.channel === "feishu" ||
enabled.channel === "telegram" ||
- enabled.channel === "qq")
+ enabled.channel === "qq" ||
+ enabled.channel === "wechat")
? enabled.channel
: null;
},
diff --git a/packages/server/test/messaging-wechat.test.ts b/packages/server/test/messaging-wechat.test.ts
index cf27b04a..fad750ca 100644
--- a/packages/server/test/messaging-wechat.test.ts
+++ b/packages/server/test/messaging-wechat.test.ts
@@ -481,6 +481,15 @@ describe("wechat binding routes and the long poll", () => {
expect(body.bindings.map((b) => b.binding.channel).sort()).toEqual(["telegram", "wechat"]);
});
+ it("the session list marks a wechat-ENABLED row with messagingChannel wechat", async () => {
+ await bindEnabled(SID);
+ const res = await api.get(`/api/projects/${PROJECT}/agents/default_agent/sessions`);
+ const body = (await res.json()) as {
+ sessions: Array<{ sessionId: string; messagingChannel?: string }>;
+ };
+ expect(body.sessions.find((s) => s.sessionId === SID)?.messagingChannel).toBe("wechat");
+ });
+
// —— The long poll ————————————————————————————————————————————————————————
it("reports the connection ready before any poll has answered", async () => {