fix(agent-core-v2): don't record turn.steer when an unconsumed steer … - #3933
Merged
Merged
Conversation
…seeds the next turn
🦋 Changeset detectedLatest commit: c7cfc8b 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 |
commit: |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted condition fixes duplicate transcript rendering and is covered by focused regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Prevents seeded post-cancellation prompts from being recorded as duplicate in-turn steer messages.
Changes:
- Suppresses redundant
turn.steerevents for prompts seeding a new turn. - Updates regression coverage and adds a CLI patch changeset.
| File | Description |
|---|---|
packages/agent-core-v2/src/agent/loop/loopService.ts |
Avoids redundant steer dispatch. |
packages/agent-core-v2/test/agent/prompt/promptService.test.ts |
Verifies correct event and message materialization behavior. |
.changeset/steer-seeded-turn-duplicate-message.md |
Documents the user-visible fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sailist
approved these changes
Sep 19, 2026
This was referenced Sep 19, 2026
Merged
Leeeon233
added a commit
to LodyAI/acp-extension-kimi
that referenced
this pull request
Sep 24, 2026
* feat(kimi-code): carry turn trace id and copilot stats in rating surveys (MoonshotAI#3907) * feat: expose resolved base_url on models.dev catalog provider items (MoonshotAI#3909) * fix(agent-core-v2): restore thinking for the openrouter reasoning dialect (MoonshotAI#3910) Keep string reasoning fields when a reasoning_details array is present, stamp each think part by source, and replay those fields on the next request. * ci: release packages (MoonshotAI#3862) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs(changelog): sync 2.0.1 from apps/kimi-code/CHANGELOG.md (MoonshotAI#3912) * fix(agent-core-v2): pre-shrink compaction history to the effective model window (MoonshotAI#3911) * fix(vscode): ignore Enter during IME composition in question dialog (MoonshotAI#3915) * fix(kap-server): deliver session-level interaction events past agent filters (MoonshotAI#3901) * revert(kap-server): drop the flat entity message protocol (v3 WS + history API) (MoonshotAI#3532) (MoonshotAI#3920) This reverts 64505e3. The v1 WS + legacy REST + transcript surfaces are alive on main and remain the single protocol surface; kimi-inspect returns to the transcript-based data model (keeping MoonshotAI#3747's removal of the prompt input, which adapted to the agent-core-v2 prompt-queue fold). * feat(oauth): parse goods_version from the managed /me profile payload (MoonshotAI#3921) * fix: keep turn ids above the wire-wide max and fold cold transcripts over the active branch (MoonshotAI#3922) * fix(agent-core-v2): floor the human turn clock at the wire-wide max on engine journal reset * fix(kap-server): fold the cold transcript snapshot over the restorable branch chain * fix(agent-core-v2): advance the human turn clock when a turn starts * fix(kap-server): split reused wire turn ids in the live transcript projector * fix(kap-server): adopt the completed cold tip for mid-turn attach events Continuation deltas after a lazy transcript attach belong on the last cold turn, not a newly split export id. * fix(agent-core-v2): remove the project-root assertion for cwd from the system prompt (MoonshotAI#3929) Co-authored-by: 7Sageer <7sageer@djwcb.cn> * chore: remove the tdd skill (MoonshotAI#3932) * fix(agent-core-v2): don't record turn.steer when an unconsumed steer seeds the next turn (MoonshotAI#3933) * chore: sync web dist from code-app (MoonshotAI#3934) * chore: sync web dist from code-app code-app: 44d7281c7a63ee3c7a907f9406e490efdbec7411 * chore: collapse web dist sync changesets into one summary entry * ci: release packages (MoonshotAI#3913) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: generate native Kimi ACP session titles (#15) --------- Co-authored-by: Grapedge <shiwang.lj@alibaba-inc.com> Co-authored-by: liruifengv <liruifeng1024@gmail.com> Co-authored-by: Haozhe <yanghaozhe@moonshot.ai> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: 7Hanrui <qihanrui@moonshot.ai> Co-authored-by: 7Sageer <7sageer@djwcb.cn> Co-authored-by: Zixuan Chen <remch183@outlook.com>
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.
Related Issue
N/A — internal bug, reproduced from a live desktop session (no tracking issue).
Problem
When a user steers a message while the agent is running, and the running turn then ends before the steer is consumed (cancelled via Esc, or completed before the next step boundary), the unconsumed steered prompt seeds the next turn as its opening prompt. The engine recorded both
turn.prompt(the turn's opening) andturn.steer(steer consumption) for the same message, so the live transcript projected it twice — the chat showed the steered message as two identical user bubbles.The cold transcript rebuild already deduplicates this case (a message whose id opened a turn is not folded as a steer), so reloading the session showed a single bubble — confirming the
turn.steerrecord is spurious when the steered message itself opens the new turn.What changed
AgentLoopService.consumeDrainedNudges, skip dispatchingTurnSteerwhen the nudge being consumed is the message that opened the active turn (nudge.contextMessage.id === active.prompt.message.id). The message is still materialized into context exactly once; only the durableturn.steerrecord is no longer written for it.turn.steernow only fires when a steer is actually injected mid-turn into an already-running turn, which is the only case that needs a separate steer frame in the transcript. Live rendering then matches the cold rebuild: one user bubble (the turn's opening prompt).turn.steeris published and the message lands in context exactly once.turn.steer; they now assert on the materialized context message (merged content, FIFO client metadata, reserved message id), which is the more direct seam for what they guard.Checklist
/approve). — N/A, internal buggen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.