Skip to content

Revert "feat(usage): show the cached subset beside every token total" - #4424

Merged
lidge-jun merged 2 commits into
devfrom
codex/260912-revert-cached-companion
Sep 12, 2026
Merged

Revert "feat(usage): show the cached subset beside every token total"#4424
lidge-jun merged 2 commits into
devfrom
codex/260912-revert-cached-companion

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Reverts #4421 (7b3c4e9800).

The reported defect was Devin-only and did not live in the display layer. The logs table has always rendered a token total with its cached value beneath it; Devin rows showed a bare total because the cloud-direct adapter decoded GetChatMessageResponse field 28 — response_dimension_groups, the rows the IDE draws — instead of field 7, ModelUsageStats. Cache read and cache write never reached the log row at all, so there was nothing for the renderer to show.

#4419 fixes that at the source, and that is the whole fix. Every other provider was already correct.

#4421 instead rewrote the Usage page columns, the dashboard 30-day tile and the CLI usage tables, which were behaving as intended. This revert restores them.

Logs table restored to its original layout, with Devin CLI rows now showing their cached line

The screenshot is the point of the revert: the layout is exactly what it was before #4421, and the two Devin CLI rows now carry c 4만 and c 5.7만 — which they could not before #4419, and which no display change was ever needed to produce. Captured from a build of this branch on a throwaway proxy with its own port and OPENCODEX_HOME.

Verification

  • bun x tsc --noEmit — clean.
  • bun run lint:gui — clean.
  • bun test tests/cli/cli-usage-report.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts — 51 pass, 0 fail; the layout guards confirm the removed test file is deregistered.
  • Live render verified on the throwaway instance above.
  • Full bun run test: NOT RUN locally by request; remote CI on this head is the evidence.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 12, 2026 15:43
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 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-09-12T15:46:22.051800Z b97a72b 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.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft September 12, 2026 15:43
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • devlog/_plan/260912_devin_hardening/logs-devin-cached-restored.jpg is excluded by !**/*.jpg

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4b699e1e-3d0a-4958-842d-a06ff084c940

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 7386d0fb-3fd7-456a-a252-cad3c1422a17

📥 Commits

Reviewing files that changed from the base of the PR and between 1e28e62 and b97a72b.

⛔ Files ignored due to path filters (1)
  • devlog/_plan/260912_devin_hardening/cached-token-companion.jpg is excluded by !**/*.jpg
📒 Files selected for processing (10)
  • gui/src/format-tokens.ts
  • gui/src/pages/Logs.tsx
  • gui/src/pages/Usage.tsx
  • gui/src/pages/dashboard-overview-head.tsx
  • gui/src/pages/dashboard-shared.ts
  • scripts/test-layout/layout.json
  • src/cli/usage-report.ts
  • tests/cli/cli-usage-report.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/gui/gui-format-tokens-cache.test.ts
💤 Files with no reviewable changes (5)
  • gui/src/format-tokens.ts
  • tests/gui/gui-format-tokens-cache.test.ts
  • scripts/test-layout/layout.json
  • tests/cli/cli-usage-report.test.ts
  • tests/fixtures/test-layout-expected.json

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change removes cached-token formatting from GUI and CLI usage views. It removes related fields, helpers, imports, tests, and test-layout mappings. Usage displays now show aggregate token totals only.

Changes

Usage token display

Layer / File(s) Summary
Remove cached-token contracts
gui/src/format-tokens.ts, gui/src/pages/dashboard-shared.ts, gui/src/pages/Usage.tsx, src/cli/usage-report.ts
Removes cached-token formatter functions and cached-token fields from GUI and CLI usage data types.
Update GUI usage views
gui/src/pages/Logs.tsx, gui/src/pages/Usage.tsx, gui/src/pages/dashboard-overview-head.tsx
Formats conversation, model, provider, and 30-day dashboard totals with plain total-token formatters.
Update CLI usage reports and tests
src/cli/usage-report.ts, tests/cli/cli-usage-report.test.ts, tests/gui/gui-format-tokens-cache.test.ts, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json
Removes cached-token suffix rendering and deletes the tests and layout mappings for that behavior.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: invalid-email-address

Merge Risk: ⚪ Minimal · up to b97a7

The change removes cached-token details while preserving aggregate usage totals and their existing display paths. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: reverting the feature that displayed cached-token subsets beside token totals. This matches the changes across the GUI, dashboard, CLI usage report, an…
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260912-revert-cached-companion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 76 / 80

이 PR은 방금 dev에 들어간 #4421(7b3c4e9800, Usage/대시보드/CLI에 캐시 동반 표기)을 통째로 되돌립니다. 지금 HEAD는 1e28e6236(#4419)입니다. #4419가 Devin cloud-direct에서 GetChatMessageResponse 필드 28(IDE 표시용 response_dimension_groups) 대신 필드 7(ModelUsageStats)을 읽어 캐시 읽기/쓰기를 로그 행에 실어 주었습니다. 그래서 Devin 줄이 총량만 보이던 이유는 표시 레이어가 아니라 어댑터가 캐시 숫자를 안 넘긴 것이었습니다. 로그 표 본문 행은 예전부터 cacheSplit으로 c … / w …를 그려 왔고, 다른 프로바이더는 이미 맞게 동작했습니다. #4421은 그 구멍을 Usage 표·대시보드 30일 타일·CLI usage 표·Logs 대화 합계 배너까지 넓혀 고치려다, 이미 맞던 표면까지 다시 썼습니다. 이번 revert는 formatTokensWithCache / countWithCache와 그에 묶인 타입·테스트·plan 스크린샷을 제거하고, 표시를 #4419 이전(정확히는 #4421 직전) 형태로 되돌립니다. 원인 수정(#4419)과 증상 우회(#4421)가 둘 다 HEAD에 겹쳐 있는 상태를 정리하는 유지보수 PR입니다. types/config 분할과 무관하고 중복도 아닙니다.

gui/src/pages/Logs.tsx (대화 합계 배너) - revert 후 배너는 다시 formatTokens(total)만 씁니다. 바로 아래 로그 행은 여전히 c/w를 보여 주므로, 캐시가 많은 대화에서는 배너 숫자와 행 숫자가 다시 “다른 크기”처럼 읽힐 수 있습니다. Devin 결함과는 별개인 UX 차이입니다.

gui/src/pages/Usage.tsx · dashboard-overview-head.tsx · src/cli/usage-report.ts - 캐시 필드 타입과 동반 표기가 빠집니다. #4419 이후 Devin 데이터가 채워져도 Usage/CLI는 총량만 보입니다. “원래 의도한 표면”으로 되돌리는 것이면 맞고, 동반 표기를 제품 기능으로 남기고 싶다면 별 PR로 다시 설계해야 합니다.

devlog/_plan/260912_devin_hardening/cached-token-companion.jpg - plan 증거 이미지도 삭제됩니다. 계획 폴더 정리와 맞으면 문제 없습니다.

enforce-target (CI) - missing UI screenshot으로 품질 게이트가 실패했고, 봇이 draft로 붙잡아 둔 상태입니다. 내용은 GUI를 빼는 revert인데도 스크린샷 규칙이 걸렸습니다. 복원된 Usage/대시보드 한 장이나 면제 경로가 필요합니다.

tests/gui/gui-format-tokens-cache.test.ts · layout.json - 테스트와 layout 등록도 같이 빠져 정합합니다. 로컬로 지정한 usage-report·layout 테스트는 통과했다고 본문에 적혀 있고, 원격 test shard는 이 글을 쓰는 순간 아직 pending입니다.

메인테이너의 판단이 필요한 지점

  • UI 스크린샷 게이트를 복원 화면 한 장으로 통과시킬지, revert라서 면제할지
  • Logs 대화 배너만 캐시 동반을 다시 살리는 작은 후속을 둘지, Usage/CLI까지 제품 기능으로 다시 설계할지
  • #4419만으로 Devin 증상을 닫은 것으로 문서/이슈를 마감할지

너의 추천
합치세요. #4419가 원인을 고친 뒤라 #4421은 잘못 겨냥한 표시 변경이고, 이 revert가 그 정답입니다. 스크린샷(또는 면제)만 처리하고 test shard·gates가 초록이면 바로 dev에 머지하는 쪽을 추천합니다. types/config 무효화·중복 close 대상이 아닙니다.

이 댓글은 grok-bot이 작성했습니다

This reverts 7b3c4e9.

The reported defect was Devin-only and had nothing to do with the display
layer. The logs table has always rendered a total with its cached value;
Devin rows showed a bare total because the cloud-direct adapter decoded
GetChatMessageResponse field 28 (response_dimension_groups, the rows the
IDE draws) instead of field 7 (ModelUsageStats), so cache read and cache
write never reached the log row in the first place. #4419 fixes that at
the source, which is the whole fix.

Changing the Usage page, the dashboard tile and the CLI tables rewrote
surfaces that were already correct for every other provider, so the revert
restores them.
…esent

Evidence for the revert: the logs table layout is exactly what it was before #4421, and the Devin CLI rows now carry their cached line because #4419 reads the usage field that actually holds it.
@lidge-jun
lidge-jun force-pushed the codex/260912-revert-cached-companion branch from b97a72b to 3c3cf42 Compare September 12, 2026 15:54
@github-actions
github-actions Bot marked this pull request as ready for review September 12, 2026 15:54
@lidge-jun
lidge-jun merged commit 27fa557 into dev Sep 12, 2026
30 checks passed
@lidge-jun
lidge-jun deleted the codex/260912-revert-cached-companion branch September 12, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant