mateclaw/mateclaw-server/src/main/java/vip/mate
倪程伟 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
..
acp feat(workspace,system): add @RequireGlobalAdmin and gate admin-only controllers 2026-05-15 10:18:10 +08:00
activity feat(workspace,system): add @RequireGlobalAdmin and gate admin-only controllers 2026-05-15 10:18:10 +08:00
agent feat(agent): one-sentence AI employee creation wizard 2026-06-17 17:38:42 +08:00
approval polish(approval-grants-ui): show granter name, fix note cell rendering, tighten layout 2026-05-27 15:09:11 +08:00
audit feat(platform): workspace isolation, info architecture, and UI redesign 2026-04-09 16:29:02 +08:00
auth fix(approval): three minor issues surfaced by end-to-end testing 2026-05-27 14:08:12 +08:00
channel feat(webchat): stop an in-flight session stream (POST /sessions/stop) 2026-06-18 06:33:17 +08:00
common feat(agent): deterministic Markdown normalization for final answers (#275) 2026-06-07 19:10:53 +08:00
config docs(security): correct generated-file TTL comment (7 days, not 10 min) 2026-06-17 23:21:08 +08:00
cron fix(cron): restore ShedLock DB-time for dialects that support it 2026-06-14 10:44:52 +08:00
dashboard fix(dashboard): count tool calls from assistant.metadata, not role=tool rows 2026-05-24 22:58:02 +08:00
datasource feat(db): support KingbaseES (人大金仓) domestic database (#324) 2026-06-14 10:30:09 +08:00
doc feat(docs): expose bundled help docs via in-app viewer 2026-06-15 07:48:49 +08:00
exception fix(api): return 400 on path-variable type mismatch instead of 500 2026-05-24 22:57:51 +08:00
goal feat(agent): loop-engineering robustness — goal continuation, plan re-plan, stall detection 2026-06-17 06:37:08 +08:00
hook feat(hook): HMAC-SHA-256 body signing for outbound webhooks 2026-05-02 15:41:13 +08:00
i18n fix(i18n): stop logging missing-key noise for optional tool descriptions 2026-05-19 20:06:38 +08:00
llm fix: reuse shared HttpClient to prevent thread-leak OOM on model test 2026-06-14 16:57:13 +08:00
memory feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00
notification feat(ui): surface pending approvals + stuck agents as sidebar badges 2026-05-15 10:17:30 +08:00
planning refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
plugin feat(db): support KingbaseES (人大金仓) domestic database (#324) 2026-06-14 10:30:09 +08:00
skill feat(tool): add execute_code for running agent-authored code (#257) 2026-06-09 08:05:50 +08:00
stt feat(stt): route OpenAI Whisper provider to any OpenAI-compatible endpoint (#76) 2026-05-09 13:57:52 +08:00
system feat(dashboard): show the connected database on the dashboard 2026-06-15 08:47:53 +08:00
task feat(task): generic one-shot Callable runner with parent-conv cancel 2026-05-16 14:51:04 +08:00
tool feat(docs): expose bundled help docs via in-app viewer 2026-06-15 07:48:49 +08:00
trigger fix(feishu): decouple trigger ingest from the Lark WS dispatch thread (#208) 2026-06-09 09:17:26 +08:00
tts fix(wiki): backend hardening + batch delete UI 2026-04-13 15:37:12 +08:00
wiki feat(wiki): entity-level knowledge graph extraction (#336) 2026-06-17 14:17:54 +08:00
workflow fix(workflow): pre-check unique name on create/rename, return 409 instead of 500 (Fixes Gitee #IJPYWA) 2026-05-26 23:35:04 +08:00
workspace feat(webchat): explicit empty-session creation endpoint POST /sessions 2026-06-17 23:21:08 +08:00
MateClawApplication.java feat(db): support KingbaseES (人大金仓) domestic database (#324) 2026-06-14 10:30:09 +08:00