Skip to content

Show cache reuse and sample coverage in session performance - #4413

Open
Yuxin-Qiao wants to merge 1 commit into
steipete:mainfrom
Yuxin-Qiao:feat/session-performance-values
Open

Yuxin-Qiao wants to merge 1 commit into
steipete:mainfrom
Yuxin-Qiao:feat/session-performance-values

Conversation

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor

Session rows currently hide cached-input reuse inside Performance details and first-token coverage in a tooltip. Move cached-input reuse into the existing primary metric strip and show first-token and cache sample counts beside their measurements, following the requested session-performance scope.

The change reuses the existing summaries, selected-range/day filters, translations and responsive layouts. Missing cache records remain unavailable, while measured zero cache reuse displays 0%. Existing median first-token latency, turn duration, whole-turn output, timed-turn count and model/effort details retain their current calculations. Cache reuse is shown once. The patch is limited to the existing view and its regression tests; it adds no scoring or aggregation layer.

Validation:

  • make check: passed, zero lint violations.
  • make test-fast FILTER='SpendSessionPerformanceTests|CostUsageTurnPerformanceTests|CostUsageTurnPerformanceDetailsTests': 31 tests passed.
  • ./Scripts/test.sh --direct-workers 2: all 1,654 discovered selections included in 150 groups; every group passed on the first attempt, with zero retries or timeouts. Execution: 605.4 seconds.
  • Native component renders: English and Simplified Chinese, light/dark, at 736pt and 440pt widths.

Synthetic native component previews for source commit 864db64a7: the fixture includes the session rows, the existing privacy variant and unchanged detail components. These are not installed-app screenshots or real-account/frame-rate evidence. Evidence manifest.

Wide, light (736pt) Compact, dark (440pt)
Synthetic wide session-performance component Synthetic compact session-performance component

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T16:09:54.795963Z 864db64 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

This PR moves cache reuse into the primary session metrics and displays first-token and cache sample coverage beside their measurements.

Example: A Codex session has three timed turns, each with 0.8-second first-token latency and 80% cached input.

  • Before: Cache reuse appears inside Performance details, and first-token coverage appears in a tooltip.
  • After: The primary metrics show 80.0% cached input, 3 / 3 turns with cache data, and First-token samples: 3 / 3.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and follows recorded owner direction, but the required shipped-app proof is not supplied.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Users must expand details to see cache reuse and hover to discover first-token sample coverage.
Reason: The maintainer explicitly requested this presentation change, and the diff provides it without adding collection, scoring, or settings.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR implements the maintainer-requested presentation change, and no definite functional or security defect was found.

Priority: P3
Reviewed head: 864db64a7bb168c22d8c65bd1a235c79927b3d15

Before merge

  • Add real behavior proof - The inspected screenshots exercise SpendSessionRows and SpendSessionPerformanceView through the existing synthetic ImageRenderer test fixture for the reviewed head, showing wide/light and compact/dark results; they do not exercise the shipped app. Add screenshots or a recording from a freshly built app showing the primary cache metric and coverage in both layouts, with private identities, paths, IPs, keys, phone numbers, and non-public endpoints redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Findings

None.

Tests

  • Missing end-to-end proof: Show the changed metrics in a freshly built app's Usage & Spend session view at wide and compact widths; shipped-entry-point behavior and a base-failing/head-passing test run were not demonstrated.
Agent review details

How this fits together

Usage & Spend receives filtered native Codex turn summaries and renders session measurements beneath the existing cost-ranked session headers.

flowchart TD
  A[Native Codex turn observations] --> B[Existing range and day filters]
  B --> C[Session performance summary]
  C --> D[Primary metric strip]
  C --> E[Expandable performance details]
  D --> F[Session row]
  E --> F
Loading

Technical review

Best possible solution:

Expose the existing measurements and coverage in the session view while preserving their calculation, filtering, and billing contracts.

Do we have a high-confidence way to reproduce the issue?

This is an approved presentation improvement rather than a reported defect; current-main source confirms the existing placement of cache reuse and coverage.

Is this the best way to solve the issue?

The narrow move reuses existing summaries, translations, and layouts, removes the replaced cache detail, and avoids the scoring layer the maintainer declined.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6e118bdb5782.

Provenance checked

  • Primary metric strip and expanded cache detail changes intended behavior with a stated reason (70937cc: Organize raw session observations into a primary metric strip and collapsed details while preserving honest coverage and unavailable measurements.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Yuxin Qiao: Raw commit 70937cc adds Sources/CodexBar/SpendSessionPerformanceView.swift:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 70937cc62487; files: Sources/CodexBar/SpendSessionPerformanceView.swift)

Review metrics

Metric Value Why it matters
Scoped code change Production +30/-19 lines; tests +30/-3 lines The small increase supports coverage labels in both existing layouts and a focused zero-versus-missing regression case.

Labels

Label changes:

  • add P3: This is a bounded presentation and discoverability improvement to existing measurements, with no demonstrated urgent regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P3: This is a bounded presentation and discoverability improvement to existing measurements, with no demonstrated urgent regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide fresh-app screenshots or a recording of the changed session metrics in wide and compact layouts.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 10, 2026, 12:10 PM ET / 16:10 UTC.

This branch has not been deployed

No deployments
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