fix(codex): improve web rendering for Codex events (#544)

* test(codex): add web event rendering harness

* fix(codex): surface plan updates in web

* fix(codex): render MCP tool calls in web

* fix(codex): improve terminal and context display

* fix(codex): format token usage events

* fix(codex): show status context in web

* fix(codex): preserve tool result errors
This commit is contained in:
CoColate
2026-04-29 17:22:45 +08:00
committed by GitHub
parent a612be50d6
commit e76738aa5a
27 changed files with 1138 additions and 15 deletions
+5
View File
@@ -7,6 +7,9 @@ import { reduceTimeline } from '@/chat/reducerTimeline'
// Calculate context size from usage data
function calculateContextSize(usage: UsageData): number {
if (typeof usage.context_tokens === 'number') {
return usage.context_tokens
}
return (usage.cache_creation_input_tokens || 0) + (usage.cache_read_input_tokens || 0) + usage.input_tokens
}
@@ -16,6 +19,7 @@ export type LatestUsage = {
cacheCreation: number
cacheRead: number
contextSize: number
contextWindow: number | null
timestamp: number
}
@@ -101,6 +105,7 @@ export function reduceChatBlocks(
cacheCreation: msg.usage.cache_creation_input_tokens ?? 0,
cacheRead: msg.usage.cache_read_input_tokens ?? 0,
contextSize: calculateContextSize(msg.usage),
contextWindow: msg.usage.context_window ?? null,
timestamp: msg.createdAt
}
break