Skip to content

fix(feishu): drop stale Cloud workspace tool guidance from main's channel prompt - #17

Merged
RowitZou merged 1 commit into
mainfrom
feature/fix-feishu-channel-prompt
May 29, 2026
Merged

fix(feishu): drop stale Cloud workspace tool guidance from main's channel prompt#17
RowitZou merged 1 commit into
mainfrom
feature/fix-feishu-channel-prompt

Conversation

@RowitZou

Copy link
Copy Markdown
Owner

问题

main 是 orchestrator,手上没有任何 Feishu 工具——8 个 Feishu* 工具被 FEISHU_RESERVED_TOOLS 保留,在 filterToolsByRoleVisibility 处从 main 的目录里滤掉(inline / deferred 都没有,直接调会被 canUseTool deny)。

buildFeishuChannelPrompt## Cloud workspace 段(每条入站消息都 prepend 到 main 的 system block 最前面)却在指挥 main 直接调用 FeishuCreateFile / FeishuList / FeishuCreateFolder / FeishuMove / FeishuDelete / FeishuRead——指挥它用一批拿不到的工具,既是 stale capability,也违反 prompt 设计原则(不告诉 agent 它没有的能力)。

改动

删掉整个 ## Cloud workspace 段,只保留 ## Channel: Feishu 的渠道呈现指引。

正确的委派框架已经在 prompt.ts 的 orchestrator ## Channel Context 段里("private Feishu cloud-space folder … lean on delegation — the Reachable Workers section lists who has the relevant capability"),所以删除对 main 零信息损失,同时消除了 PART A / PART B 的重复和误导。工具级飞书用法属于 feishuSecretary 的 role + feishu-doc-workflow skill(它们才真正持有这些工具)。

验证

  • pnpm typecheck
  • prompt snapshot 测试(role-prompt.snapshot / prompt-for-role)✅ —— channelContext 不进 snapshot,main 其余 prompt 字节不变
  • 无测试断言被删文本

🤖 Generated with Claude Code

…nnel prompt

main is an orchestrator and holds no Feishu tools — the 8 Feishu* tools are
reserved by FEISHU_RESERVED_TOOLS and filtered out of main's catalog (inline
and deferred). The `## Cloud workspace` block in buildFeishuChannelPrompt
nonetheless instructed main to call FeishuCreateFile / FeishuList /
FeishuCreateFolder / FeishuMove / FeishuDelete / FeishuRead directly — tools it
cannot invoke (canUseTool denies them), and a violation of the prompt design
principle (don't tell an agent to use capabilities it lacks).

The correct framing already lives in prompt.ts's orchestrator `## Channel
Context` section ("private Feishu cloud-space folder … lean on delegation — the
Reachable Workers section lists who has the relevant capability"), so removing
this block loses no actionable information for main while killing the
misdirection and the PART-A/PART-B duplication. Tool-level Feishu usage belongs
to feishuSecretary's role + feishu-doc-workflow skill, which actually hold the
tools.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 08:11
@RowitZou
RowitZou merged commit c5aa17e into main May 29, 2026
1 check failed

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@RowitZou
RowitZou deleted the feature/fix-feishu-channel-prompt branch May 30, 2026 16:14
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.

2 participants