Skip to content

fix(quick-start): present editable prompt proposals - #541

Open
huyanxius wants to merge 3 commits into
1024XEngineer:mainfrom
huyanxius:fix/533-quick-start-prompt-review
Open

fix(quick-start): present editable prompt proposals#541
huyanxius wants to merge 3 commits into
1024XEngineer:mainfrom
huyanxius:fix/533-quick-start-prompt-review

Conversation

@huyanxius

Copy link
Copy Markdown
Collaborator

本 PR 将 Quick Start 的提示词优化改为“Agent 提案、用户编辑并确认”的显式流程,避免内部协议文案暴露,并把最终生成控制权留给用户。

Why

原流程会把默认假设、Tool 语气和控制步骤直接展示给用户,同时自动覆盖输入框。用户难以区分 Agent 的内部状态与可编辑内容,也不便在生成前修正长提示词。

Changes

  • Agent 在聊天区展示面向用户的优化说明与完整提示词,不再展示 assumptions、Tool 名称或调用计划。
  • 增加无边框“填入输入框”操作;点击后复用现有改写动画,填入内容保持可编辑。
  • 长提示词输入框随内容自动增高,提交按钮固定在右下角;空白提示词无法触发生成。
  • 内部协议错误转换为用户可理解的提示,不暴露 Planner 或 Tool 细节。

Implementation

  • 将 Planner Tool 契约从 assumptions 改为 optimizationSummary,并在 runtime 做严格终态校验。
  • onBeforeDispatch 等待页面返回用户最终编辑后的提示词,确认前不调用生成 action。
  • 页面将提案、填入动画、编辑与再次发送拆成明确状态,保留现有 WorkflowController 与生成后端边界。

Verification

  • npm test -- src/pages/quick-start/index.test.tsx src/features/quick-start-agent/planner.protocol.test.ts src/features/quick-start-agent/planner.test.ts src/features/quick-start-agent/react.test.tsx src/features/quick-start-agent/runtime.test.ts:5 个文件、109 个测试通过。
  • npm run build:通过,只有既有 chunk-size warning。
  • npx oxlint <9 changed frontend files>:通过。
  • npx oxfmt --check <9 changed frontend files>:通过。
  • 本地真实 /ai/chat 流程:提案展示、主动填入、继续编辑均通过,未在确认前发起生成。

Screenshots

Desktop

Quick Start editable prompt proposal

Scope

  • 本 PR 不包含:WorkflowController、WorkflowRun、生成后端或最终提示词拼接规则变更。
  • 后续事项:无。

Related Issues

Closes #533

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 21, 2026 10:30am

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/pages/quick-start/index.tsx 85.00% 0 Missing and 3 partials ⚠️
frontend/src/features/quick-start-agent/runtime.ts 90.90% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已完整检查 Planner Tool 契约、runtime 终态校验、React 状态桥接,以及 Quick Start 的提案展示、主动填入、编辑后确认和生成交接。实现满足 #533 的关键边界:优化结果不会自动覆盖输入框,填入动作不会触发生成,最终提交使用用户编辑后的非空提示词,且内部 Planner/Tool 错误会转换为用户可理解的提示。

验证通过:5 个定向测试文件共 109 个测试、npm run typecheck、9 个变更文件的 oxlint 与 oxfmt 检查。未发现需要提出的正确性、可靠性或可维护性问题。

Internal planner output was leaking implementation details into the user conversation.

Replace assumptions with a user-facing summary and hold generation until the proposed prompt is filled and edited.

Keep protocol errors sanitized while preserving explicit user control before generation.
Prompt proposal changes span the planner protocol, runtime handoff, React state, and page interaction.

Update focused fixtures and regressions for user-facing summaries, sanitized errors, editable confirmation, and adaptive layout.

Protect the explicit fill-before-generate boundary from future regressions.
xyh202131
xyh202131 previously approved these changes Aug 21, 2026
Latest main added a draft migration regression that still followed the retired automatic prompt insertion.

Fill the Agent proposal before advancing the rewrite timer and sending generation.

Keep the run-sidecar migration assertions aligned with the user-confirmed flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Keep Quick Start prompt planning user-facing and editable

2 participants