Skip to Content
设计Prompt SuggestionPrompt Suggestion 实现状态

Prompt Suggestion 实现状态

跟踪 prompt suggestion (NES) 功能在所有包中的实现状态。

Core Module (packages/core/src/followup/)

组件状态代码行数描述
followupState.ts✅ Done~230框架无关的控制器,支持 timer/debounce
suggestionGenerator.ts✅ Done~260LLM 生成 + 12 条过滤规则 + forked query 支持
forkedQuery.ts✅ Done~240CacheSafeParams + createForkedChat + runForkedQuery
overlayFs.ts✅ Done~140Copy-on-write (COW) 覆盖文件系统
speculationToolGate.ts✅ Done~150基于 AST shell 解析器的工具边界强制检查
speculation.ts✅ Done~540支持流水线 suggestion + 模型覆盖的 speculation 引擎

CLI Integration (packages/cli/)

组件状态描述
AppContainer.tsx✅ DoneSuggestion 生成、speculation 生命周期、UI 渲染
InputPrompt.tsx✅ DoneTab/Enter/Right Arrow 接受操作,dismiss + abort
Composer.tsx✅ DoneProps 透传
UIStateContext.tsx✅ DonepromptSuggestion + dismissPromptSuggestion
useFollowupSuggestions.tsx✅ Done支持 telemetry + 按键追踪的 React hook
settingsSchema.ts✅ Done3 个 feature flag + fastModel 配置
settings.schema.json✅ DoneVSCode 配置 schema

WebUI Integration (packages/webui/)

组件状态描述
InputForm.tsx✅ DoneTab/Enter/Right Arrow + explicitText 提交
useFollowupSuggestions.ts✅ Done支持 onOutcome 的 React hook
followup.ts✅ Done子路径入口
components.css✅ DoneGhost text 样式
vite.config.followup.ts✅ Done独立构建配置

Telemetry (packages/core/src/telemetry/)

组件状态描述
PromptSuggestionEvent✅ Done10 个字段
SpeculationEvent✅ Done7 个字段
logPromptSuggestion()✅ DoneOpenTelemetry 日志记录器
logSpeculation()✅ DoneOpenTelemetry 日志记录器

Test Coverage

测试文件测试用例数描述
followupState.test.ts14控制器 timer、debounce、accept 回调、onOutcome、clear
suggestionGenerator.test.ts16全部 12 条过滤规则 + 边界情况 + 误报处理
overlayFs.test.ts15COW 写入、读取解析、apply、清理、路径遍历
speculationToolGate.test.ts27工具分类、审批模式、shell AST、路径重写
forkedQuery.test.ts6缓存参数 save/get/clear、深拷贝、版本检测
speculation.test.ts7ensureToolResultPairing 边界情况
smoke.test.ts21跨模块 E2E:filter + overlay + toolGate + cache + pairing
InputPrompt.test.tsx4Tab、Enter+submit、Right Arrow、completion 守卫

Audit History

轮次发现问题数修复问题数
R1-R41010(rule engine → LLM,状态简化)
R5-R622(Enter 快捷键冲突,Right Arrow telemetry)
R7-R833(WebUI telemetry,废弃类型,测试覆盖率)
R90—(问题收敛)
R10-R1111(historyManager 依赖)
R12-R1311(评估正则的词边界)
Phase 1+2 R1-R420+20+(权限绕过、overlay 安全性、竞态条件)
总计37+37+

Claude Code Alignment

功能对齐程度备注
Prompt text100%完全一致(仅品牌名称不同)
12 filter rules100%+\b 词边界优化
UI interaction (Tab/Enter/Right)100%
Guard conditions100%13 项检查
Telemetry100%10+7 个字段
Cache sharingDashScope cache_control
SpeculationCOW overlay + tool gating
Pipelined suggestion在 speculation 完成后生成
State management100%+Controller 模式,Object.freeze
Last updated on