Skip to content

bug(assistant): discovery session can mutate conversation memory indexes and adopt unassigned Matters #6250

Closed

Description

@liugddx

What happened

The discovery Session is a background Session that runs open-ended exploration. At 59f61cf7d its tool catalog contains all 31 tools in BOT_TOOLS, plus 20 more. Many Bot-only and conversation-scoped tools reject at execution. Several do not. Verified by calling each tool from the discovery Session (test fixture, Node 24.21.0):

Tool Effect on the conversation Result
MemoryIndexCreate creates a new memory index executed
MemoryIndexWrite writes a document into an existing index; the conversation reads it back executed
MemoryIndexEdit edits that document executed
MemoryIndexCheckpoint (complete: false) saves progress notes on an existing index executed
MemoryIndexControl (pause) pauses maintenance of an existing index executed
MatterAdopt (unassigned Matter) reassigns the Matter to the discovery Session; the conversation no longer lists it executed (see caveat)
MatterDelegate creates a Matter the conversation cannot see executed; tracked in #6249

Verified rejected at execution:

Tool Error
MatterStart Start a follow-up from the long-task dialog
MatterControl, MatterMessage, MatterSettle, MatterCheckpoint, MatterWriteFile This session has no follow-up / This turn does not own a matter activation
MatterAskBot Only the active delegated task can ask its Bot
SendUser, InboxCheck, AssistantSetAvatar, Sleep Tool belongs to the assistant Bot
InitiativeConfigure, InitiativeControl Initiative is outside this conversation
MatterAdopt on a task delegated by the conversation 此任务已属于另一段对话

Not verified: MemoryIndexMaintain, MemoryIndexAddSources, MemoryIndexControl (stop, configure), MemoryExtract (makes an LLM call), MemorySourceQuery (external source), MatterConditionTest, and native shell/edit tools. The test fixture exposes plugin tools only.

Caveat on MatterAdopt: the probe adopted a Matter created by the conversation's own MatterStart, which has no delegations row. The check that blocks adoption only runs when such a row exists. Whether production data contains unassigned rows of this shape has not been established.

Scope correction

The first draft of this issue treated all 20 tools outside BOT_TOOLS as over-exposed and proposed the Bot's ceiling as the discovery boundary. Review of #6247 pointed out that discovery legitimately needs DiscoveryReport, DiscoveryContext and source reads, and that BOT_TOOLS is a coordination role's list, not a read-only baseline. This issue is therefore scoped to verified execution. Catalog exposure of own-gated and Bot-only tools is a secondary cleanup.

Expected

  • The discovery Session cannot create, write, edit, checkpoint, control or adopt conversation memory or Matters.
  • A discovery-specific allowlist, for discussion: read tools, DiscoveryReport, DiscoveryContext. Decide on MemorySourceQuery and MemoryExtract.
  • Regression tests: each executed tool above is rejected from the discovery Session, and the conversation's indexes and Matters are unchanged after the attempt.

Related

中文版(点击展开)

标题: bug(assistant):探索会话可以修改对话的记忆索引,并接管未分配的事项

发生了什么

探索会话是后台运行的会话,用于开放式探索。在 59f61cf7d,它的工具目录包含 BOT_TOOLS 中的全部 31 个工具,另外还有 20 个。许多 Bot 专用和对话作用域的工具在执行时会被拒绝,但也有一些不会。以下是在探索会话中逐个调用的结果(测试夹具,Node 24.21.0):

工具 对对话的影响 结果
MemoryIndexCreate 创建新的记忆索引 执行成功
MemoryIndexWrite 向已有索引写入文档;对话可以读回 执行成功
MemoryIndexEdit 编辑该文档 执行成功
MemoryIndexCheckpoint(complete: false) 在已有索引上保存进度笔记 执行成功
MemoryIndexControl(pause) 暂停已有索引的维护 执行成功
MatterAdopt(未分配的事项) 把事项转给探索会话;对话不再列出它 执行成功(见注意事项)
MatterDelegate 创建对话看不到的事项 执行成功;见 #6249

在执行时被拒绝:

工具 错误
MatterStart 只能从长任务对话框开始后续任务
MatterControl、MatterMessage、MatterSettle、MatterCheckpoint、MatterWriteFile 此会话没有后续任务 / 此轮次不拥有事项激活
MatterAskBot 只有当前活动的委派任务可以询问 Bot
SendUser、InboxCheck、AssistantSetAvatar、Sleep 工具属于助手 Bot
InitiativeConfigure、InitiativeControl 主动发现不属于此对话
对对话委派的事项执行 MatterAdopt 此任务已属于另一段对话

未验证:MemoryIndexMaintain、MemoryIndexAddSources、MemoryIndexControl 的 stop 和 configure、MemoryExtract(会发起一次 LLM 调用)、MemorySourceQuery(外部数据源)、MatterConditionTest,以及原生的 shell 与编辑工具。测试夹具只暴露插件工具。

MatterAdopt 注意事项: 探针接管的是对话自己通过 MatterStart 创建的事项,它没有 delegations 记录。阻止接管的检查只在该记录存在时生效。生产数据中是否存在这种未分配记录,尚未确认。

范围修正

本 issue 的初稿把 BOT_TOOLS 之外的 20 个工具都视为暴露过度,并建议以 Bot 的天花板作为探索的边界。#6247 的评审指出:探索合理地需要 DiscoveryReport、DiscoveryContext 和源数据读取,而 BOT_TOOLS 是协调角色的清单,不是只读基线。因此本 issue 只聚焦已验证的执行行为。对于那些有门控但仍在目录中的工具,暴露问题只作为次要清理项。

期望行为

  • 探索会话不能创建、写入、编辑、保存进度、控制或接管对话的记忆或事项。
  • 探索专用的白名单(待讨论):读取类工具、DiscoveryReport、DiscoveryContext。MemorySourceQuery 和 MemoryExtract 待决定。
  • 回归测试:上表中每个已执行的工具都必须在探索会话中被拒绝;尝试之后,对话的索引和事项保持不变。

相关

Activity

  1. added
    bug
    on Oct 23, 2026
  2. changed the title [-]bug(assistant): discovery session receives write and control tools outside the Bot tool ceiling[/-] [+]bug(assistant): discovery session can mutate conversation memory indexes and adopt unassigned Matters[/+] on Oct 23, 2026
  3. liugddx commented on Oct 23, 2026

    @liugddx
    MemberAuthor

    The verified execution set is fixed in #6256: memory index write, edit, checkpoint, create, control and maintain; MatterAdopt; MatterControl/MatterMessage and the other conversation-scoped Matter controls; worker-only Matter lifecycle tools; and Bot-only and initiative-configuration tools. Each is excluded from the discovery catalog and rejected at execution. Six regression tests, 4 of which fail without the change.

    Still open, as the title says:

    • The allowlist decision for MemorySourceQuery and MemoryExtract (kept available for now).
    • Native shell and edit tools in the discovery Session have not been verified; the fixture exposes plugin tools only.
    中文版(点击展开)

    #6256 已修复已验证的执行范围:记忆索引的写入、编辑、保存进度、创建、控制和维护;MatterAdopt;MatterControl、MatterMessage 等对话作用域的事项控制;仅供工作者使用的事项生命周期工具;以及仅 Bot 可用和初始化配置类工具。这些工具都已从探索会话的目录中移除,并在执行时被拒绝。新增 6 个回归测试,其中 4 个在未修复的代码上失败。

    仍未完成(与标题一致):

    • MemorySourceQuery 与 MemoryExtract 的白名单决策(目前保持可用)。
    • 探索会话中的原生 shell 与编辑工具尚未验证;夹具只暴露插件工具。
  4. liugddx commented on Oct 26, 2026

    @liugddx
    MemberAuthor

    Fixed and merged in #6256, with regression tests. The verified execution set (memory index mutations, MatterAdopt, conversation-scoped Matter controls, worker-only Matter lifecycle tools, Bot-only and initiative-configuration tools) is excluded from the discovery catalog and rejected at execution. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions