Skip to content

feat: hardcode tasklist GUIDs in task tool description - #148

Merged
lishuceo merged 2 commits into
mainfrom
feat/task-tasklist-config
Mar 13, 2026
Merged

feat: hardcode tasklist GUIDs in task tool description#148
lishuceo merged 2 commits into
mainfrom
feat/task-tasklist-config

Conversation

@lishuceo

Copy link
Copy Markdown
Owner

Summary

  • 在 task 工具描述中硬编码 4 个任务清单的 GUID(Bot/MCPTools/UrhoX/Maker)
  • 创建任务时 Claude 会自动根据内容选择合适的清单,不确定时默认用 Bot
  • 解决了 list_tasklists API 对 bot token 返回空列表的问题

Background

list_tasklists API 使用 bot token 调用时无法返回用户创建的清单。将 GUID 直接写入工具描述,让 Claude 无需 API 查询即可将任务归入正确清单。

Test plan

  • npx vitest run src/feishu/tools/__tests__/task.test.ts — 61 tests passed

🤖 Generated with Claude Code

Bot creates tasks that must belong to one of 4 predefined tasklists
(Bot/MCPTools/UrhoX/Maker). Since list_tasklists API returns empty
for bot tokens, embed the GUIDs directly in the tool description
so Claude always assigns tasks to the correct list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude

claude Bot commented Mar 12, 2026

Copy link
Copy Markdown

Claude finished @lishuceo's task in 45s —— View job


PR Review: Hardcode tasklist GUIDs in task tool description

  • Check for previous review comments — none found
  • Read changed file and understand context
  • Review changes and post findings

Approved — Clean, focused change that solves a real problem (bot token can't list user-created tasklists).

The diff is minimal and correct: 4 hardcoded GUIDs added to the tool description, tasklists changed from optional to required in the description text, and the list_tasklists reference removed from the format hint.

One observation (not blocking): The tasklists Zod schema field remains z.string().optional() (line 196), and the create handler doesn't enforce its presence programmatically (line 236). This means the "required" constraint is soft — enforced only via the LLM prompt, not at the code level. This is fine as a pragmatic workaround, but worth noting in case a future caller bypasses the LLM and calls the tool directly without tasklists.

Overall: small, well-scoped change with passing tests. LGTM.

Agent SDK re-sends the new systemPrompt on resume, so old sessions
naturally get updated tool descriptions without needing a fresh start.

- Keep hash computation for diagnostic logging
- Remove resumeSkipped field from ClaudeResult
- Remove _historyDedup clearing on hash mismatch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude

claude Bot commented Mar 13, 2026

Copy link
Copy Markdown

Claude finished @lishuceo's task in 1m 2s —— View job


PR Review: feat/task-tasklist-config

  • Check for previous review comments — none found
  • Read changed files and understand context
  • Review changes and post findings

Approved — Two well-scoped commits, both clean.

Commit 1 (29542b6): Hardcodes 4 tasklist GUIDs in the task tool description and updates the prompt to mark tasklists as required. The previous review's observation still applies — tasklists remains z.string().optional() at the Zod level (line 196) — but this is a pragmatic choice since only the LLM calls this tool.

Commit 2 (0247775): Removes session invalidation on system prompt hash change. The rationale is sound — Agent SDK's resume accepts a new systemPrompt, so the old session naturally gets updated tool descriptions. The cleanup is thorough: resumeSkipped is fully removed from types, executor return values, and the _historyDedup clearing logic. The hash computation is retained for diagnostic logging only.

Also included: maxDisplayed bumped from 16→40 in buildToolProgressCard (message-builder.ts:507). Minor UX tweak, no issues.

No issues found with confidence ≥ 75. LGTM.

@lishuceo
lishuceo merged commit 65d0cfc into main Mar 13, 2026
4 checks passed
@lishuceo
lishuceo deleted the feat/task-tasklist-config branch March 13, 2026 14:36
lishuceo added a commit that referenced this pull request Apr 8, 2026
* feat: hardcode tasklist GUIDs in task tool description

Bot creates tasks that must belong to one of 4 predefined tasklists
(Bot/MCPTools/UrhoX/Maker). Since list_tasklists API returns empty
for bot tokens, embed the GUIDs directly in the tool description
so Claude always assigns tasks to the correct list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: remove system prompt hash session invalidation

Agent SDK re-sends the new systemPrompt on resume, so old sessions
naturally get updated tool descriptions without needing a fresh start.

- Keep hash computation for diagnostic logging
- Remove resumeSkipped field from ClaudeResult
- Remove _historyDedup clearing on hash mismatch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant