mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user