feat(tui): add developer debug bar (#38359)

This commit is contained in:
James Long 2026-07-22 14:35:28 -04:00 committed by GitHub
commit 8a36abd328
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 554 additions and 193 deletions

View file

@ -762,23 +762,6 @@ export function Session() {
options.format === "markdown"
? formatSessionTranscript(sessionData, messages(), options.thinking)
: await (async () => {
if (options.debug) {
const events: { readonly created: number }[] = []
for await (const event of client.api.session.log({ sessionID: sessionData.id, follow: false })) {
if (event.type !== "log.synced") events.push(event)
}
// Durable events stay in aggregate order even when their wall-clock timestamps differ.
client.connection.internal.history().forEach((event) => {
const index = events.findIndex((item) => item.created > event.created)
if (index === -1) {
events.push(event)
return
}
events.splice(index, 0, event)
})
return JSON.stringify({ info: sessionData, events }, null, 2) + EOL
}
const messages: unknown[] = []
let cursor: string | undefined
do {