feat: add attendance user_task.query#405
Conversation
|
chengyiming seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
📝 WalkthroughWalkthroughAdded a new skill specification Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms Comment |
Greptile SummaryThis PR introduces a new
Confidence Score: 2/5Not safe to merge — three P1 issues mean every invocation of this skill will fail at runtime with no useful results. Two P1s from prior review rounds (empty user_ids, missing identity type) remain unaddressed, and a third P1 (missing required date-range parameters) was found in this round. All three will cause the API call to fail or silently return empty data. skills/lark-attendance/SKILL.md — requires fixes to user_ids resolution, --as user identity guidance, and date-range parameter documentation before this skill is functional. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Agent
participant LarkShared as lark-shared/SKILL.md
participant LarkCLI as lark-cli
participant LarkAPI as attendance/v1/user_tasks/query
User->>Agent: "查询我的考勤打卡记录"
Agent->>LarkShared: Read (auth / identity rules)
Note over Agent: ❌ Missing: resolve current user's employee_no
Note over Agent: ❌ Missing: ensure --as user identity
Note over Agent: ❌ Missing: collect check_date_from / check_date_to
Agent->>LarkCLI: lark-cli schema attendance.user_tasks.query
LarkCLI-->>Agent: schema (employee_type, user_ids, check_date_from, check_date_to)
Agent->>LarkAPI: POST user_ids=[] employee_type="employee_no" (no dates, no real user ID)
LarkAPI-->>Agent: ❌ Validation error or empty result set
Agent-->>User: No attendance records found
Reviews (2): Last reviewed commit: "feat: add attendance user_task.query" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
skills/lark-attendance/SKILL.md (1)
48-56: Consider documenting additional attendance API methods if they exist in the Feishu API.The skill currently exposes only
user_tasks.querywith read-only permissions. Verify against the Feishu API documentation whether other attendance operations (e.g., creating attendance records, retrieving configurations, etc.) exist and should be included. The codebase search found no evidence of other exposed methods, suggesting the minimal scope may be intentional for the v1.0.0 release.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@skills/lark-attendance/SKILL.md` around lines 48 - 56, The docs currently list only the user_tasks.query method with the attendance:task:readonly scope in SKILL.md; verify the Feishu attendance API for additional endpoints (e.g., create/modify attendance records, get attendance configurations, list shifts) and, if present, add corresponding entries under user_tasks (or new sections) with their method names and required scopes; update SKILL.md to enumerate each supported API method and required scope (referencing user_tasks.query and attendance:task:readonly for format) or confirm in a brief note that v1.0.0 intentionally exposes only read-only querying.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@skills/lark-attendance/SKILL.md`:
- Around line 15-37: The auto-fill rule forcing `user_ids: []` breaks the Lark
Attendance API (attendance/v1/user_tasks/query) because that endpoint requires a
non-empty list of employee IDs; update the SKILL.md and the auto-fill logic so
`user_ids` is not hardcoded to an empty array: either remove the `user_ids: []`
auto-injection so callers can supply their own `user_ids`, or replace it by
programmatically populating `user_ids` with the current user's employee ID
(derived from the authenticated user context/token) before calling
attendance/v1/user_tasks/query; keep `employee_type` = "employee_no" as
specified and ensure the `--data` injection builds {"user_ids":[<employee_id>],
...} when auto-populating.
---
Nitpick comments:
In `@skills/lark-attendance/SKILL.md`:
- Around line 48-56: The docs currently list only the user_tasks.query method
with the attendance:task:readonly scope in SKILL.md; verify the Feishu
attendance API for additional endpoints (e.g., create/modify attendance records,
get attendance configurations, list shifts) and, if present, add corresponding
entries under user_tasks (or new sections) with their method names and required
scopes; update SKILL.md to enumerate each supported API method and required
scope (referencing user_tasks.query and attendance:task:readonly for format) or
confirm in a brief note that v1.0.0 intentionally exposes only read-only
querying.
🪄 Autofix (Beta)
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
Run ID: 14d95f6b-95a1-413a-8ccd-59c120b1b814
📒 Files selected for processing (1)
skills/lark-attendance/SKILL.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@62f79a9c133f1c36f872b5010d075f9c6c3c80c6🧩 Skill updatenpx skills add chengyiming/cli#fix/leave_attendance_cli -y -g |
Change-Id: Ie34b9b98859942ff368a9808fc2efab4d2bf27fa
63c65b9 to
62f79a9
Compare
|
Tip: Greploop — Automatically fix all review issues by running Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal. |
Change-Id: I0c99b2178dd874f2a9f0e30ed8145b888c3a9965
Summary
Add a new Lark attendance skill (
lark-attendance) that enables querying user clock-in/attendance records vialark-cli. This skill provides theuser_tasks.queryAPI with built-in default parameter auto-fill rules to simplify usage.Changes
lark-attendance/SKILL.mdemployee_typeis always set to"employee_no"(in--params)user_idsis always set to[](in--data)user_tasks.queryattendance:task:readonlyscope../lark-shared/SKILL.md)Test Plan
lark-cli schema attendance.user_tasks.queryand verify the parameter structure is returned correctlylark-cli attendance user_tasks querywithemployee_type="employee_no"anduser_ids=[], verify it returns the current user's attendance records../lark-shared/SKILL.mdreference path resolves correctlyattendance:task:readonlypermissionRelated Issues
Summary by CodeRabbit
lark-attendanceskill for querying user attendance and clock-in records through thelark-clitool.SKILL.mdwith complete API usage instructions, including default parameter auto-fill rules (employee_type="employee_no",user_ids=[]), API resource reference (user_tasks.query), and required permission scope (attendance:task:readonly).