Skip to content

fix(codex): meter background and subagent activity - #12

Open
qmarco-be wants to merge 2 commits into
SergioChan:mainfrom
qmarco-be:codex/fix-background-codex-metering
Open

fix(codex): meter background and subagent activity#12
qmarco-be wants to merge 2 commits into
SergioChan:mainfrom
qmarco-be:codex/fix-background-codex-metering

Conversation

@qmarco-be

@qmarco-be qmarco-be commented Sep 5, 2026

Copy link
Copy Markdown

Summary

  • keep Codex snapshot collection running while Codex is backgrounded or the widget is hidden
  • cache the latest Session snapshot and keep the live Codex face on the desktop instead of falling back to an idle global face
  • resolve active subagent rollout metadata back to the root session and include the full Session tree
  • add a persisted Focused / All active setting to the native widget
  • aggregate all recently token-active root Sessions in All active mode, with per-Session model, rate, Context, and child-Agent counts
  • de-duplicate Session trees by session_id so subagent rollouts are never counted as separate roots

Why

The native overlay previously requested codex-snapshot only while a Codex window was frontmost. When Codex moved to the background, collection stopped and the always-visible panel switched to a slow machine-wide snapshot that appeared idle. The single recency-selected Session could also mask concurrent work in another task, including GPT-6 tasks and their subagents.

Focused mode preserves the small existing active-candidate behavior. All active mode reads the same local rollout telemetry and sums every recently active Session tree. Context remains per root because unrelated context-window percentages cannot be meaningfully added.

Validation

  • npm run check
  • focused regression suite: 34/34 passed
  • full suite: 195/197 passed; the two failures are existing timezone-sensitive usage-history fixture expectations under Asia/Shanghai and are outside this change
  • live local probe: correctly reported two simultaneous root Sessions (gpt-5.6-sol and background gpt-6-astra) and attributed 28 child Agents to the GPT-6 root once
  • built, ad-hoc signed, installed, and signature-verified /Applications/Token Widget.app

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

@qmarco-be is attempting to deploy a commit to the t54 labs Team on Vercel.

A member of the Team first needs to authorize it.

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