Skip to content

[NyxID Chat] 会话 read model 不暴露已密封的 context attachments,准入失败原因不可区分 #3543

Open

Description

@eanz17

现象(生产实证,2026-08-27)

#3525 的 context attachment 是 create-only、由 ConversationContextAttachmentsBoundEvent 密封的不可变绑定。但消费方创建会话后无法从任何 read model 读回这个绑定:

GET /api/chat/conversations/{id}/state
→ snapshot 里没有 contextAttachments 字段(stateVersion、turns、task 都有,附件集合缺席)
GET /api/chat/conversations
→ 列表项同样没有

同时,准入失败的信号不可区分原因:挂载一个不存在的 artifactId 创建会话,SSE 以

RUN_ERROR code=ADMISSION_UNAVAILABLE
message="NyxID chat admission is unavailable for the requested Agent Profile or route."

结束——同一 code 覆盖「artifact 缺失 / 非 owner / kind 不支持 / 超过 4 条 / profile 或路由准入失败」,消费方无法向用户解释到底是哪一条 fail closed,也无法决定该重试还是该放弃附件降级。

影响

  • 消费方(如太微 BFF)只能在创建时本地记录「我以为绑了什么」,无法与 Host 侧实际密封的集合对账;
  • attachment 准入失败后没有任何 typed 恢复路径:降级为「无附件重试」需要消费方自己猜原因。

建议

  1. 会话 state/列表 read model 投影密封的 attachment 集合(artifactId + revisionMode + pinnedRevisionId,不含正文);
  2. NyxIdChatStartError 细分附件准入失败原因(如 ATTACHMENT_ADMISSION_DENIED + typed reason:not_found / access_denied / unsupported_kind / over_limit),RUN_ERROR 携带该 reason。
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions