mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(cli): prevent data-loss in TUI transcript copy/export on SDK error
Both the copy and export handlers now pass `{ throwOnError: true }` to
`sdk.client.session.messages()` and drop the `?? []` fallback, so a failed
fetch (404/400/network) throws into the existing catch block and surfaces an
error toast instead of silently writing/returning an empty transcript.
This commit is contained in:
@@ -980,8 +980,8 @@ export function Session() {
|
||||
const sessionData = session()
|
||||
if (!sessionData) return
|
||||
// kilocode_change start - fetch all messages from server instead of truncated sync store
|
||||
const allMessages = await sdk.client.session.messages({ sessionID: sessionData.id })
|
||||
const sessionMessages = (allMessages.data ?? []).map((msg) => ({
|
||||
const allMessages = await sdk.client.session.messages({ sessionID: sessionData.id }, { throwOnError: true })
|
||||
const sessionMessages = allMessages.data.map((msg) => ({
|
||||
info: msg.info,
|
||||
parts: msg.parts,
|
||||
}))
|
||||
@@ -1031,8 +1031,8 @@ export function Session() {
|
||||
if (options === null) return
|
||||
|
||||
// kilocode_change start - fetch all messages from server instead of truncated sync store
|
||||
const allMessages = await sdk.client.session.messages({ sessionID: sessionData.id })
|
||||
const sessionMessages = (allMessages.data ?? []).map((msg) => ({
|
||||
const allMessages = await sdk.client.session.messages({ sessionID: sessionData.id }, { throwOnError: true })
|
||||
const sessionMessages = allMessages.data.map((msg) => ({
|
||||
info: msg.info,
|
||||
parts: msg.parts,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user