Repository navigation
fix(secretary): silence_turn 说明补上待办推送,静默标签改从共享清单派生 - #830
Merged
Merged
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.
Why
目标:让秘书 silence_turn 的说明和宿主的实际行为一致,并让可静默的标签只有一份清单。来自 #812(74e6212)评审的 follow-up。
<secretary-todo>触发的回合静默,但prompt.ts的 Noise 段和silenceTurn.ts的工具描述都没写它。silence.ts手写了一份可静默标签,transcript.ts的INJECTED_BLOCK_TAGS是另一份,两份会漂移。改了什么
transcript.ts:注入块标签改成一张表,每个标签标明它触发的回合能否静默。INJECTED_BLOCK_TAGS和新导出的SILENCEABLE_BLOCK_TAGS都从这张表派生,新加标签时必须当场决定能否静默。silence.ts:isPureSessionUpdate改用SILENCEABLE_BLOCK_TAGS生成正则,删掉手写的 7 段 replace。可静默的集合和原来完全相同。<secretary-todo>回合只有在本轮没处置任何待办时才可静默,派发、分诊或关闭过待办就要正常回复。Todos 段里 todo-sweep 的「处置过就不静默」不变。silence_turn 描述同时补上 Noise 段已有的<secretary-trigger>,两处口径一致。验证
<secretary-todo>。修复后转绿。isPureSessionUpdate判定都和它是否可静默一致;描述和 Noise 段点名的标签都必须属于可静默集合。isPureSessionUpdate在 18 条边界输入上逐条对比,结果全部相同。输入包括空串、CRLF、大写标签、未闭合、嵌套、不可信正文里的转义闭合、交错标签。pnpm typecheck、pnpm lint通过。pnpm test:changed6905 通过、3 失败。失败的是agentService.formal(已知环境噪声)和oauthProviders.refresh,后者单独重跑 3/3 通过,属于负载下的时序抖动,和本改动无关。