fix(feishu): drop stale Cloud workspace tool guidance from main's channel prompt - #17
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
main 是 orchestrator,手上没有任何 Feishu 工具——8 个
Feishu*工具被FEISHU_RESERVED_TOOLS保留,在filterToolsByRoleVisibility处从 main 的目录里滤掉(inline / deferred 都没有,直接调会被canUseTooldeny)。但
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-workflowskill(它们才真正持有这些工具)。验证
pnpm typecheck✅role-prompt.snapshot/prompt-for-role)✅ —— channelContext 不进 snapshot,main 其余 prompt 字节不变🤖 Generated with Claude Code