Repository navigation
fix: preserve first prompt through project creation - #5161
Merged
liruifengv merged 1 commit intoNov 20, 2026
Merged
liruifengv merged 1 commit into
liruifengv merged 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 4fd6197 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
kimi-agent-bot
force-pushed
the
fix/first-prompt-project-create
branch
from
November 20, 2026 03:21
418a3c1 to
4fd6197
Compare
RealKai42
approved these changes
Nov 20, 2026
Merged
Grapedge
added a commit
that referenced
this pull request
Nov 23, 2026
* fix(core): add Claude 5 output token ceilings (#5096) * fix(core): add Claude 5 output token ceilings * chore: add Claude 5 output ceiling changeset * fix(markdown): keep table actions inside clipped containers (#5098) * fix(markdown): keep table actions inside clipped containers * fix(markdown): observe table action clipping ancestors --------- Co-authored-by: kimi-agent-bot <[email protected]> * fix(hosts): keep project lists usable with SSH hosts (#5102) * ci: release packages (#5094) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: preserve first prompt through project creation (#5161) Co-authored-by: kimi-agent-bot <[email protected]> * fix(agent-core-v2): align fork slicing with restored turn ids (#5165) * fix(agent-core-v2): align fork slicing with restored turn ids * chore: add restored fork fix changeset * fix(core): prevent AJV diagnostics from polluting TUI input (#5168) * refactor(core): route AJV logs through utils logger * chore(core): add AJV logger changeset * chore(core): clarify AJV logger changeset * fix: support UUID generation in insecure browser contexts (#5173) * fix: support UUID generation in insecure browser contexts * chore: update pnpm deps hash * fix: resolve crypto bindings in UUID lint rule --------- Co-authored-by: kimi-agent-bot <[email protected]> * fix(client): keep draft thinking effort after sending (#5170) * fix(client): keep draft thinking effort after sending * chore: add cli changeset for draft thinking fix * test(client): use function stub for websocket in thinking test * fix(client): preserve thinking effort during model normalization * fix(client): reconcile profile updates and model fallbacks * fix(client): scope draft thinking preservation * fix(tui): defer queued prompts until the loop drains (#5166) * fix(tui): defer queued prompts until the loop drains - add core and v2 drained/idle lifecycle events - consume reminder-only queues without starting a model turn - gate TUI queue dispatch and completion notifications on lifecycle state - document notification-handoff queue behavior and add a CLI patch changeset * fix(tui): close loop lifecycle races - emit idle only after the current macro is revalidated - keep queued input pending through compaction and delayed dispatch - reject stale idle after new work starts * fix(loop): correlate lifecycle events by generation - track macro generations in the core and v2 loop state - replace TUI macro inference with event-generation correlation - preserve compaction guards for queued dispatch * fix(desktop): simplify multi-select folder picker actions (#5174) * fix(kap-server): report :wait settled only after the session is on disk (#5176) :wait settled as soon as the turn left the in-memory activity view, but the engine writes wire records through a batched log that flushes in a later task. A server killed right after :wait reported idle could lose the end of the finished turn. Before it replies with a settled session, :wait now flushes the wire of every agent in the session and drains pending metadata writes. A failed write surfaces as an error instead of a settled reply. The KAP guide states the guarantee. A new test in sessions.test.ts slows down the disk write of the turn end and checks that the record is on disk when :wait returns. (cherry picked from commit fc33c6d) Co-authored-by: kai <[email protected]> * ci: release packages (#5163) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(client): keep config-derived draft thinking effort after sending (#5191) Co-authored-by: liruifengv <[email protected]> * ci: release packages (#5192) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(kap-server): resume sessions with unavailable models (#5212) * fix(kap-server): resume sessions with unavailable models * fix: let users replace unavailable session models * fix: scope unavailable model recovery state --------- Co-authored-by: kimi-agent-bot <[email protected]> * fix(plugins): detect MCP OAuth with targeted probes (#5197) * fix(plugins): detect MCP OAuth with targeted probes * fix(plugins): use the MCP inspect route * fix(plugins): preserve OAuth requirements across inspection and disconnect * fix(chat): show pending MCP browser authorization (#5246) * fix(chat): show pending MCP browser authorization * fix(chat): resolve MCP authorization lint findings * fix(chat): preserve MCP authorization failure details * fix(mcp): preserve cancellation during OAuth reconnect * fix(desktop): cache feedback form per host and let reply reasons wrap (#5303) * ci: release packages (#5232) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * test: port removed-model recovery coverage to testkit * test: dedupe anthropic output ceiling cases --------- Co-authored-by: Haozhe <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: 7Sageer <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: liruifengv <[email protected]> Co-authored-by: qer <[email protected]> Co-authored-by: kai <[email protected]> Co-authored-by: Luyu Cheng <[email protected]> Co-authored-by: grapedge <[email protected]>
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.
Requirement or Bug
Windows Desktop 首次安装且尚未选择项目时,用户在首页发送首条提示词。新建项目并选择目录后,提示词既未进入会话,也没有保留在输入框中(反馈 ID:
e5871a54-b130-44dd-b033-b98519d01074)。本 PR 将清空时机调整为「确认进入发送 / 排队 / steer 时」。项目受信任时继续创建会话并发送;项目尚未受信任或等待登录时,原提示词在弹窗期间及关闭后持续保留。改动迁移自 MoonshotAI/kimi-code-app#1346,适配合仓后的单一
apps/desktop渲染代码。Bug Reproduction Steps
未登录场景遵循同一问题:输入提示词后点击发送,登录弹窗出现前输入框已被清空,取消登录后无法继续编辑原提示词。
Root Cause
activeSessionId对外以空字符串''表示「无会话」,但项目创建完成后的保护条件使用!== null。空字符串因此被误判为「已经切换到其他会话」,待发送提示词不会进入startSessionAndSendPrompt。恢复路径还有同一状态契约问题:
?? undefined不会归一化空字符串,导致原草稿的undefined与当前会话的''被当成不同会话。逻辑只向原会话存储写入草稿,而不装载到当前 Composer,所以输入框仍为空。此外,Composer 原先在发出
submit事件前同步清空。登录、选项目等门槛弹窗期间,用户因此看不到原文。本 PR 从状态契约和清空时机两处作根本修复,不通过额外恢复弹窗前的快照掩盖问题。Code Changes
核心思路是让 Composer 在门槛判断期间始终保留原文,由 App 在确认进入实际发送管线后清空。清空前比较当前 Composer 与已提交快照,避免清掉等待期间输入的新内容。
packages/app-client/src/composables/useAppDialogs.ts:项目已受信任且用户未切换会话时,继续创建会话并发送原提示词;真正发送前触发 Composer 清空。apps/desktop/src/renderer/App.vue:统一归一化原会话与当前会话 ID;只在首次会话发送、已有会话发送或 steer 前清空。发送失败沿用现有草稿恢复机制。apps/desktop/src/renderer/App.vue:异步门槛阶段通过请求 ownership 防止重复提交。进入客户端发送管线后释放当前请求,旧请求的finally不会误释新请求。packages/app-components/src/composer/Composer.vue:增加可选的延迟清空模式及clearAfterDispatch。快照中的正文、附件顺序或浏览器引用备注发生变化时,不清除较新的输入。apps/desktop/src/renderer/components/chat/ChatDock.vue、ConversationPane.vue:传递延迟清空能力,并向 App 暴露确认清空方法。apps/desktop/e2e/core-turn.spec.ts:覆盖正常发送后清空、首次建项各阶段保留并在实际发送后清空、未登录弹窗及 Cancel 后保留。packages/app-client/test/app-dialogs.test.ts:使用生产真实的空字符串状态,覆盖受信任后继续发送及恢复逻辑。packages/app-components/test/composerUndoDraft.test.ts:覆盖确认发送才清空、等待期间的新输入保留、浏览器引用编辑保留。新仓的 Web 与 Desktop 已共用
apps/desktop/src/renderer,因此不再需要旧仓apps/web的平行修改。命令和 side chat 的默认清空行为不变。Behavior Changes and Affected Users
''被当成其他会话,待发送提示词不进入会话受影响模块为 Desktop / Web 的 Composer、会话发送、项目创建、登录门槛与草稿恢复。单元测试覆盖状态归一化、确认清空、重复提交保护及新输入保护;Desktop E2E 用例覆盖正常发送、建项和未登录路径。
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update(本次为既有交互的缺陷修复,无需新增用户文档)。迁移后的本地验证
旧仓的双端定向 E2E、常规 CI 与 Windows 真机验证记录见 MoonshotAI/kimi-code-app#1346。