Skip to content

feat(vc): make document-context meeting events actionable for agents - #2155

Open
Ren1104 wants to merge 14 commits into
mainfrom
features/F-larksuite-cli-document-context
Open

feat(vc): make document-context meeting events actionable for agents#2155
Ren1104 wants to merge 14 commits into
mainfrom
features/F-larksuite-cli-document-context

Conversation

@Ren1104

@Ren1104 Ren1104 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

价值

让 Agent 能将会中的 document_context_changed 事件转化为可执行的文档上下文:识别当前聚焦的评论、章节位置,以及图片或白板预览,再按事件中携带的标识调用文档评论或素材能力获取详情。

改动

  • vc +meeting-events 中解析 document_context_changed,覆盖:
    • 评论聚焦(comment_focus
    • 文档章节定位(section_location
    • 图片与白板预览(element_preview
  • 复用现有事件 actor 提取和时间线排序,保持所有事件共用同一条输出链路。
  • 保留原始 payload 与既有会议事件输出契约;新增内容仅作为该事件的结构化解析结果。
  • 更新 lark-vc-agent Skill,说明评论分页查询、评论 ID 匹配,以及图片/白板预览的后续获取路径。

验证

  • GitHub CI 通过:fast-gate、unit-test、lint、e2e-dry-run、e2e-live、CodeQL。
  • 覆盖 NDJSON 输出与文档上下文事件时间线排序的单元测试。

Summary by CodeRabbit

  • New Features

    • Meeting timelines now recognize document context changes and identify associated actors.
    • Added timeline actions for comment focus, section navigation, image previews, and whiteboard previews.
    • Action entries include relevant timestamps, ordering, and status details.
    • JSON, NDJSON, and pretty output preserve event information and clearly distinguish actions from transcript text.
  • Documentation

    • Added guidance for document validation, shared-document matching, comment retrieval, section navigation, media previews, and partial-result handling.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f9f83665-bf6d-4bbc-86a3-6a3eb57bdfbf

📥 Commits

Reviewing files that changed from the base of the PR and between 0d089ac and e96cbe3.

📒 Files selected for processing (3)
  • shortcuts/vc/vc_meeting_events.go
  • shortcuts/vc/vc_meeting_events_test.go
  • skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md
  • shortcuts/vc/vc_meeting_events_test.go
  • shortcuts/vc/vc_meeting_events.go

📝 Walkthrough

Walkthrough

Meeting event handling now supports document_context_changed events. It extracts operators as actors, renders supported context items in timelines, preserves event payloads, validates output formats, and documents consumption rules.

Changes

Document Context Meeting Events

Layer / File(s) Summary
Document-context event handling
shortcuts/vc/vc_meeting_events.go
The shortcut extracts operators and renders comment focus, section navigation, and image or whiteboard preview items. It applies item timestamps or event-time fallback and marks generated entries as actions.
Document-context output validation
shortcuts/vc/vc_meeting_events_test.go
Tests cover supported items, ordering, timestamp fallback, invalid data, payload preservation, event envelopes, and JSON, NDJSON, and pretty output.
Document-context consumption guidance
skills/lark-vc-agent/SKILL.md, skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md
The guidance documents exact document association, comment lookup, section paths, media previews, partial results, failure handling, and envelope preservation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: zhaoleibd

Sequence Diagram(s)

sequenceDiagram
  participant MeetingEventPayload
  participant DocumentContextTimeline
  participant PrettyRenderer
  MeetingEventPayload->>DocumentContextTimeline: provide document_context_changed items
  DocumentContextTimeline->>DocumentContextTimeline: validate and describe supported items
  DocumentContextTimeline->>PrettyRenderer: return ordered action entries
  PrettyRenderer->>PrettyRenderer: render action descriptions without extra colons
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the motivation, main changes, and verification, but it does not use the template headings or include the related-issues section.
Title check ✅ Passed The title clearly and concisely describes the main change: making document-context meeting events actionable for agents.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch features/F-larksuite-cli-document-context

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths labels Aug 3, 2026
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.23077% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.10%. Comparing base (2a16134) to head (e96cbe3).
⚠️ Report is 73 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/vc/vc_meeting_events.go 94.23% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2155      +/-   ##
==========================================
+ Coverage   75.65%   76.10%   +0.44%     
==========================================
  Files         940      983      +43     
  Lines       99876   103532    +3656     
==========================================
+ Hits        75564    78795    +3231     
- Misses      18530    18754     +224     
- Partials     5782     5983     +201     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Ren1104 added 2 commits August 3, 2026 20:22
Source-Branch: features/F-larksuite-cli-document-context
Source-Commit: 427cbd6
Source-Subject: fix: normalize mail triage filters (#2068)
Repo: larksuite-cli
Synced-By: bytedance
Timestamp: 20260803_093803Z
Source-Branch: features/F-larksuite-cli-document-context
Source-Commit: 9b8bafe
Source-Subject: feat: parse document context meeting events
Repo: larksuite-cli
Synced-By: bytedance
Timestamp: 20260803_095353Z
@Ren1104
Ren1104 force-pushed the features/F-larksuite-cli-document-context branch from 83bc48e to 94ad66b Compare August 3, 2026 12:22
@Ren1104
Ren1104 force-pushed the features/F-larksuite-cli-document-context branch from 991726d to 601c5ec Compare August 4, 2026 04:18
@Ren1104 Ren1104 changed the title [F-larksuite-cli-document-context] larksuite-cli feat(vc): make document-context meeting events actionable for agents Aug 5, 2026
@Ren1104
Ren1104 marked this pull request as ready for review August 5, 2026 12:48
@Ren1104
Ren1104 requested a review from zhaoleibd August 5, 2026 12:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
shortcuts/vc/vc_meeting_events_test.go (1)

1386-1393: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add table cases for the two uncovered comment-focus branches.

describeCommentFocus has four description branches. The table covers only focused=true with a comment_id and, in a later test, focused=false with a comment_id. It does not cover focused=true without a comment_id ("聚焦评论") or focused=false without a comment_id ("取消评论聚焦"). Codecov reports lines 917-918 and 921-922 of shortcuts/vc/vc_meeting_events.go as uncovered.

The "取消评论聚焦" string also drives its own prefix in needsColon at line 1277, which no test asserts.

💚 Proposed additional table cases
 		{
 			name: "comment focus without actor",
 			item: map[string]interface{}{
 				"comment_focus": map[string]interface{}{"comment_id": "comment-no-actor", "focused": true},
 			},
 			wantDescription: "聚焦评论 comment-no-actor",
 		},
+		{
+			name: "comment focus without comment id",
+			item: map[string]interface{}{
+				"operator":      map[string]interface{}{"id": "u-focus", "user_name": "Focuser"},
+				"comment_focus": map[string]interface{}{"focused": true},
+			},
+			wantActorID:     "u-focus",
+			wantDescription: "聚焦评论",
+		},
+		{
+			name: "comment unfocus without comment id",
+			item: map[string]interface{}{
+				"operator":      map[string]interface{}{"id": "u-unfocus", "user_name": "Unfocuser"},
+				"comment_focus": map[string]interface{}{"focused": false},
+			},
+			wantActorID:     "u-unfocus",
+			wantDescription: "取消评论聚焦",
+		},
 	}

Also add {description: "取消评论聚焦", want: false} to TestNeedsColon.

Based on coding guidelines: "Every behavior change must have an accompanying test, and contract tests must assert the changed field or behavior directly so reverting the implementation causes failure."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shortcuts/vc/vc_meeting_events_test.go` around lines 1386 - 1393, Extend the
table-driven tests for describeCommentFocus with cases for focused=true without
comment_id and focused=false without comment_id, asserting “聚焦评论” and “取消评论聚焦”
respectively. Update TestNeedsColon to include {description: "取消评论聚焦", want:
false}, ensuring the uncovered description branch and its prefix behavior are
asserted directly.

Sources: Coding guidelines, Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shortcuts/vc/vc_meeting_events.go`:
- Around line 924-927: Remove the item-level share_doc.title handling from the
details construction near the existing details append, so document title and URL
display come exclusively from the magic_share_started mapping for the matching
share_id. Keep item.share_doc only in the raw payload and preserve unrelated
detail generation.

---

Nitpick comments:
In `@shortcuts/vc/vc_meeting_events_test.go`:
- Around line 1386-1393: Extend the table-driven tests for describeCommentFocus
with cases for focused=true without comment_id and focused=false without
comment_id, asserting “聚焦评论” and “取消评论聚焦” respectively. Update TestNeedsColon to
include {description: "取消评论聚焦", want: false}, ensuring the uncovered description
branch and its prefix behavior are asserted directly.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ae224b9b-2ed0-41e4-a053-27493d56db26

📥 Commits

Reviewing files that changed from the base of the PR and between ec882dd and 0d089ac.

📒 Files selected for processing (4)
  • shortcuts/vc/vc_meeting_events.go
  • shortcuts/vc/vc_meeting_events_test.go
  • skills/lark-vc-agent/SKILL.md
  • skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md

Comment thread shortcuts/vc/vc_meeting_events.go Outdated
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@e96cbe3fa77d250adc7058ac477c0a9e359b941c

🧩 Skill update

npx skills add larksuite/cli#features/F-larksuite-cli-document-context -y -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants