mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(cli): export all messages from TUI instead of truncated store
The TUI's copy and export actions only included ~100 messages because they read from the in-memory sync store which caps at 100 for display performance. Now both actions fetch all messages directly from the server API.
This commit is contained in:
@@ -979,10 +979,16 @@ export function Session() {
|
||||
try {
|
||||
const sessionData = session()
|
||||
if (!sessionData) return
|
||||
const sessionMessages = messages()
|
||||
// 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) => ({
|
||||
info: msg.info,
|
||||
parts: msg.parts,
|
||||
}))
|
||||
const transcript = formatTranscript(
|
||||
sessionData,
|
||||
sessionMessages.map((msg) => ({ info: msg, parts: sync.data.part[msg.id] ?? [] })),
|
||||
sessionMessages,
|
||||
// kilocode_change end
|
||||
{
|
||||
thinking: showThinking(),
|
||||
toolDetails: showDetails(),
|
||||
@@ -1010,7 +1016,6 @@ export function Session() {
|
||||
try {
|
||||
const sessionData = session()
|
||||
if (!sessionData) return
|
||||
const sessionMessages = messages()
|
||||
|
||||
const defaultFilename = `session-${sessionData.id.slice(0, 8)}.md`
|
||||
|
||||
@@ -1025,9 +1030,17 @@ 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) => ({
|
||||
info: msg.info,
|
||||
parts: msg.parts,
|
||||
}))
|
||||
|
||||
const transcript = formatTranscript(
|
||||
sessionData,
|
||||
sessionMessages.map((msg) => ({ info: msg, parts: sync.data.part[msg.id] ?? [] })),
|
||||
sessionMessages,
|
||||
// kilocode_change end
|
||||
{
|
||||
thinking: options.thinking,
|
||||
toolDetails: options.toolDetails,
|
||||
|
||||
Reference in New Issue
Block a user