Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2aee16b
fix(jetbrains): show tool window content as tabs
kirillk Aug 19, 2026
f73f947
fix(jetbrains): pad empty session recents
kirillk Aug 19, 2026
3e152b7
feat(jetbrains): update agent manager worktree list
kirillk Aug 19, 2026
89b20c6
feat(jetbrains): unify activity status colors and add error state
kirillk Aug 19, 2026
d5ddc8a
feat(jetbrains): animate running session icon in agent manager tree
kirillk Aug 20, 2026
ac98f5c
fix(jetbrains): refine agent manager activity icons
kirillk Aug 20, 2026
082b38b
fix(jetbrains): stop session error card EDT freeze
kirillk Aug 20, 2026
0161c3a
fix(jetbrains): refine agent manager badges
kirillk Aug 20, 2026
59d1ec8
feat(jetbrains): reorder worktrees with drag and drop
kirillk Aug 21, 2026
07d2189
fix(jetbrains): keep list selection stable across refreshes
kirillk Aug 21, 2026
6376629
fix(jetbrains): size the drag gap to the row body
kirillk Aug 21, 2026
092214b
fix(jetbrains): paint the whole row body into the drag image
kirillk Aug 21, 2026
f60e8dc
refactor(jetbrains): route every list refresh through one selection p…
kirillk Aug 21, 2026
e8e4602
test(jetbrains): load real icons in the worktree icon size test
kirillk Aug 21, 2026
4458ae6
Merge remote-tracking branch 'origin/main' into wandering-lantern
kirillk Aug 21, 2026
ccc6b52
refactor(jetbrains): slide workflow selection after delete
kirillk Aug 21, 2026
34a7eb3
fix(jetbrains): align session and worktree icons
kirillk Aug 21, 2026
0879741
fix(jetbrains): move PR number after the worktree title
kirillk Aug 21, 2026
64c14ab
fix(jetbrains): use regular title weight in active lists
kirillk Aug 21, 2026
31b7297
fix(jetbrains): mute worktree metadata styling
kirillk Aug 21, 2026
76faa30
feat(jetbrains): add chat branch/PR dock with worktree actions
kirillk Aug 23, 2026
32573a0
fix(jetbrains): show chat worktree actions only while the session is …
kirillk Aug 24, 2026
ce5a71e
fix(jetbrains): show worktree progress in agent rows
kirillk Aug 24, 2026
d94f2bf
fix(jetbrains): address worktree move and list review findings
kirillk Aug 24, 2026
98928ae
fix(jetbrains): enable worktree moves from local changes
kirillk Aug 24, 2026
edf6041
fix(jetbrains): align chat dock row spacing
kirillk Aug 24, 2026
2860d1a
fix(jetbrains): tighten chat dock row height
kirillk Aug 24, 2026
d4f869d
fix(jetbrains): scope worktree session history
kirillk Aug 24, 2026
d24cedd
fix(jetbrains): align chat PR badge
kirillk Aug 24, 2026
e9f56d4
fix(jetbrains): keep header popups beside chat
kirillk Aug 24, 2026
10d0a21
refactor(jetbrains): rename worktree metadata file to jetbrains.json
kirillk Aug 24, 2026
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/jetbrains-agent-manager-activity-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Show compact Agent Manager activity icons for running and waiting sessions while keeping idle rows aligned with a smaller idle dot.
5 changes: 5 additions & 0 deletions .changeset/jetbrains-empty-recents-padding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Add standard horizontal padding to the empty chat recent sessions list.
5 changes: 5 additions & 0 deletions .changeset/jetbrains-list-refresh-selection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Keep settings, history, and session lists on the same row and scroll position when they refresh, and select the neighbouring row after a delete.
5 changes: 5 additions & 0 deletions .changeset/jetbrains-list-selection-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Keep Agent Manager worktree selection stable when reordering worktrees and switching tabs.
5 changes: 5 additions & 0 deletions .changeset/jetbrains-session-error-card-freeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Fix an IDE freeze when a chat session reports an error, which could hang the whole IDE while opening a worktree session editor.
5 changes: 5 additions & 0 deletions .changeset/jetbrains-tool-window-tabs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Show the JetBrains tool window Chat and Agents views as tabs with shorter labels.
5 changes: 5 additions & 0 deletions .changeset/jetbrains-worktree-drag-reorder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": minor
---

Reorder Agent Manager worktrees by dragging them in the JetBrains plugin.
5 changes: 5 additions & 0 deletions .changeset/quiet-badges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Improve JetBrains Agent Manager session status badges, selection persistence, and PR badge theming.
5 changes: 5 additions & 0 deletions .changeset/wet-lemons-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Show the current branch first in Agent Manager and replace worktree activity tags with status icons. Running, question, and error activity now share one color between the row icon and the text badge, add an error state, and surface a notification dot on the Agents tab when a session needs attention.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class KiloBackendActivityManager(
) {
private val permissions = mutableMapOf<String, MutableSet<String>>()
private val questions = mutableMapOf<String, MutableMap<String, Boolean>>()
private val errors = mutableSetOf<String>()
private val lock = Any()
private val _activity = MutableStateFlow<Map<String, SessionActivityDto>>(emptyMap())
val activity: StateFlow<Map<String, SessionActivityDto>> = _activity.asStateFlow()
Expand Down Expand Up @@ -72,6 +73,7 @@ class KiloBackendActivityManager(
synchronized(lock) {
permissions.clear()
questions.clear()
errors.clear()
}
_activity.value = emptyMap()
log.info("Activity manager stopped")
Expand All @@ -84,6 +86,8 @@ class KiloBackendActivityManager(
is ChatEventDto.QuestionAsked -> questions.getOrPut(event.sessionID) { mutableMapOf() }[event.request.id] = plan(event)
is ChatEventDto.QuestionReplied -> removeMap(questions, event.sessionID, event.requestID)
is ChatEventDto.QuestionRejected -> removeMap(questions, event.sessionID, event.requestID)
is ChatEventDto.Error -> event.sessionID?.let { errors.add(it) }
is ChatEventDto.TurnOpen -> errors.remove(event.sessionID)
is ChatEventDto.SessionIdle -> clear(event.sessionID)
is ChatEventDto.SessionStatusChanged -> if (event.status.type == "idle") clear(event.sessionID)
else -> Unit
Expand All @@ -96,6 +100,7 @@ class KiloBackendActivityManager(
ids.addAll(current.filterValues { it.type == "busy" }.keys)
ids.addAll(permissions.keys)
ids.addAll(questions.keys)
ids.addAll(errors)
_activity.value = ids.mapNotNull { id ->
val dir = directory(id) ?: return@mapNotNull null
val kind = kind(id, current[id]?.type == "busy") ?: return@mapNotNull null
Expand All @@ -110,6 +115,7 @@ class KiloBackendActivityManager(
if (pending.values.any { it }) return SessionActivityKindDto.PLAN
return SessionActivityKindDto.QUESTION
}
if (id in errors) return SessionActivityKindDto.ERROR
if (busy) return SessionActivityKindDto.RUNNING
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,23 @@ class KiloWorktreeRpcApiImpl : KiloWorktreeRpcApi {
}
}

override suspend fun reorder(directory: String, paths: List<String>): Boolean =
withContext(Dispatchers.IO) {
val base = Path.of(directory).normalize()
val res = runGit(base, "worktree", "list", "--porcelain")
if (!res.ok) return@withContext false
val items = managedWorktrees(parseWorktreeList(res.stdout))
val store = worktreeNameStore(items) ?: return@withContext false
return@withContext try {
val state = readWorktreeState(store)
writeWorktreeState(store, state.copy(worktreeOrder = paths).reconcile(worktreePaths(items)))
true
} catch (e: Exception) {
LOG.warn("worktree reorder failed: dir=$directory message=${e.message}", e)
false
}
}

private data class GitResult(val exit: Int, val stdout: String, val stderr: String) {
val ok get() = exit == 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,38 @@ class KiloBackendActivityManagerTest {
assertFalse("ses_1" in manager.activity.value)
}

@Test
fun `error persists through idle and clears on next turn`() = runBlocking {
directories["ses_1"] = "/repo/wt"
statuses.value = mapOf("ses_1" to SessionStatusDto("busy"))
start()

events.emit(ChatEventDto.Error("ses_1"))
await("ses_1", SessionActivityKindDto.ERROR)

// Turn ends: session goes idle but the error must stay visible.
statuses.value = mapOf("ses_1" to SessionStatusDto("idle"))
events.emit(ChatEventDto.SessionIdle("ses_1"))
await("ses_1", SessionActivityKindDto.ERROR)

// A new turn clears the error.
events.emit(ChatEventDto.TurnOpen("ses_1"))
withTimeout(5_000) { manager.activity.first { "ses_1" !in it } }
assertFalse("ses_1" in manager.activity.value)
}

@Test
fun `global error without session is ignored`() = runBlocking {
directories["ses_1"] = "/repo/wt"
start()

events.emit(ChatEventDto.Error(null))
events.emit(ChatEventDto.QuestionAsked("ses_1", question("q_1", "ses_1")))

val snap = await("ses_1", SessionActivityKindDto.QUESTION)
assertEquals(1, snap.size)
}

@Test
fun `unknown session directory is omitted`() = runBlocking {
directories["ses_known"] = "/repo/wt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,39 @@ class KiloWorktreeRpcApiImplTest {
assertEquals(listOf(first.path, second.path), readWorktreeState(repo.resolve(".kilo").resolve("worktree-names.json")).worktreeOrder)
}

@Test
fun `reorder persists a new order that a later list returns`() = runBlocking {
initRepo()
val first = assertNotNull(api.create(repo.toString(), CreateWorktreeRequestDto("zebra")).worktree)
val second = assertNotNull(api.create(repo.toString(), CreateWorktreeRequestDto("alpha")).worktree)

assertTrue(api.reorder(repo.toString(), listOf(second.path, first.path)))

val listed = api.list(repo.toString()).worktrees.filter { !it.main }
assertEquals(listOf(second.path, first.path), listed.map { it.path })
assertEquals(
listOf(second.path, first.path),
readWorktreeState(repo.resolve(".kilo").resolve("worktree-names.json")).worktreeOrder,
)
}

@Test
fun `reorder drops unknown paths and appends omitted worktrees`() = runBlocking {
initRepo()
val first = assertNotNull(api.create(repo.toString(), CreateWorktreeRequestDto("zebra")).worktree)
val second = assertNotNull(api.create(repo.toString(), CreateWorktreeRequestDto("alpha")).worktree)

assertTrue(api.reorder(repo.toString(), listOf("/does/not/exist", second.path)))

val order = readWorktreeState(repo.resolve(".kilo").resolve("worktree-names.json")).worktreeOrder
assertEquals(listOf(second.path, first.path), order)
}

@Test
fun `reorder returns false when the repo has no worktrees`() = runBlocking {
assertFalse(api.reorder(repo.toString(), listOf("/repo/.kilo/worktrees/x")))
}

@Test
fun `remove prunes names and order from worktree state`() = runBlocking {
initRepo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import ai.kilocode.client.agentManager.SidePanelMode
import ai.kilocode.client.agentManager.applySidePanelMode
import ai.kilocode.client.agentManager.worktree.WorktreeController
import ai.kilocode.client.agentManager.AgentManagerPanel
import ai.kilocode.client.agentManager.sessionAttentionNeeded
import ai.kilocode.client.plugin.KiloBundle
import ai.kilocode.client.ui.AttentionDotIcon
import ai.kilocode.log.KiloLog
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.DataProvider
Expand All @@ -24,19 +25,19 @@ import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowContentUiType
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.platform.project.projectIdOrNull
import com.intellij.openapi.wm.impl.content.ToolWindowContentUi
import com.intellij.ui.content.Content
import com.intellij.ui.content.ContentManagerEvent
import com.intellij.ui.content.ContentManagerListener
import com.intellij.ui.content.ContentFactory
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.awt.BorderLayout
import java.awt.ComponentOrientation
import javax.swing.JPanel

/**
Expand Down Expand Up @@ -122,6 +123,7 @@ internal class KiloToolWindowSetupService(
}
agent.add(agentManagerPanel.component, BorderLayout.CENTER)

toolWindow.setContentUiType(ToolWindowContentUiType.TABBED, null)
// Hide the "Kilo Code" id label in the header so only the content tabs remain.
toolWindow.component.putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true")

Expand All @@ -132,8 +134,8 @@ internal class KiloToolWindowSetupService(
chatContent.setPreferredFocusedComponent { manager.defaultFocusedComponent }
val agentContent = factory.createContent(agent, KiloBundle.message("sidePanel.mode.agentManager"), false)
agentContent.applySidePanelMode(SidePanelMode.AGENT_MANAGER)
agentContent.applyAgentManagerBetaBadge()
agentContent.setPreferredFocusedComponent { agentManagerPanel.component }
agentContent.putUserData(ToolWindow.SHOW_CONTENT_ICON, true)
toolWindow.contentManager.addContent(chatContent)
toolWindow.contentManager.addContent(agentContent)
val listener = object : ContentManagerListener {
Expand All @@ -148,6 +150,16 @@ internal class KiloToolWindowSetupService(
toolWindow.contentManager.setSelectedContent(chatContent)
manager.newSession()

// Show a notification dot on the Agents tab whenever a worktree session needs attention.
val dot = cs.launch {
project.service<KiloSessionService>().activity.map(::sessionAttentionNeeded).collect { needed ->
withContext(Dispatchers.Main) {
agentContent.icon = if (needed) AttentionDotIcon else null
}
}
}
Disposer.register(manager) { dot.cancel() }

val actions = listOfNotNull(
ActionManager.getInstance().getAction("Kilo.NewSession"),
ActionManager.getInstance().getAction("Kilo.NewWorktree"),
Expand All @@ -165,13 +177,3 @@ internal class KiloToolWindowSetupService(
}
}
}

internal fun Content.applyAgentManagerBetaBadge() {
icon = AllIcons.General.Beta
description = KiloBundle.message("sidePanel.mode.agentManager.beta.description")
putUserData(ToolWindow.SHOW_CONTENT_ICON, true)
// TAB_LABEL_ORIENTATION_KEY is @ApiStatus.Experimental and may change or disappear between IDE
// releases; we declare no untilBuild cap. Failure is benign: putUserData no-ops and the Beta
// icon falls back to the left of the tab label.
putUserData(Content.TAB_LABEL_ORIENTATION_KEY, ComponentOrientation.RIGHT_TO_LEFT)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ai.kilocode.client.agentManager

import ai.kilocode.rpc.dto.SessionActivityDto
import ai.kilocode.rpc.dto.SessionActivityKindDto

/**
* Whether any session in the activity snapshot is waiting on the user or has failed,
* i.e. the Agents tab should show a notification dot.
*/
internal fun sessionAttentionNeeded(activity: Map<String, SessionActivityDto>): Boolean =
activity.values.any {
it.kind == SessionActivityKindDto.QUESTION ||
it.kind == SessionActivityKindDto.PLAN ||
it.kind == SessionActivityKindDto.PERMISSION ||
it.kind == SessionActivityKindDto.ERROR
}
Loading
Loading