mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-31 01:37:28 +08:00
fix(tui): show progress indicators while subagent is initializing (#8807)
* fix(tui): show progress indicators while subagent is initializing Show '↳ Starting...' in the parent session's Task entry when the subagent is running but has not yet made any tool calls, and show '↳ Initializing...' in the subagent session view when it has no messages yet. Prevents the UI from appearing frozen during the LLM thinking phase on startup. Closes #8422 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(tui): annotate kilocode changes for CI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(webview): show progress indicators while subagent is initializing Mirror the TUI fix for the VS Code extension webview: - TaskToolExpanded: show "Starting..." when the task tool is running but the child session has no tool calls yet (previously the expanded body was empty/blank). - MessageList/ChatView: propagate the readonly flag so the subagent viewer shows "Initializing..." instead of the generic welcome screen when the session has no messages yet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: add i18n translations for Initializing and Starting strings Replace hardcoded 'Initializing...' and 'Starting...' strings in webview components with language.t() calls. Add session.messages.initializing and session.messages.taskStarting keys to all 19 locale files. Note: The TUI (packages/opencode) has no i18n framework — all strings are hardcoded throughout the codebase, so the 'Initializing...' string in the TUI session view remains as-is. * fix: localize Initializing/Starting strings in all locale files Replace English placeholder strings with proper translations in all 19 non-English locale files. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,7 @@ export const ChatView: Component<ChatViewProps> = (props) => {
|
||||
onSelectSession={props.onSelectSession}
|
||||
onShowHistory={props.onShowHistory}
|
||||
questions={standaloneQuestions}
|
||||
readonly={props.readonly}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,6 +44,8 @@ interface MessageListProps {
|
||||
onShowHistory?: () => void
|
||||
/** Non-tool question requests to render inline at the bottom of the message list */
|
||||
questions?: () => QuestionRequest[]
|
||||
/** When true (subagent viewer), replace the welcome screen with an initializing indicator */
|
||||
readonly?: boolean
|
||||
}
|
||||
|
||||
export const MessageList: Component<MessageListProps> = (props) => {
|
||||
@@ -114,7 +116,12 @@ export const MessageList: Component<MessageListProps> = (props) => {
|
||||
<span>{language.t("session.messages.loading")}</span>
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={isEmpty()}>
|
||||
<Show when={isEmpty() && props.readonly}>
|
||||
<div class="message-list-empty">
|
||||
<p class="kilo-about-text">{language.t("session.messages.initializing")}</p>
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={isEmpty() && !props.readonly}>
|
||||
<div class="message-list-empty">
|
||||
<KiloLogo />
|
||||
<p class="kilo-about-text">{language.t("session.messages.welcome")}</p>
|
||||
|
||||
@@ -13,6 +13,7 @@ import { BasicTool } from "@kilocode/kilo-ui/basic-tool"
|
||||
import { Icon } from "@kilocode/kilo-ui/icon"
|
||||
import { IconButton } from "@kilocode/kilo-ui/icon-button"
|
||||
import { useData } from "@kilocode/kilo-ui/context/data"
|
||||
import { useLanguage } from "../../context/language"
|
||||
import { useI18n } from "@kilocode/kilo-ui/context/i18n"
|
||||
import { createAutoScroll } from "@kilocode/kilo-ui/hooks"
|
||||
import { useSession } from "../../context/session"
|
||||
@@ -39,6 +40,7 @@ function getSessionToolParts(store: ReturnType<typeof useData>["store"], session
|
||||
const TaskToolRenderer: Component<ToolProps> = (props) => {
|
||||
const data = useData()
|
||||
const i18n = useI18n()
|
||||
const language = useLanguage()
|
||||
const session = useSession()
|
||||
const vscode = useVSCode()
|
||||
|
||||
@@ -117,6 +119,11 @@ const TaskToolRenderer: Component<ToolProps> = (props) => {
|
||||
<BasicTool icon="task" status={props.status} trigger={trigger()} defaultOpen>
|
||||
<div ref={autoScroll.scrollRef} onScroll={autoScroll.handleScroll} data-component="tool-output" data-scrollable>
|
||||
<div ref={autoScroll.contentRef} data-component="task-tools">
|
||||
<Show when={running() && childToolParts().length === 0}>
|
||||
<div data-slot="task-tool-item" data-state="starting">
|
||||
<span data-slot="task-tool-title">{language.t("session.messages.taskStarting")}</span>
|
||||
</div>
|
||||
</Show>
|
||||
<For each={childToolParts()}>
|
||||
{(item) => {
|
||||
const info = createMemo(() => getToolInfo(item.tool, item.state?.input))
|
||||
|
||||
+2
@@ -930,6 +930,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code هو مساعد ترميز بالذكاء الاصطناعي. اطلب منه بناء ميزات أو إصلاح أخطاء أو شرح قاعدة الشيفرة.",
|
||||
"session.messages.scrollToBottom": "التمرير إلى الأسفل",
|
||||
"session.messages.initializing": "جاري التهيئة...",
|
||||
"session.messages.taskStarting": "جاري البدء...",
|
||||
"session.status.writingResponse": "...جارٍ كتابة الرد",
|
||||
"session.status.retry": "جارٍ إعادة المحاولة…",
|
||||
"session.status.retrying": "...إعادة المحاولة (المحاولة {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -938,6 +938,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code é um assistente de programação com IA. Peça para criar funcionalidades, corrigir bugs ou explicar sua base de código.",
|
||||
"session.messages.scrollToBottom": "Rolar para o final",
|
||||
"session.messages.initializing": "O teraouiñ...",
|
||||
"session.messages.taskStarting": "O kregiñ...",
|
||||
"session.status.writingResponse": "Escrevendo resposta…",
|
||||
"session.status.retry": "Tentando novamente…",
|
||||
"session.status.retrying": "Tentando novamente (tentativa {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -943,6 +943,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code je AI asistent za programiranje. Zatražite da gradi funkcionalnosti, ispravlja greške ili objasni vašu bazu koda.",
|
||||
"session.messages.scrollToBottom": "Pomakni se na dno",
|
||||
"session.messages.initializing": "Inicijalizacija...",
|
||||
"session.messages.taskStarting": "Pokretanje...",
|
||||
"session.status.writingResponse": "Pisanje odgovora…",
|
||||
"session.status.retry": "Ponovni pokušaj…",
|
||||
"session.status.retrying": "Ponovni pokušaj (pokušaj {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -936,6 +936,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code er en AI-kodningsassistent. Bed den om at bygge funktioner, rette fejl eller forklare din kodebase.",
|
||||
"session.messages.scrollToBottom": "Rul til bunden",
|
||||
"session.messages.initializing": "Initialiserer...",
|
||||
"session.messages.taskStarting": "Starter...",
|
||||
"session.status.writingResponse": "Skriver svar…",
|
||||
"session.status.retry": "Prøver igen…",
|
||||
"session.status.retrying": "Prøver igen (forsøg {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -948,6 +948,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code ist ein KI-Programmierassistent. Bitten Sie ihn, Funktionen zu erstellen, Fehler zu beheben oder Ihre Codebasis zu erklären.",
|
||||
"session.messages.scrollToBottom": "Nach unten scrollen",
|
||||
"session.messages.initializing": "Initialisierung...",
|
||||
"session.messages.taskStarting": "Wird gestartet...",
|
||||
"session.status.writingResponse": "Antwort wird geschrieben…",
|
||||
"session.status.retry": "Erneuter Versuch…",
|
||||
"session.status.retrying": "Erneuter Versuch ({{ attempt }})… {{ message }}",
|
||||
|
||||
@@ -936,6 +936,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code is an AI coding assistant. Ask it to build features, fix bugs, or explain your codebase.",
|
||||
"session.messages.scrollToBottom": "Scroll to bottom",
|
||||
"session.messages.initializing": "Initializing...",
|
||||
"session.messages.taskStarting": "Starting...",
|
||||
"session.status.writingResponse": "Writing response...",
|
||||
"session.status.retry": "Retrying…",
|
||||
"session.status.retrying": "Retrying (attempt {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -944,6 +944,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code es un asistente de programación con IA. Pídele que cree funcionalidades, corrija errores o explique tu código.",
|
||||
"session.messages.scrollToBottom": "Desplazar al final",
|
||||
"session.messages.initializing": "Inicializando...",
|
||||
"session.messages.taskStarting": "Iniciando...",
|
||||
"session.status.writingResponse": "Escribiendo respuesta…",
|
||||
"session.status.retry": "Reintentando…",
|
||||
"session.status.retrying": "Reintentando (intento {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -950,6 +950,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code est un assistant de programmation IA. Demandez-lui de créer des fonctionnalités, corriger des bugs ou expliquer votre code.",
|
||||
"session.messages.scrollToBottom": "Défiler vers le bas",
|
||||
"session.messages.initializing": "Initialisation...",
|
||||
"session.messages.taskStarting": "Démarrage...",
|
||||
"session.status.writingResponse": "Rédaction de la réponse…",
|
||||
"session.status.retry": "Nouvelle tentative…",
|
||||
"session.status.retrying": "Nouvelle tentative (essai {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -935,6 +935,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo CodeはAIコーディングアシスタントです。機能の構築、バグの修正、コードベースの説明を依頼できます。",
|
||||
"session.messages.scrollToBottom": "下にスクロール",
|
||||
"session.messages.initializing": "初期化中...",
|
||||
"session.messages.taskStarting": "開始中...",
|
||||
"session.status.writingResponse": "応答を作成中…",
|
||||
"session.status.retry": "再試行中…",
|
||||
"session.status.retrying": "再試行中({{ attempt }}回目)… {{ message }}",
|
||||
|
||||
+2
@@ -935,6 +935,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code는 AI 코딩 어시스턴트입니다. 기능 구축, 버그 수정 또는 코드베이스 설명을 요청하세요.",
|
||||
"session.messages.scrollToBottom": "하단으로 스크롤",
|
||||
"session.messages.initializing": "초기화 중...",
|
||||
"session.messages.taskStarting": "시작 중...",
|
||||
"session.status.writingResponse": "응답 작성 중...",
|
||||
"session.status.retry": "재시도 중…",
|
||||
"session.status.retrying": "재시도 중 ({{ attempt }}번째 시도)… {{ message }}",
|
||||
|
||||
+2
@@ -937,6 +937,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code is een AI-codeerassistent. Vraag het om features te bouwen, bugs op te lossen of je codebase uit te leggen.",
|
||||
"session.messages.scrollToBottom": "Scroll naar beneden",
|
||||
"session.messages.initializing": "Initialiseren...",
|
||||
"session.messages.taskStarting": "Starten...",
|
||||
"session.status.writingResponse": "Antwoord schrijven...",
|
||||
"session.status.retry": "Opnieuw proberen...",
|
||||
"session.status.retrying": "Opnieuw proberen (poging {{ attempt }})... {{ message }}",
|
||||
|
||||
+2
@@ -940,6 +940,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code er en AI-kodingsassistent. Be den om å bygge funksjoner, fikse feil eller forklare kodebasen din.",
|
||||
"session.messages.scrollToBottom": "Rull til bunnen",
|
||||
"session.messages.initializing": "Initialiserer...",
|
||||
"session.messages.taskStarting": "Starter...",
|
||||
"session.status.writingResponse": "Skriver svar…",
|
||||
"session.status.retry": "Prøver på nytt…",
|
||||
"session.status.retrying": "Prøver på nytt (forsøk {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -940,6 +940,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code to asystent programowania AI. Poproś go o tworzenie funkcji, naprawę błędów lub wyjaśnienie bazy kodu.",
|
||||
"session.messages.scrollToBottom": "Przewiń na dół",
|
||||
"session.messages.initializing": "Inicjalizacja...",
|
||||
"session.messages.taskStarting": "Uruchamianie...",
|
||||
"session.status.writingResponse": "Pisanie odpowiedzi…",
|
||||
"session.status.retry": "Ponawianie…",
|
||||
"session.status.retrying": "Ponawiam próbę ({{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -943,6 +943,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code — это AI-помощник для программирования. Попросите его создать функции, исправить ошибки или объяснить вашу кодовую базу.",
|
||||
"session.messages.scrollToBottom": "Прокрутить вниз",
|
||||
"session.messages.initializing": "Инициализация...",
|
||||
"session.messages.taskStarting": "Запуск...",
|
||||
"session.status.writingResponse": "Пишу ответ…",
|
||||
"session.status.retry": "Повторная попытка…",
|
||||
"session.status.retrying": "Повторная попытка ({{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -931,6 +931,8 @@ export const dict = {
|
||||
"session.messages.empty": "เริ่มการสนทนาโดยพิมพ์ข้อความด้านล่าง",
|
||||
"session.messages.welcome": "Kilo Code เป็นผู้ช่วยเขียนโค้ด AI ขอให้สร้างฟีเจอร์ แก้ไขบัก หรืออธิบายโค้ดเบสของคุณ",
|
||||
"session.messages.scrollToBottom": "เลื่อนไปด้านล่าง",
|
||||
"session.messages.initializing": "กำลังเริ่มต้น...",
|
||||
"session.messages.taskStarting": "กำลังเริ่มทำงาน...",
|
||||
"session.status.writingResponse": "กำลังเขียนคำตอบ...",
|
||||
"session.status.retry": "กำลังลองใหม่…",
|
||||
"session.status.retrying": "กำลังลองใหม่ (ครั้งที่ {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -939,6 +939,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code bir yapay zeka kodlama asistanıdır. Özellik geliştirmesini, hata düzeltmesini veya kod tabanınızı açıklamasını isteyin.",
|
||||
"session.messages.scrollToBottom": "En alta kaydır",
|
||||
"session.messages.initializing": "Başlatılıyor...",
|
||||
"session.messages.taskStarting": "Başlıyor...",
|
||||
"session.status.writingResponse": "Yanıt yazılıyor...",
|
||||
"session.status.retry": "Yeniden deneniyor…",
|
||||
"session.status.retrying": "Yeniden deneniyor (deneme {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -940,6 +940,8 @@ export const dict = {
|
||||
"session.messages.welcome":
|
||||
"Kilo Code — це асистент з кодування на базі ШІ. Попросіть його розробити функцію, виправити помилку або пояснити вашу кодову базу.",
|
||||
"session.messages.scrollToBottom": "Прокрутити до низу",
|
||||
"session.messages.initializing": "Ініціалізація...",
|
||||
"session.messages.taskStarting": "Запуск...",
|
||||
"session.status.writingResponse": "Пишу відповідь...",
|
||||
"session.status.retry": "Повторна спроба…",
|
||||
"session.status.retrying": "Повторна спроба (спроба {{ attempt }})… {{ message }}",
|
||||
|
||||
+2
@@ -923,6 +923,8 @@ export const dict = {
|
||||
"session.messages.empty": "在下方输入消息以开始对话。",
|
||||
"session.messages.welcome": "Kilo Code 是一个 AI 编程助手。让它帮你构建功能、修复 bug 或解释代码库。",
|
||||
"session.messages.scrollToBottom": "滚动到底部",
|
||||
"session.messages.initializing": "初始化中...",
|
||||
"session.messages.taskStarting": "启动中...",
|
||||
"session.status.writingResponse": "正在撰写回复…",
|
||||
"session.status.retry": "正在重试…",
|
||||
"session.status.retrying": "正在重试(第 {{ attempt }} 次)… {{ message }}",
|
||||
|
||||
+2
@@ -925,6 +925,8 @@ export const dict = {
|
||||
"session.messages.empty": "在下方輸入訊息以開始對話。",
|
||||
"session.messages.welcome": "Kilo Code 是一個 AI 程式設計助手。讓它幫你建構功能、修復 bug 或解釋程式碼庫。",
|
||||
"session.messages.scrollToBottom": "捲動至底部",
|
||||
"session.messages.initializing": "初始化中...",
|
||||
"session.messages.taskStarting": "啟動中...",
|
||||
"session.status.writingResponse": "正在撰寫回覆…",
|
||||
"session.status.retry": "正在重試…",
|
||||
"session.status.retrying": "正在重試(第 {{ attempt }} 次)… {{ message }}",
|
||||
|
||||
@@ -1114,6 +1114,13 @@ export function Session() {
|
||||
scrollAcceleration={scrollAcceleration()}
|
||||
>
|
||||
<box height={1} />
|
||||
{/* kilocode_change start */}
|
||||
<Show when={session()?.parentID && messages().length === 0}>
|
||||
<box paddingLeft={3}>
|
||||
<text fg={theme.textMuted}>↳ Initializing...</text>
|
||||
</box>
|
||||
</Show>
|
||||
{/* kilocode_change end */}
|
||||
<For each={messages()}>
|
||||
{(message, index) => (
|
||||
<Switch>
|
||||
@@ -2064,11 +2071,18 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
||||
if (!props.input.description) return ""
|
||||
let content = [`${Locale.titlecase(props.input.subagent_type ?? "General")} Task — ${props.input.description}`]
|
||||
|
||||
if (isRunning() && tools().length > 0) {
|
||||
// content[0] += ` · ${tools().length} toolcalls`
|
||||
if (current()) content.push(`↳ ${Locale.titlecase(current()!.tool)} ${(current()!.state as any).title}`)
|
||||
else content.push(`↳ ${tools().length} toolcalls`)
|
||||
// kilocode_change start
|
||||
if (isRunning()) {
|
||||
if (tools().length === 0) {
|
||||
content.push(`↳ Starting...`)
|
||||
} else if (current()) {
|
||||
// content[0] += ` · ${tools().length} toolcalls`
|
||||
content.push(`↳ ${Locale.titlecase(current()!.tool)} ${(current()!.state as any).title}`)
|
||||
} else {
|
||||
content.push(`↳ ${tools().length} toolcalls`)
|
||||
}
|
||||
}
|
||||
// kilocode_change end
|
||||
|
||||
if (props.part.state.status === "completed") {
|
||||
content.push(`└ ${tools().length} toolcalls · ${Locale.duration(duration())}`)
|
||||
|
||||
Reference in New Issue
Block a user