mateclaw/mateclaw-server/src/main/java/vip/mate/channel
倪程伟 6bbb6489f4 feat(webchat): expose phase / tool_start / tool_end / plan as SSE events
Previously WebChatController.chatStream silently dropped every agent
lifecycle event except _usage_final (and content_delta / thinking_delta
derived from delta.payload). Visitors sat with nothing between the
meta event and the first content chunk — typically 3–10s when the
agent plans / recalls memory / runs tools, longer when the agent
chained multiple tool calls. The JWT chat path (ChatController) had
this wiring; webchat did not.

Curated 4-event subset (per design review):
- phase        — high-level phase transition (planning / generating /
                 summarizing / ...). SDK shows a "AI is thinking..."
                 typing indicator before the first token.
- tool_start   — agent invoked a tool. SDK shows a localized badge
                 ("Searching...", "Reading file.pdf", ...).
- tool_end     — tool completed. SDK clears the badge.
- plan         — Plan-Execute agents expose their step list. SDK can
                 render a checklist.

Deliberately NOT forwarded (internal noise / leak risk):
- _usage_final, _routing_decision — consumed internally
- finish_reason                  — implicit in `done`
- feedback_event                 — visitor can't retry/regenerate anyway
- perf_summary, iteration_*      — internal metrics
- plan_step_started/completed    — too granular; the plan event covers
                                   the visitor's needs

Critical safety constraint: tool_start / tool_end carry ONLY the tool
name. Tool arguments and results are dropped — agent tool calls can
contain PII (file paths, user queries, credentials), and relaying
those to a 3rd-party website frontend is a data leak. The SDK maps
tool name → localized label via its own lookup.

Backward compat: existing clients ignore unknown event types per the
SSE spec, so adding these is non-breaking.

Tests: 5 new cases in WebChatStreamE2ETest covering each event type
+ a regression case asserting internal events are silently dropped.
85/85 webchat tests green.

Docs: docs/zh/webchat.md gains a "实时进度事件" subsection.

Stack: feat/webchat-attachment-e2e → feat/webchat-stream-phase-events
Follow-up to epic #355.
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): expose phase / tool_start / tool_end / plan as SSE events 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