Conversation
Preserve ordered text and artifact IDs throughout composer, history, commands and model context. Allow every Thread including the source Thread itself, with server-owned project checks and full-body expansion. Refs #68
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
17 tasks
This was referenced Sep 7, 2026
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.
Project 已汇集各 Thread 的 Artifact,但 Composer 仍需手动复制正文,无法在一句话中明确指向多份产物。本 PR 按已确认的行内方案实现普通文字与 Artifact 引用混排,支持分叉探索后的比较、综合与继续讨论。
验证通过:
pnpm test:thread-chat:artifact-references(有序协议、完整模型正文、固定 ID、次数/字符预算、Drizzle Project 作用域、候选范围、send/edit/fork 回滚、Lexical 文档与剪贴板 round-trip)。保留 Draft:当前浏览器环境拦截本地地址,尚未完成真实浏览器的 IME、菜单、删除/撤销和布局验收;未连接测试数据库或真实模型,SQL executor 替身及模型消息转换测试不代表数据库/模型联调通过。待验步骤记录在
openspec/changes/add-inline-artifact-references/verification.md,开发交互测试页为/thread-chat-gate-3-harness/artifacts(仅 development + 本地访问)。Refs #68
Sites demo 确认后的正式接入
用户已确认 交互 demo,本 PR 继续承载项目实现。列视图与画布均补上显式
@ 引用按钮、按唯一 Artifact ID 统计的产物数量;按钮插入保持原光标位置,无选区时也能正确启动。沿用项目真实命令、数据库与模型上下文链路,不引入 demo 的模拟回复、失败开关或数据流调试面板。新增工具栏光标/未聚焦插入测试通过;已重新通过 TypeScript、改动文件 ESLint、Artifact 回归、normalized-client-store、normalized-v1-api-contract、prompt-cache-contract 和 OpenSpec strict。此前标注的真实浏览器与数据库/模型联调仍待验收;尚未合并 main。
Artifact 上下文去重与缓存
在最新消息编辑修复之上,补充当前 Thread 自引用、forkContext 继承以及跨轮重复引用的正文去重。按实际选定消息从前往后处理;只有前文确实有完整且身份匹配的源工具正文或已展开引用时,后续
@才使用固定 ID、冻结标题与previouslyIncludedInContext: true标记。字段与顺序固定,不包含轮次、时间或动态位置;不反向改写前文,不修改数据库 schema。验证:实际 AI SDK 模型消息中的正文计数、SDK 剔除不完整/临时工具后的全文补齐、同名不同 ID、原 Parts 不变、固定标记字节一致、追加消息后的模型前缀字节一致、重试确定性;Artifact 全量回归、prompt-cache-contract、TypeScript、ESLint、OpenSpec strict 和 diff 检查通过。真实提供商缓存命中率与账单尚未实测;新策略上线会改变旧重复展开前缀一次,后续追加保持稳定。