feat: label prompts Kilo sends on the user's behalf - #14282
Merged
Merged
Conversation
Prompts that Kilo composes for the user (worktree base updates and expanded slash-command templates) rendered as ordinary user messages. Long templates also flooded the transcript. Stamp those parts with metadata.kilo.injected in the message metadata, which persists with the session. The user bubble now shows a Sent by Kilo header with the prompt title, collapses long prompts to the first paragraph, and reveals the full text through Show prompt. The pull request fix instruction is recognised in the message body so an auto-sent fix is labelled, and text the user typed alongside it stays visible while the added instruction stays behind the toggle.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (6 files)
Fix these issues in Kilo Cloud Previous Review Summaries (2 snapshots, latest commit 9447d5f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9447d5f)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous review (commit 48c7b0a)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (12 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
injectedPreview returned the whole body as its first paragraph when a long prompt had no blank line, so the bubble showed the fade and a Show prompt toggle that revealed identical text. Return no preview when the first paragraph is the entire body. Add unit coverage and Storybook visual-regression stories for the injected prompt states: long command, short prompt, single paragraph, auto-sent pull request fix, and user text with the added push instruction.
…ions Revert and Edit restored the full expanded template into the prompt input, and Up-arrow history recalled it. Injected parts now restore only a slash command title, and other injected prompts restore nothing. Editor and terminal code actions sent their template as a plain user bubble. An optional injected title now travels from the extension through the triggerTask and sendMessage messages, so the host can merge metadata.kilo.injected without dropping review feedback metadata.
… improve-injected-prompt-ui
marius-kilocode
enabled auto-merge
September 18, 2026 10:38
marius-kilocode
disabled auto-merge
September 18, 2026 12:13
iscekic
approved these changes
Sep 18, 2026
This was referenced Sep 19, 2026
This was referenced Sep 21, 2026
Le0xFF
added a commit
to Le0xFF/kilocode
that referenced
this pull request
Sep 26, 2026
Single close-out of the v7.7.5..v7.8.1 (884 commits, 13 slices) upstream window: - Baselines regenerated once (kilo-vscode store): 24 snapshots updated for window UI changes, 3 broken LFS-pointer baselines recaptured (work-style-onboarding pair, session-tabs pinned), 10 new story baselines added (injected-prompt Kilo-Org#14282 set, pinned/session tabs, full-screen diff); kilo-ui visual job run as health check (store untracked in this fork, outputs not committed). - Close-out code fixes (2 files, kilo-vscode webview): transcript-search locate() start-anchor boundary attribution and a forceCenter flag for precise Enter-jump centering in MessageList — resolves the window-introduced chat-auto-scroll spec red (pre-sync green, no post-T upstream fix). - knip.json: ignore @kilocode/sandbox (the sync-introduced unused-dep finding: adopted browser-panel surface imports the new ./destination subpath knip does not track); remaining knip reds pre-date the sync (verified on pre-sync-20260926) and are reported. - Docs: PRUNE-NOTES history entry for the 2026-09-26 sync + baseline-store path correction (live store = packages/kilo-docs/public/img/screenshot-tests/kilo-vscode, test-fixtures/ absent, LFS rules stale), CHANGELOG 7.8.1 offline-fork section, upstream-sync.md edge-case note (kilo-docs live subtree must never be bulk-removed mid-slice). - Verified: typecheck/lint/5 guards/check:offline 10/10/check:duplication, test:unit 462/462, test:visual 309 passed+47 skipped+0 failed, offline smoke /provider = 6 local providers only, VSIX re-packed with the fixed bundle (kilo-code-7.8.1-{linux,win32}.vsix), I1-I11 incl. ^1.103.0 floor. No push, no PR.
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.
What Problem This Solves
Prompts that Kilo composes for the user looked identical to text the user typed. A worktree base update, an expanded slash-command template, and an editor or terminal code action all rendered as ordinary user bubbles. Because a command such as
/reviewexpands to a 371-line template, the transcript also filled up with instructions the user never wrote, and there was no way to tell which message came from where.Why This Change Was Made
The message schema already carries a persisted
TextPart.metadatafield, and the review and browser-feedback flows already use it to re-render parts after a reload. This change reuses that mechanism instead of adding a new side channel.TextPart.metadata.kilo.injected = { title }marks a prompt Kilo composed. The extension stamps worktree base updates and editor and terminal code actions, and the CLI stamps the expanded slash-command template inKiloSessionProcessor.markCommand.Sent by Kilo · <title>header above the body, reusing the existing Agent Manager attribution row, so peer prompts and injected prompts read the same way.Show prompttoggle. The bubble fades at its bottom edge while collapsed to signal that the prompt continues.Plain user messages are unchanged: no header, no collapse, no metadata.
User Impact
Users can tell at a glance whether a message came from them or from Kilo, and a long template no longer dominates the transcript while remaining fully inspectable and copyable. The header persists across session reloads because the marker lives in the stored part metadata.
Evidence
Focused checks run from
packages/kilo-vscode/andpackages/opencode/:bun run compile(type check, lint, bundle),bun run knipbun test tests/unit/injected-prompt.test.ts tests/unit/base-update.test.ts(29 pass)bun test test/kilocode/session-processor-review-telemetry.test.ts(15 pass)bun run script/check-opencode-annotations.tsfor the shared-file changesLive self-test cases in isolated VS Code with DeepSeek V4.1 Flash: injected command bubble and collapse, Up-arrow history, Revert on a command, Revert on a non-command injected prompt, the editor
Explain codeaction, and the terminalFix terminal commandaction.Screenshots
Live capture from the isolated
vscode-self-testrun. A/review worktreecommand collapses the 371-line template to its first paragraph, fades the bottom edge, and offersShow prompt:Editor and terminal code actions are labelled too. Live capture of the
Generate terminal commandaction, including the assistant reply:Component states from the visual-regression baselines.
A short injected prompt shows the header and the full text, with no toggle:
A long single paragraph shows in full, with no false collapse, no fade, and no toggle:
An auto-sent pull request fix is detected from the body:
User text sent with the push instruction keeps the user text visible and puts the added instruction behind the toggle: