fix(inbound): trim blocked quoted chain context - #515
Draft
soimy wants to merge 1 commit into
Draft
Conversation
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.
背景
#499相关的上游对齐项大多已经在主干落地,但对照docs/plans/2026-04-06-dingtalk-context-visibility-and-subagent-session-alignment.md继续复核后,仍发现一个剩余偏差:contextVisibility=allowlist/allowlist_quote目前只按第一跳 quoted sender 做可见性判断UntrustedContext泄漏给 runtime目标
contextVisibility的最后一处明显行为偏差allowlist与allowlist_quote下都符合计划中的多跳过滤预期quotedChain对外 JSON 结构稳定,避免引入额外兼容性噪音实现
quoted-context内为 chain entry 挂载不可枚举的 sender 元数据,仅供运行时过滤使用,不改变已有序列化输出inbound-handler的filterQuotedRuntimeContext()中改为逐跳裁剪 chain:allowlist:第一跳必须可见,后续 deeper inbound hop 仅保留连续 allowlisted 部分allowlist_quote:保留第一跳显式 quote,但继续裁掉 deeper blocked chainUntrustedContextallowlist_quote保留第一跳显式引用但不保留 deeper blocked chain实现 TODO
#499后续收口验证 TODO
npm run type-checkpnpm test