Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/vscode-subagent-spacing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Restore spacing between sub-agent output and the following user message in the VS Code chat.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,110 @@ export const MessageListToolToQueuedUserSpacing: Story = {
},
}

// ---------------------------------------------------------------------------
// MessageList — sub-agent (task tool) to queued user spacing
// Verifies the same vertical gap applies when the last assistant part is a
// sub-agent's expanded task tool, not just a regular tool like bash.
// ---------------------------------------------------------------------------

const subUserID = "user-msg-subagent-spacing-001"
const subAssistantID = "asst-msg-subagent-spacing-001"
const subQueuedUserID = "user-msg-subagent-spacing-002"
const subChildSessionID = "story-session-child-subagent-001"
const subNow = 1_700_000_100_000
const subagentSpacingMessages = [
{
id: subUserID,
sessionID: SESSION_ID,
role: "user",
time: { created: subNow - 9000 },
},
{
id: subAssistantID,
sessionID: SESSION_ID,
role: "assistant",
parentID: subUserID,
time: { created: subNow - 8000 },
modelID: "claude-sonnet-4-20250514",
providerID: "anthropic",
mode: "default",
agent: "default",
path: { cwd: "/project", root: "/project" },
},
{
id: subQueuedUserID,
sessionID: SESSION_ID,
role: "user",
time: { created: subNow - 1000 },
},
]
const subagentSpacingParts = {
[subUserID]: [
{
id: "part-user-subagent-spacing-001",
sessionID: SESSION_ID,
messageID: subUserID,
type: "text",
text: "Delegate a search to a sub-agent so I can test the spacing.",
},
],
[subAssistantID]: [
{
id: "part-task-subagent-spacing-001",
sessionID: SESSION_ID,
messageID: subAssistantID,
type: "tool",
callID: "call-task-subagent-spacing-001",
tool: "task",
state: {
status: "completed",
input: { description: "Find auth usage", subagent_type: "explore" },
output: "done",
title: "Find auth usage",
metadata: { sessionId: subChildSessionID },
time: { start: subNow - 7000, end: subNow - 6500 },
},
},
],
[subQueuedUserID]: [
{
id: "part-user-subagent-spacing-002",
sessionID: SESSION_ID,
messageID: subQueuedUserID,
type: "text",
text: "continue",
},
],
}
const subagentSpacingData = {
...defaultMockData,
message: {
[SESSION_ID]: subagentSpacingMessages,
[subChildSessionID]: [],
Comment thread
marius-kilocode marked this conversation as resolved.
},
part: subagentSpacingParts,
}

export const MessageListSubagentToQueuedUserSpacing: Story = {
name: "MessageList — sub-agent to queued user spacing",
render: () => {
const session = {
...mockSessionValue({ id: SESSION_ID, status: "idle" }),
messages: () => subagentSpacingMessages,
userMessages: () => subagentSpacingMessages.filter((msg) => msg.role === "user"),
}
return (
<StoryProviders data={subagentSpacingData} sessionID={SESSION_ID} status="idle" noPadding>
<SessionContext.Provider value={session as any}>
<div style={{ height: "420px", display: "flex", "flex-direction": "column" }}>
<MessageList />
</div>
</SessionContext.Provider>
</StoryProviders>
)
},
}

// ---------------------------------------------------------------------------
// TaskHeader with todos
// ---------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion packages/kilo-vscode/webview-ui/src/styles/chat-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,18 @@
VscodeSessionTurn layout
============================================ */

/* Virtua positions turns absolutely based on measured box size, so flex `gap`
on `.message-list-content` can't add spacing between turns. Bake the gap
into the turn's own padding — it's included in the measured height and so
shows up as spacing between turns (e.g. tool output to queued user message,
including sub-agent task tools which expand inline). */
.vscode-session-turn {
display: flex;
flex-direction: column;
gap: 12px;
width: 100%;
min-width: 0;
padding: 0 4px;
padding: 0 4px 12px;
}

.vscode-session-turn-user {
Expand Down
Loading