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/session-tab-attention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Show consistent running, completion, and input-required indicators across session tabs and Agent Manager worktrees.
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.
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.
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.
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.
18 changes: 17 additions & 1 deletion packages/kilo-vscode/src/KiloProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ import {
} from "./kilo-provider/handlers/question"
import { fetchAndSendPendingSuggestions } from "./kilo-provider/handlers/suggestion"
import { nativeTitle } from "./kilo-provider/native-tab-title"
import { isActivity, type Activity } from "../webview-ui/src/utils/session-activity"
import { parseReview, reviewMetadata, type ReviewMessageData } from "./shared/review-comments"
import { completesWithoutStatus } from "./kilo-provider/command-completion"
import { KiloProviderMemory } from "./kilo-provider/memory"
Expand Down Expand Up @@ -392,6 +393,8 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
private readonly refreshes = new Map<string, number>()
private readonly anacondaDesktop = new AnacondaDesktopBridge()
private sessionStatusMap = new Map<string, SessionStatus["type"]>() // Latest status used for destructive config warnings.
private activity: Activity = "idle"
private caption: string | undefined
private readonly epochs = new Map<string, Map<string, number>>()
private readonly requests = new Map<string, number>()
private epoch = 0
Expand Down Expand Up @@ -509,7 +512,15 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
if (id) this.refreshes.set(id, (this.refreshes.get(id) ?? 0) + 1)
}
this.currentSession = session
this.opts.tabTitle?.(nativeTitle(session))
this.updateTitle()
}

private updateTitle(): void {
if (!this.opts.tabTitle) return
const title = nativeTitle(this.currentSession, this.activity, this.opts.tabLabel)
if (this.caption === title) return
this.caption = title
this.opts.tabTitle(title)
}

private checkpoint(sid: string, run: () => Promise<void>): void {
Expand Down Expand Up @@ -1037,6 +1048,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
exportTranscript: (sessionID) => this.handleExportSessionTranscript(sessionID),
copy: (text) => vscode.env.clipboard.writeText(text),
openSessions: (ids) => this.trackOpenSessions(ids),
activity: (state) => {
if (!isActivity(state)) return
this.activity = state
this.updateTitle()
},
speechToTextModels: () => this.fetchAndSendSpeechToTextModels(),
modelUsage: (msg) => handleModelUsageMessage(msg, this.extensionContext, (value) => this.postMessage(value)),
backgroundJobs: (sessionID, requestID) => this.fetchAndSendBackgroundJobs(sessionID, requestID),
Expand Down
8 changes: 7 additions & 1 deletion packages/kilo-vscode/src/SubAgentViewerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export class SubAgentViewerProvider implements vscode.Disposable {
dark: vscode.Uri.joinPath(this.extensionUri, "assets", "icons", "kilo-dark.svg"),
}

const provider = new KiloProvider(this.extensionUri, this.connectionService, this.context, { hideTopBar: true })
const provider = new KiloProvider(this.extensionUri, this.connectionService, this.context, {
hideTopBar: true,
tabTitle: (title) => {
panel.title = title
},
tabLabel: label,
})
if (directory) provider.setSessionDirectory(sessionID, directory)
// Start accepting this session's SSE events as soon as the panel subscribes.
// Reasoning deltas are not persisted until the reasoning part finishes.
Expand Down
4 changes: 4 additions & 0 deletions packages/kilo-vscode/src/agent-manager/vscode-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export class VscodeHost implements Host {
})

const provider = new KiloProvider(this.extensionUri, this.connectionService, this.context, {
tabTitle: (title) => {
panel.title = title
},
tabLabel: "Agent Manager",
platform: PLATFORM,
snapshotInitialization: SNAPSHOT_INITIALIZATION,
slimEditMetadata: true,
Expand Down
8 changes: 7 additions & 1 deletion packages/kilo-vscode/src/kilo-provider-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,12 @@ export type WebviewMessage =
message: Record<string, unknown>
}
| { type: "sessionStatus"; sessionID: string; status: string; attempt?: number; message?: string; next?: number }
| { type: "sessionTurnClosed"; sessionID: string; reason: "completed" | "error" | "interrupted" | "superseded" }
| {
type: "sessionTurnClosed"
sessionID: string
reason: "completed" | "error" | "interrupted" | "superseded"
parentID?: string
}
| {
type: "permissionRequest"
permission: {
Expand Down Expand Up @@ -556,6 +561,7 @@ export function mapSSEEventToWebviewMessage(event: StreamEvent, sessionID: strin
type: "sessionTurnClosed",
sessionID: event.properties.sessionID,
reason: event.properties.reason,
...(event.properties.parentID ? { parentID: event.properties.parentID } : {}),
}
case "permission.asked":
return {
Expand Down
7 changes: 6 additions & 1 deletion packages/kilo-vscode/src/kilo-provider/early-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Ctx = {
exportTranscript: (sessionID: string) => Promise<void>
copy: (text: string) => PromiseLike<void>
openSessions: (ids: string[]) => void
activity: (state: unknown) => void
speechToTextModels: () => Promise<void>
modelUsage: (message: ModelUsageMessage) => Promise<void>
backgroundJobs: (sessionID: string, requestID: string) => Promise<void>
Expand Down Expand Up @@ -56,7 +57,7 @@ async function routeBackgroundMessage(
}

export async function routeEarlyMessage(
message: { type: string; id?: unknown; text?: unknown },
message: { type: string; id?: unknown; text?: unknown; state?: unknown },
ctx: Ctx,
): Promise<boolean> {
if (message.type === "copyToClipboard") {
Expand Down Expand Up @@ -88,6 +89,10 @@ export async function routeEarlyMessage(
if (typeof input.sessionID === "string") await ctx.exportTranscript(input.sessionID)
return true
}
if (message.type === "sessionActivity") {
ctx.activity(message.state)
return true
}
if (message.type === "sidebar.openSessions") {
const input = message as { sessionIDs?: unknown }
const ids = Array.isArray(input.sessionIDs)
Expand Down
19 changes: 14 additions & 5 deletions packages/kilo-vscode/src/kilo-provider/native-tab-title.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import type { Session } from "@kilocode/sdk/v2/client"
import type { Activity } from "../../webview-ui/src/utils/session-activity"
import { EXTENSION_DISPLAY_NAME } from "../constants"

const DEFAULT_SESSION_TITLE = /^(New session|Child session) - \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
const TITLE_LIMIT = 19
const icons: Record<Activity, string> = {
idle: "",
busy: "◔",
retry: "◔",
waiting: "⚠",
error: "⚠",
done: "✓",
}

export const nativeTitle = (session: Session | null) => {
const title = session?.title?.trim()
if (!title || DEFAULT_SESSION_TITLE.test(title)) return EXTENSION_DISPLAY_NAME
if (title.length <= TITLE_LIMIT) return title
return `${title.slice(0, TITLE_LIMIT)}...`
export const nativeTitle = (session: Session | null, state: Activity = "idle", label?: string) => {
const value = session?.title?.trim()
const title = label ?? (!value || DEFAULT_SESSION_TITLE.test(value) ? EXTENSION_DISPLAY_NAME : value)
const text = label || title.length <= TITLE_LIMIT ? title : `${title.slice(0, TITLE_LIMIT)}...`
return icons[state] ? `${icons[state]} ${text}` : text
}
1 change: 1 addition & 0 deletions packages/kilo-vscode/src/kilo-provider/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type KiloProviderOptions = {
snapshotInitialization?: "wait"
slimEditMetadata?: boolean
tabTitle?: (title: string) => void
tabLabel?: string
worktreeDirectories?: () => string[]
/**
* Dynamic root directory override. When present, it replaces the
Expand Down
Loading
Loading