Skip to content

feat(event): add multi-event and group lifecycle subscriptions#790

Open
wxianfeng wants to merge 17 commits into
DingTalk-Real-AI:mainfrom
wxianfeng:feature/dws-event-im-phase3
Open

feat(event): add multi-event and group lifecycle subscriptions#790
wxianfeng wants to merge 17 commits into
DingTalk-Real-AI:mainfrom
wxianfeng:feature/dws-event-im-phase3

Conversation

@wxianfeng

Copy link
Copy Markdown
Collaborator

Summary

  • Add all-message subscriptions and group lifecycle/member events for personal IM.
  • Support consuming multiple compatible event keys in one foreground process while keeping independent server subscriptions and event_type + subscribe_id isolation.
  • Support stopping one subscription without terminating the remaining consumers.
  • Add stable flattened group-member output, preserve nested quoted/forwarded message context, and switch personal event defaults to production MCP endpoints.
  • Update Event schema metadata, catalog, README, and mono/multi Skills.

Risk tier

  • Documentation-only: prose/assets only; no executable, generated, workflow, packaging, or interface behavior changed
  • Standard: ordinary implementation change with a stable package graph
  • High-risk: workflow/policy, package graph, generated Schema/registry, platform, auth/keychain, installer, packaging, release, transport, recovery, or another fail-closed infrastructure change

Verification

  • Exact in-place CHANGELOG.md-only check: N/A
  • Targeted tests passed: GOWORK=off go test ./internal/event/... ./internal/app ./internal/cli
  • Behavior evidence: multi-consumer runtime, targeted subscription stop, flattened group-member projection, envelope compatibility, and production default URL tests are covered by Event/App test suites
  • Skill verification passed: PATH="$PWD:$PATH" GOWORK=off go test -tags skill_verify ./test/skill_static/...
  • Full local suite: N/A; targeted packages and policy gates passed, full matrix is delegated to CI
  • ./scripts/policy/check-generated-drift.sh
  • ./scripts/policy/check-schema-catalog.sh (25 products, 603 tools)
  • ./scripts/policy/check-command-surface.sh --strict: not run locally
  • ./scripts/release/verify-package-managers.sh: N/A

Notes

  • Default structured output remains the backward-compatible transport envelope. Agent workflows opt into top-level business fields with --flatten.
  • Personal event control and Stream ticket URLs derive from the production MCP base URL; open-source sourceId remains open.
  • App event source code remains retained but is not publicly exposed.

github-actions Bot and others added 14 commits July 13, 2026 02:36
…m-phase3

# Conflicts:
#	internal/app/event_command.go
#	internal/app/event_personal_command.go
#	internal/cli/schema_agent_metadata/event.json
#	internal/cli/schema_agent_metadata/index.json
#	internal/cli/schema_agent_metadata_audit.json
#	internal/cli/schema_catalog.json
#	internal/cli/schema_hints/selection/event.json
#	internal/event/personal/registry_test.go
#	skills/mono/references/products/event.md
#	skills/multi/dingtalk-event/SKILL.md
#	skills/multi/dingtalk-event/references/event-im.md
…m-phase3

# Conflicts:
#	internal/cli/schema_agent_metadata/index.json
#	internal/cli/schema_agent_metadata_audit.json
#	internal/cli/schema_catalog.json
#	skills/mono/SKILL.md

@PeterGuy326 PeterGuy326 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate decision

HOLD — 缺少 CHANGELOG [Unreleased] 条目。这是面向用户的功能变更(新增事件类型、多事件消费、群生命周期事件),按仓库规范必须有 CHANGELOG 条目或说明为何不需要。


Review provenance

  • [PASS] PR head checked out locally: e2390c338
  • [PASS] Local HEAD matches remote PR head
  • [PASS] Base revision: 97248bf7c
  • [PASS] Worktree clean before and after review

PR description completeness

  • [PASS] D1 Requirement and problem — 描述了新增 all-message 订阅、群生命周期/成员事件、多事件消费、定向停止等需求
  • [PASS] D2 Goal and expected behavior — 明确列出新增功能和预期行为
  • [PASS] D3 Acceptance criteria — Risk tier + Verification 章节列出了可验证的测试命令
  • [PASS] D4 Implementation summary — Summary 和 Notes 覆盖了关键变更
  • [PASS] D5 Configuration and environment — 标注了 OS/arch、Go 版本、测试范围
  • [PASS] D6 Exact test steps — 提供了具体可复制的测试命令
  • [PASS] D7 Limitations — 明确标注未本地执行的项目
  • [FAIL] D8 CHANGELOG [Unreleased] entry — CHANGELOG.md 不在变更文件列表中,PR 描述也未说明为何不需要。新增 8 个 event key、多事件消费、定向 consumer stop 均为用户可见功能变更,需要在 ### Added 下添加条目
  • [PASS] D9 No sensitive info — diff、评论、描述中无敏感信息泄露

Author validation reproduction

ID Acceptance criterion Result Match
V1 go test ./internal/event/... PASS (11 packages ok) Yes
V2 go test ./internal/app PASS (exit 0) Yes
V3 go test ./internal/cli PASS (19.4s, ok) Yes
V4 go test -tags skill_verify ./test/skill_static/... 基线失败 (TestSkillCommandsDispatch 在 base 同样超时) N/A
V5 check-generated-drift.sh PASS (ok) Yes
V6 check-schema-catalog.sh PASS (25 products, 603 tools) Yes

Conventional code review

  • [PASS] Diff scope — 变更集中在 event 子系统,未触及无关模块
  • [PASS] Error handling — 错误传播正确,cleanup LIFO 逆序,defer 到位
  • [PASS] Concurrency — run_many.go goroutine 管理和 context 取消正确;StopCh + daemon writer 的 targeted stop 模式安全
  • [PASS] Security — 无明显注入点、凭据泄露或权限问题
  • [PASS] Backward compatibility — 定向 stop 通过 ErrConsumerStopUnsupported 降级到旧版 signal;transport envelope 保持兼容
  • [PASS] Test coverage — 新增测试 1600+ 行覆盖多事件消费、定向 stop、新事件类型输出、filter 验证
  • [PASS] Static analysis — go vet 干净,Schema 生成无漂移,编译零错误

Non-blocking observations

  • dedupePersonalEventKeysevent_command.go:156runPersonalEventConsume:212 被重复调用,冗余但无害
  • GroupLifecycleEventOutput.Payloadmap[string]any 是保守策略,注释说明了原因
  • 生产 URL 切换是本次最大风险点,建议确认生产 Stream/Control endpoint 已支持新事件类型
  • closeSessions 会对已关闭的连接再次 close,安全但建议加注释说明

Summary

代码质量和测试覆盖都很好,架构设计干净。补上 CHANGELOG 条目后可以合并。

@PeterGuy326 PeterGuy326 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG entry looks good. Approved.

PeterGuy326 and others added 2 commits July 25, 2026 09:33
…ion test

- Add missing ## [Unreleased] heading required by Policy CI check
- Update npm test assertion (12 → 60) to match extended propagation wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants