Skip to content

refactor(runtime-host): remove redundant TraceTotals from Session traces - #3440

Open
Sun-GLiang wants to merge 1 commit into
apache:mainfrom
Sun-GLiang:refactor/remove-trace-totals
Open

refactor(runtime-host): remove redundant TraceTotals from Session traces#3440
Sun-GLiang wants to merge 1 commit into
apache:mainfrom
Sun-GLiang:refactor/remove-trace-totals

Conversation

@Sun-GLiang

Copy link
Copy Markdown
Contributor

Summary

  • Remove TraceTotals, its helpers, and the redundant aggregate fields from Core, Runtime, Runtime Host, preload, and Desktop trace shapes.
  • Derive each Inspector turn's optional cost from already-aggregated model_call step prices, preserving unpriced, mixed, retry, and explicit-zero semantics without rescanning attempts.
  • Reject legacy page-level and nested-turn totals at the Runtime Host boundary and advance the compatibility epoch from 35 to 36.

Fixes #3389

Verification

  • npm test — all workspace tests passed
  • npm run build:test
  • npm --workspace @maka/desktop run typecheck
  • npm run lint
  • npm run format:check
  • node --test --test-concurrency=1 scripts/protocol-epoch-check.test.mjs — 8 passed
  • node scripts/protocol-epoch-check.mjs --base apache/main --head HEAD — protocol changed and epoch moved 35 → 36
  • git diff --check apache/main...HEAD

Review focus

SESSION_TRACE_SCHEMA_VERSION intentionally remains 1 because this projection is not persisted. Cross-process compatibility is enforced by Runtime Host compatibility epoch 36.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex — issue analysis, implementation, tests, verification, and draft PR preparation.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Sun-GLiang
Sun-GLiang marked this pull request as ready for review August 21, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(runtime-host): remove redundant TraceTotals from Session traces

1 participant