Files
chatgpt-on-wechat/channel
zhayujieandcowagent 483f486c14 fix: make channel disconnect stick and put WeChat channels first
Disconnecting a channel had no effect on both the web console and the
desktop app. In multi-Agent mode a legacy channel (enabled via config.json
channel_type) is folded into channel_instances by bootstrap_legacy_instances,
which runs on every team.json write. Removing the instance record alone was
immediately undone: the next write re-materialized it straight from
channel_type, so the card came right back.

- Prune the type from channel_type when disconnecting its last instance, so
  the bootstrap has nothing to recreate.
- Route disconnect/rename without an instance_id to the legacy per-type path
  instead of rejecting it with "instance_id is required".
- Surface disconnect failures on both clients (web toast, desktop status)
  and refresh the desktop list silently so it no longer jumps to the top.
- Show WeChat channels first in the connected list (stable sort).
- Add regression tests covering the dispatch routing and the bootstrap
  re-materialization bug.

Co-authored-by: cowagent <cow@cowagent.ai>
2026-09-08 20:50:41 +08:00
..