mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
fix: address remaining PR review findings
This commit is contained in:
+4
-1
@@ -267,15 +267,17 @@ class SessionController(
|
||||
}
|
||||
|
||||
private fun dispatch(data: Dispatch, send: suspend (String) -> Unit) {
|
||||
assertEdt()
|
||||
capture("Conversation Send Clicked", sessionProps(sid ?: ref?.key) + mapOf(
|
||||
"source" to data.source,
|
||||
"hasExistingSession" to data.exists.toString(),
|
||||
"textLength" to bucket(data.text),
|
||||
) + data.props)
|
||||
showSession()
|
||||
val pending = sid?.let { CompletableDeferred(it) } ?: session()
|
||||
cs.launch {
|
||||
try {
|
||||
val id = sid ?: session().await() ?: return@launch
|
||||
val id = pending.await() ?: return@launch
|
||||
send(id)
|
||||
capture("Conversation Message", sessionProps(id) + mapOf("source" to data.source, "hasExistingSession" to data.exists.toString()) + data.props)
|
||||
LOG.debug { "${ChatLogSummary.sid(id)} kind=${data.kind} dispatched=true" }
|
||||
@@ -294,6 +296,7 @@ class SessionController(
|
||||
}
|
||||
|
||||
private fun session(): CompletableDeferred<String?> {
|
||||
assertEdt()
|
||||
val pending = creating
|
||||
if (pending != null) return pending
|
||||
val next = CompletableDeferred<String?>()
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ session.permission.title=طلب إذن
|
||||
session.permission.meta=الأداة: {0} • الأنماط: {1}
|
||||
session.permission.allow=سماح
|
||||
session.permission.deny=رفض
|
||||
session.question.dismiss=رفض
|
||||
session.question.dismiss=إغلاق
|
||||
|
||||
session.status.considering=جار التفكير في الخطوات التالية…
|
||||
session.status.thinking=جار التفكير…
|
||||
|
||||
+4
-4
@@ -89,7 +89,7 @@ model.picker.free=무료
|
||||
model.picker.reset=모델을 기본값으로 재설정
|
||||
reasoning.picker.tooltip=추론 노력 선택
|
||||
|
||||
history.tab.local=로컈
|
||||
history.tab.local=로컬
|
||||
history.tab.cloud=클라우드
|
||||
history.back=뒤로
|
||||
history.search.placeholder=세션 검색
|
||||
@@ -98,8 +98,8 @@ history.loading=로딩 중…
|
||||
history.untitled=제목 없음
|
||||
history.delete.text=삭제
|
||||
history.delete.confirm.title=세션을 삭제하시겠습니까?
|
||||
history.delete.confirm.message=로컈 기록에서 "{0}"을 삭제하시겠습니까?
|
||||
history.delete.confirm.message.multiple=로컈 기록에서 {0}개의 세션을 삭제하시겠습니까?
|
||||
history.delete.confirm.message=로컬 기록에서 "{0}"을 삭제하시겠습니까?
|
||||
history.delete.confirm.message.multiple=로컬 기록에서 {0}개의 세션을 삭제하시겠습니까?
|
||||
history.rename.title=세션 이름 바꾸기
|
||||
history.rename.prompt=새 세션 이름:
|
||||
history.cloud.load.more=더 불러오기
|
||||
@@ -115,7 +115,7 @@ history.time.hours={0}시간 전
|
||||
history.time.days={0}일 전
|
||||
history.time.months={0}개월 전
|
||||
history.time.years={0}년 전
|
||||
history.error.local=로컈 기록을 로드하지 못했습니다
|
||||
history.error.local=로컬 기록을 로드하지 못했습니다
|
||||
history.error.cloud=클라우드 기록을 로드하지 못했습니다
|
||||
history.error.local.delete=세션을 삭제하지 못했습니다
|
||||
history.error.local.rename=세션의 이름을 바꾸지 못했습니다
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ feedback.dialog.message=Geri bildiriminizi almaktan veya yaşadığınız sorunl
|
||||
feedback.dialog.github=GitHub'da sorun bildirin
|
||||
feedback.dialog.discord=Discord topluluğumuza katılın
|
||||
feedback.dialog.support=Müşteri Desteği
|
||||
session.scroll.bottom=En alta kaýr
|
||||
session.scroll.bottom=En alta kaydır
|
||||
session.copy.hover=Kopyala
|
||||
session.copy.copied=Kopyalandı
|
||||
session.tab.new=Yeni oturum
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ session.error.compact=Помилка стиснення сесії
|
||||
session.error.unknown=Невідома помилка
|
||||
|
||||
session.header.tokens=Токени
|
||||
session.header.tokens.description=Токени, використані останній відповід䍎ю асистента: вхід, вихід, запис у кеш і читання з кешу.
|
||||
session.header.tokens.description=Токени, використані останньою відповіддю асистента: вхід, вихід, запис у кеш і читання з кешу.
|
||||
session.header.input=вхід {0}
|
||||
session.header.output=вихід {0}
|
||||
session.header.cache.write=запис у кеш {0}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
session.connection.connecting=載入中…
|
||||
session.connection.error.app=連線失敗
|
||||
session.connection.error.workspace=工作區載入失敗
|
||||
session.connection.error.unknown=未知預設
|
||||
session.connection.error.unknown=未知錯誤
|
||||
session.connection.retry=重試
|
||||
session.connection.warning.config=設定警告
|
||||
|
||||
@@ -21,7 +21,7 @@ session.tab.new=新建工作階段
|
||||
session.tab.untitled=未命名的工作階段
|
||||
|
||||
session.permission.title=權限請求
|
||||
session.permission.meta=工具:{0} • 樣式:{1}
|
||||
session.permission.meta=工具:{0} • 模式:{1}
|
||||
session.permission.allow=允許
|
||||
session.permission.deny=拒絕
|
||||
session.question.dismiss=關閉
|
||||
|
||||
+2
-7
@@ -6,7 +6,6 @@ import ai.kilocode.rpc.dto.KiloAppStatusDto
|
||||
import ai.kilocode.rpc.dto.ModelDto
|
||||
import ai.kilocode.rpc.dto.ModelStateDto
|
||||
import ai.kilocode.rpc.dto.ProviderDto
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
|
||||
class SessionCreationTest : SessionControllerTestBase() {
|
||||
|
||||
@@ -44,15 +43,13 @@ class SessionCreationTest : SessionControllerTestBase() {
|
||||
assertEquals("ses_test", rpc.prompts[1].first)
|
||||
}
|
||||
|
||||
fun `test concurrent first prompts share session creation`() {
|
||||
rpc.createGate = CompletableDeferred()
|
||||
fun `test same-turn first prompts share session creation`() {
|
||||
val m = controller()
|
||||
|
||||
edt {
|
||||
m.prompt("first")
|
||||
m.prompt("second")
|
||||
}
|
||||
rpc.createGate?.complete(Unit)
|
||||
flush()
|
||||
|
||||
assertEquals(1, rpc.creates)
|
||||
@@ -60,15 +57,13 @@ class SessionCreationTest : SessionControllerTestBase() {
|
||||
assertEquals(listOf("first", "second"), rpc.prompts.map { it.third.parts.single().text.toString() }.sorted())
|
||||
}
|
||||
|
||||
fun `test concurrent first prompt and command share session creation`() {
|
||||
rpc.createGate = CompletableDeferred()
|
||||
fun `test same-turn first prompt and command share session creation`() {
|
||||
val m = controller()
|
||||
|
||||
edt {
|
||||
m.prompt("first")
|
||||
m.command("deploy", "prod")
|
||||
}
|
||||
rpc.createGate?.complete(Unit)
|
||||
flush()
|
||||
|
||||
assertEquals(1, rpc.creates)
|
||||
|
||||
-2
@@ -105,7 +105,6 @@ class FakeSessionRpcApi : KiloSessionRpcApi {
|
||||
val imports = mutableListOf<Pair<String, String>>()
|
||||
var creates = 0
|
||||
private set
|
||||
var createGate: CompletableDeferred<Unit>? = null
|
||||
|
||||
data class CloudCall(val directory: String, val cursor: String?, val limit: Int, val gitUrl: String?)
|
||||
data class AttachmentCall(val id: String, val directory: String, val messageId: String, val partId: String, val attachmentKey: String?)
|
||||
@@ -115,7 +114,6 @@ class FakeSessionRpcApi : KiloSessionRpcApi {
|
||||
|
||||
override suspend fun create(directory: String): SessionDto {
|
||||
assertNotEdt("create")
|
||||
createGate?.await()
|
||||
creates++
|
||||
return session
|
||||
}
|
||||
|
||||
@@ -916,7 +916,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||
let efforts = [...adaptiveEfforts]
|
||||
if (model.providerID === "github-copilot") {
|
||||
// kilocode_change start - treat opus-4.8 like opus-4.7
|
||||
if (model.api.id.includes("opus-4.7") || model.api.id.includes("opus-4.8")) {
|
||||
if (["opus-4.7", "opus-4-7", "opus-4.8", "opus-4-8"].some((v) => model.api.id.includes(v))) {
|
||||
efforts = ["medium"]
|
||||
}
|
||||
// kilocode_change end
|
||||
@@ -1206,7 +1206,7 @@ export function options(input: {
|
||||
|
||||
const modelId = input.model.api.id.toLowerCase()
|
||||
// MiniMax's Anthropic interface defaults thinking off, unlike Chat Completions.
|
||||
if (modelId.includes("minimax-m3") && input.model.api.npm === "@ai-sdk/anthropic") {
|
||||
if (modelId.includes("minimax") && input.model.api.npm === "@ai-sdk/anthropic") { // kilocode_change
|
||||
result["thinking"] = { type: "adaptive" }
|
||||
}
|
||||
|
||||
|
||||
@@ -203,6 +203,17 @@ describe("ProviderTransform.options - minimax m3 thinking", () => {
|
||||
}).thinking,
|
||||
).toBeUndefined()
|
||||
})
|
||||
|
||||
test("explicitly enables adaptive thinking for non-M3 anthropic SDK models", () => {
|
||||
const model = createModel("@ai-sdk/anthropic")
|
||||
model.api.id = "MiniMax-M2.7"
|
||||
expect(
|
||||
ProviderTransform.options({
|
||||
model,
|
||||
sessionID: "test-session-123",
|
||||
}).thinking,
|
||||
).toEqual({ type: "adaptive" })
|
||||
})
|
||||
})
|
||||
|
||||
describe("ProviderTransform.options - google thinkingConfig gating", () => {
|
||||
@@ -3277,6 +3288,27 @@ describe("ProviderTransform.variants", () => {
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
|
||||
})
|
||||
|
||||
test("dashed anthropic opus 4.8 only exposes supported adaptive effort", () => {
|
||||
const model = createMockModel({
|
||||
id: "github-copilot/claude-opus-4-8",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "claude-opus-4-8",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/anthropic",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["medium"])
|
||||
expect(result.medium).toEqual({
|
||||
thinking: {
|
||||
type: "adaptive",
|
||||
display: "summarized",
|
||||
},
|
||||
effort: "medium",
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
// kilocode_change start
|
||||
|
||||
Reference in New Issue
Block a user