Skip to content

Calibrate token accounting and Agent activity - #6

Merged
Backtthefuture merged 4 commits into
mainfrom
codex/token-accounting-agent-activity
Jul 19, 2026
Merged

Calibrate token accounting and Agent activity#6
Backtthefuture merged 4 commits into
mainfrom
codex/token-accounting-agent-activity

Conversation

@Backtthefuture

Copy link
Copy Markdown
Owner

Summary

  • normalize cached/reasoning token buckets and move Codex history to revision 8 cumulative accounting
  • add the source-aware Agent activity dashboard with Today / 7-day views, hourly activity, and cache-coverage-aware metrics
  • protect recalibration migrations and add deterministic fixtures, visual renders, CI gates, and a frozen-history audit

Why

Lifecycle token events, compaction, child-Agent replay, and provider-specific cache semantics could inflate totals or present unknown cache coverage as a real zero. Cross-source proxy matching could also remove independent requests when only their timing and usage looked similar. The previous Agent card mixed unverifiable score/rank/work-time semantics.

Impact

Historical Codex totals may decrease after recalibration, but source logs are preserved. Cache hit rate appears only when coverage is complete. Cross-source records are deduplicated only with a shared request/response ID, or a shared session plus matching time/model/usage. Experimental Hermes/ZCode sources remain local-first and opt-in.

Validation

  • clean staged-snapshot full app and helper build
  • Codex cumulative, CC Switch, migration, Shanghai-calendar, dedupe, and Agent fixtures
  • frozen 608-file history audit: PASS at 4,316,026,634 calibrated Token
  • Swift/Python audit parity including revision, strategy, cache-creation, and token breakdown
  • Simplified Chinese, English, Traditional Chinese, and language-refresh checks
  • Agent card and recalibration notice render checks
  • local SwiftPM XCTest runner is unavailable because the active CommandLineTools has a PackageDescription linker mismatch; GitHub macOS/Xcode CI is enabled

@Backtthefuture
Backtthefuture marked this pull request as ready for review July 19, 2026 23:23
@Backtthefuture
Backtthefuture merged commit 583535d into main Jul 19, 2026
1 check passed
canyexuanfan added a commit to canyexuanfan/TokenStep-Windows that referenced this pull request Jul 31, 2026
镜像同步至 upstream HEAD a44b2e9(PR Backtthefuture#6 + Backtthefuture#7),包含:
- 1b54e5c Calibrate token accounting and Agent activity
  · codexAccountingRevision=8 计量校准
  · 新增 AgentWorkViews/DailyAgentWork 模型
  · 实验来源采集器(ZCode/Hermes/WorkBuddy)
  · 节奏卡底部指标改版(Agent Token/近7日均)
  · tokenToolColor/orderedToolEntries 扩展
- 2f50c67 Recalculate stale accounting on launch
  · UsageSnapshotRefreshPolicy 启动自动校准
  · DataService.requiresImmediateCodexRecalibration

后续将在 windows/ 目录用 Rust+JS 移植跨平台功能。
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.

1 participant