mateclaw/mateclaw-server/src/main/java/vip/mate/channel
倪程伟 23c1d49241 feat(webchat): stop an in-flight session stream (POST /sessions/stop)
Until now webchat had no way to actually interrupt a running stream —
ChatController's /api/v1/chat/{id}/stop was technically permitAll'd but
silently no-op'd on webchat streams because WebChatController.chatStream
dropped the subscribe() return value, so ChatStreamTracker.requestStop
had no Disposable to dispose. Visitors could only "stop" client-side by
closing the SSE connection; the server-side LLM call kept running,
burning tokens and firing any side-effecting tools to completion.

Two changes (issue #353):

1. WebChatController.chatStream: keep the Disposable and register it
   with streamTracker.setDisposable, mirroring ChatController#chatStream
   line 495. Now requestStop actually disposes the Flux.

2. New endpoint POST /api/v1/channels/webchat/sessions/stop:
   - Auth mirrors the other session-management endpoints: X-MC-Key +
     X-MC-Visitor-Token + ownsConversation (404 on unknown sessionId,
     so callers can't probe the namespace).
   - Returns {stopped: true|false}; false means no active stream
     (idempotent, not an error).
   - No approval sweep — webchat has no MateClaw username and exposes
     no approval UI today; defer until that surfaces.

WebChatStopStreamTest (@SpringBootTest, H2, V147) — 5 cases:
- stopActiveStream registers a real Flux.never() Disposable on the
  tracker and asserts both stopped=true AND disposable.isDisposed(),
  proving the chatStream wiring change is what makes the endpoint work.
- noActiveStreamReturnsFalse — idempotent path.
- bad token / bad API key → 401.
- unknown sessionId → 404.
2026-06-18 06:33:17 +08:00
..
cards sync: interactive approval card on Feishu via Schema-2.0 button + card.action callback 2026-05-20 12:05:47 +08:00
controller fix(channel,agent,chat): unify channel binding / conversation agent / model pin state sources 2026-05-26 09:40:49 +08:00
dingtalk fix(tool): emit absolute download URLs for streaming-generated files (#164) 2026-06-07 15:03:48 +08:00
discord fix(channel): gate WS/long-polling channels on a distributed leader lease (#85) 2026-05-11 10:50:00 +08:00
event feat(channel,trigger): wire channel_message + content_match event sources 2026-05-08 15:07:11 +08:00
feishu fix(feishu): surface recent-file disk-scan failures at warn level 2026-06-14 17:25:26 +08:00
health sync: settings UI polish, channel reliability fixes, DeepSeek cross-turn fix 2026-04-29 11:22:47 +08:00
leader fix(channel): gate WS/long-polling channels on a distributed leader lease (#85) 2026-05-11 10:50:00 +08:00
media fix(tool): persist generated files to disk so download links survive restart and 10-min window (#243) 2026-06-01 21:35:53 +08:00
model feat(channels): redesign list page — show only configured channels, add hero empty state 2026-04-30 06:59:47 +08:00
notification feat(channel): reply queue foundation + lifecycle gate 2026-05-10 08:27:48 +08:00
qq feat(channel/qq): add scan-to-bind onboarding via QQ Open Platform Lite portal 2026-05-20 21:47:49 +08:00
qrcode feat(channel/qq): add scan-to-bind onboarding via QQ Open Platform Lite portal 2026-05-20 21:47:49 +08:00
repository Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
service sync: ChannelToolProvider SPI + node-local reconcile framework for channel-native tools 2026-05-20 12:18:51 +08:00
slack feat(channel): forward async tool results to IM channels + slack file upload 2026-05-10 08:28:20 +08:00
telegram fix(channel): gate WS/long-polling channels on a distributed leader lease (#85) 2026-05-11 10:50:00 +08:00
tool feat(feishu): transcribe inbound voice messages via SttService 2026-05-20 16:35:46 +08:00
verifier feat(channels): three-step onboarding wizard with live credential verify 2026-04-30 00:26:38 +08:00
web fix(tool): emit absolute download URLs for streaming-generated files (#164) 2026-06-07 15:03:48 +08:00
webchat feat(webchat): stop an in-flight session stream (POST /sessions/stop) 2026-06-18 06:33:17 +08:00
wecom fix(channel): warn when wecom inbound image is stored URL-only (#303) 2026-06-11 13:53:56 +08:00
weixin feat(channel): shared inbound media pipeline with magic-byte typing and retry 2026-05-30 07:30:38 +08:00
AbstractChannelAdapter.java refactor(channel): drop dead require_mention block in checkAccess 2026-05-20 10:13:59 +08:00
AsyncTaskMediaDispatcher.java feat(channel): forward async tool results to IM channels + slack file upload 2026-05-10 08:28:20 +08:00
ChannelAdapter.java sync: Feishu approval card 5-chain hotfix — verified end-to-end in production 2026-05-20 15:24:47 +08:00
ChannelChatOriginFactory.java fix(tool): emit absolute download URLs for streaming-generated files (#164) 2026-06-07 15:03:48 +08:00
ChannelErrorClassifier.java sync: settings UI polish, channel reliability fixes, DeepSeek cross-turn fix 2026-04-29 11:22:47 +08:00
ChannelHealthMonitor.java chore(channel): remove stale external-reference comments; fix(wiki): canonical slug lookup on merge path 2026-04-15 16:44:02 +08:00
ChannelManager.java feat(db): support KingbaseES (人大金仓) domestic database (#324) 2026-06-14 10:30:09 +08:00
ChannelMessage.java fix(wiki): backend hardening + batch delete UI 2026-04-13 15:37:12 +08:00
ChannelMessageRenderer.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
ChannelMessageRouter.java refactor(feishu): 群会话 ID 改用完整 chatId 避免后缀碰撞 2026-06-09 11:10:09 +08:00
ChannelSessionStore.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
DeliveryOptions.java feat(cron): channel delivery via ChatOrigin + Spring AI ToolContext 2026-04-28 21:43:58 +08:00
ExponentialBackoff.java chore(channel): remove stale external-reference comments; fix(wiki): canonical slug lookup on merge path 2026-04-15 16:44:02 +08:00
MediaPathGuard.java chore: neutralize internal references in code comments and migrations 2026-05-02 15:42:10 +08:00
SendContext.java feat(channel): reply queue foundation + lifecycle gate 2026-05-10 08:27:48 +08:00
StreamingChannelAdapter.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00