mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
Add Codex multi-agent timeline support (#588)
* checkpoint codex multiagent UI state * fix codex multiagent event scoping * fix: stabilize codex subagent timeline * chore: remove codex subagent nesting prompt * test(web): stabilize tool result rendering tests * fix: collapse codex agent trace rows by default * fix(web): keep chat scrolled to bottom * fix(web): backfill agent-run-heavy message loads * fix(codex): fail stuck subagent spawns * fix(codex): preserve wrapped child event scope * fix(codex): surface agent tool completions
This commit is contained in:
@@ -13,6 +13,10 @@ function calculateContextSize(usage: UsageData): number {
|
||||
return (usage.cache_creation_input_tokens || 0) + (usage.cache_read_input_tokens || 0) + usage.input_tokens
|
||||
}
|
||||
|
||||
function isUsageVisibleInParentContext(usage: UsageData): boolean {
|
||||
return usage.scope_role !== 'child'
|
||||
}
|
||||
|
||||
export type LatestUsage = {
|
||||
inputTokens: number
|
||||
outputTokens: number
|
||||
@@ -98,7 +102,7 @@ export function reduceChatBlocks(
|
||||
let latestUsage: LatestUsage | null = null
|
||||
for (let i = normalized.length - 1; i >= 0; i--) {
|
||||
const msg = normalized[i]
|
||||
if (msg.usage) {
|
||||
if (msg.usage && isUsageVisibleInParentContext(msg.usage)) {
|
||||
latestUsage = {
|
||||
inputTokens: msg.usage.input_tokens,
|
||||
outputTokens: msg.usage.output_tokens,
|
||||
|
||||
Reference in New Issue
Block a user