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
+21
View File
@@ -75,6 +75,27 @@ describe('getEventPresentation — limit-reached', () => {
})
})
describe('getEventPresentation — token-count', () => {
it('formats Codex token-count as compact context usage', () => {
const result = getEventPresentation({
type: 'token-count',
info: {
total: {
totalTokens: 23745,
inputTokens: 23631,
cachedInputTokens: 18176,
outputTokens: 114,
reasoningOutputTokens: 0
},
modelContextWindow: 258400
}
})
expect(result.icon).toBe('◷')
expect(result.text).toBe('Context 23.6k / 258.4k (9%) · out 114 · cached 18.2k')
})
})
describe('formatResetTime', () => {
it('formats a unix timestamp to a non-empty string', () => {
const result = formatResetTime(1774278000)