Skip to content

Fix Gemini Plus plan display from loadCodeAssist paidTier#1980

Merged
steipete merged 5 commits into
steipete:mainfrom
Yuxin-Qiao:fix/gemini-plus-plan-display
Jul 9, 2026
Merged

Fix Gemini Plus plan display from loadCodeAssist paidTier#1980
steipete merged 5 commits into
steipete:mainfrom
Yuxin-Qiao:fix/gemini-plus-plan-display

Conversation

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor

Summary

Fixes #1972.

Google AI Pro/Ultra consumer accounts still report loadCodeAssist.currentTier.id == free-tier, so CodexBar was labeling paid Gemini subscribers as Free.

This mirrors Gemini CLI setup behavior and prefers paidTier.name from the loadCodeAssist response when mapping the displayed plan for personal free-tier accounts.

Changes

  • Parse paidTier.name from loadCodeAssist in GeminiStatusProbe
  • Show the consumer subscription label (e.g. Plus, Ultra) instead of Free when present
  • Preserve existing mappings for Paid, Workspace, Free, Legacy, and blank plan states
  • Add fixture-backed regression test and update docs/gemini.md
  • Move plan-resolution helpers into a private extension to satisfy SwiftLint type_body_length

Testing

  • swift test --filter GeminiStatusProbePlanTests (9/9 passed)
  • swiftlint --strict on changed files
  • swiftformat on changed files

Made with Cursor

Consumer Gemini accounts (Google AI Pro/Ultra) still report currentTier
free-tier. Mirror Gemini CLI setup and prefer paidTier.name for the
displayed plan so Plus subscribers are not labeled Free.

Fixes steipete#1972

Co-authored-by: Cursor <cursoragent@cursor.com>
@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:22 AM ET / 06:22 UTC.

Summary
This PR parses and prefers Gemini loadCodeAssist.paidTier.name for account-plan display, preserves Gemini paid-plan casing in CLI/menu output, and adds focused provider, CLI, menu, docs, and changelog coverage.

Reproducibility: no. high-confidence live reproduction for the exact reporter free-tier Plus payload is available. Current main source shows the Free fallback path, and the PR adds focused fixtures plus live paid-account proof for the paidTier.name signal.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #1972
Summary: This PR is the candidate fix for the open Gemini Plus-as-Free plan display issue; the OAuth recovery PR is adjacent Gemini work, not the same root cause.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The exact reporter free-tier Plus live payload has not been posted; that specific shape is covered by fixtures and source inspection, while the contributor's live proof verifies the same paidTier.name signal on a paid account.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow paidTier-name mapping after ordinary maintainer review and CI, preserving the existing Free, Workspace, Paid, Legacy, and blank fallbacks when Google does not send a paid-tier name.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is needed; the PR has no review findings and the remaining action is ordinary maintainer review and CI completion.

Security
Cleared: The diff changes Gemini response parsing, display formatting, tests, docs, and release notes; it adds no dependency, workflow, credential-storage, or supply-chain surface.

Review details

Best possible solution:

Land the narrow paidTier-name mapping after ordinary maintainer review and CI, preserving the existing Free, Workspace, Paid, Legacy, and blank fallbacks when Google does not send a paid-tier name.

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

No high-confidence live reproduction for the exact reporter free-tier Plus payload is available. Current main source shows the Free fallback path, and the PR adds focused fixtures plus live paid-account proof for the paidTier.name signal.

Is this the best way to solve the issue?

Yes. Preferring Google's paidTier.name when present is the narrowest maintainable fix, and the PR keeps the established fallback mappings documented and tested.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fc86568d15ff.

Label changes

Label justifications:

  • P2: This is a bounded Gemini provider plan-display bug with limited blast radius and no evidence of data loss, security impact, or runtime unavailability.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The contributor posted redacted live loadCodeAssist output plus after-fix CLI output showing the displayed plan changing from generic Paid to the Google One AI Pro paid-tier label.
  • proof: sufficient: Contributor real behavior proof is sufficient. The contributor posted redacted live loadCodeAssist output plus after-fix CLI output showing the displayed plan changing from generic Paid to the Google One AI Pro paid-tier label.
Evidence reviewed

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the generic Gemini plan mapping in the latest released baseline to the v0.41.0 integration commit, and recent commits by this handle touch Gemini helper and provider behavior. (role: recent area contributor and release integrator; confidence: high; commits: a83a83fa4131, 4c2ede08b80d, 04a78708b19a; files: Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift, Tests/CodexBarTests/GeminiStatusProbePlanTests.swift, docs/gemini.md)
  • 381181295: GitHub commit metadata maps the original loadCodeAssist plan-detection commit to this handle, including the Paid | Workspace | Free | Legacy | blank mapping this PR extends. (role: introduced plan detection behavior; confidence: high; commits: 3b4003f31769; files: Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift, Tests/CodexBarTests/GeminiStatusProbePlanTests.swift)
  • Yuxin-Qiao: This handle authored recent merged Gemini consumer-tier migration work touching the same provider and docs area, so they have relevant history beyond proposing this PR. (role: recent adjacent contributor; confidence: medium; commits: 63c69fdcc47f; files: Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift, Tests/CodexBarTests/GeminiConsumerTierMigrationTests.swift, docs/gemini.md)
  • devYRPauli: Recent current-main Gemini quota/probe work changed fallback behavior when Pro quota is absent, adjacent to displayed Gemini plan and metric behavior. (role: recent Gemini probe contributor; confidence: medium; commits: b5d4e27342f3; files: Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (4 earlier review cycles)
  • reviewed 2026-07-08T02:27:08.324Z sha b8a40a1 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-08T03:26:17.690Z sha b8a40a1 :: needs real behavior proof before merge. :: [P2] Honor paidTier.name for standard-tier accounts
  • reviewed 2026-07-08T04:05:47.897Z sha fec0b0b :: needs changes before merge. :: [P3] Document standard-tier paid tier names
  • reviewed 2026-07-08T05:44:11.300Z sha 16f882a :: needs maintainer review before merge. :: none

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8a40a1f93

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/Gemini/GeminiStatusProbe.swift
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Jul 8, 2026
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Live behavior proof (contributor account, redacted)

Contributor has an active Google One AI Pro subscription. Captured from the contributor machine on 2026-07-08 (tokens/project IDs redacted).

loadCodeAssist (live)

{
  "currentTier": {
    "id": "standard-tier",
    "name": "Gemini Code Assist"
  },
  "paidTier": {
    "id": "g1-pro-tier",
    "name": "Gemini Code Assist in Google One AI Pro"
  },
  "cloudaicompanionProject": "dari***"
}

CodexBar output (current main + this PR branch)

Account: yxqiao46@gmail.com
Plan: Paid

Interpretation

  • This contributor account is standard-tier, so it already maps to Paid on current main and is not the #1972 failure path (free-tier mislabeled as Free).
  • It still confirms Google's live loadCodeAssist response includes a real paidTier object with a human-readable name, matching the fixture shape used in this PR and Gemini CLI setup (paidTier?.name ?? currentTier.name).
  • #1972 targets consumer Google AI Plus accounts that report currentTier.id == free-tier while paidTier.name is a consumer label such as Plus; the added fixture test covers that path.

Upstream contract reference

Gemini CLI setup uses the same precedence:

userTierName: loadRes.paidTier?.name ?? loadRes.currentTier.name

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Live proof after standard-tier + paidTier.name fix

Pushed commit fec0b0bresolveAccountPlan now honors paidTier.name for standard-tier (aligns with Gemini CLI paidTier?.name ?? currentTier.name).

CLI (CodexBarCLI usage --provider gemini, contributor account)

Account: yxqiao46@gmail.com
Plan: Gemini Code Assist In Google One Ai Pro

Before: Plan: Paid (generic fallback for standard-tier)

Unit test

uses paid tier name for standard tier subscriptions — asserts Gemini Code Assist in Google One AI Pro from mocked loadCodeAssist.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 8, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Maintainer proof for exact head 21c3cfb2f1078d4a51f7ded7ee0671944e57ac0e:

  • Deep review: synced current main; inspected the complete loadCodeAssistGeminiStatusSnapshot → menu/CLI presentation path and Gemini CLI precedence. The final mapping prefers a non-empty paidTier.name even when currentTier is free, unknown, missing, or accompanied by a hosted-domain claim; existing Paid, Workspace, Free, Legacy, and blank fallbacks remain intact.
  • Presentation repair: Gemini CLI plan output now preserves upstream acronym/word casing (AI, lowercase in) instead of applying whole-string capitalization. Menu-card and CLI outputs are both regression-covered.
  • Focused: swift test --filter "GeminiStatusProbePlanTests|GeminiMenuCardTests|CLISnapshotTests" — 55 tests passed.
  • Static gates: make check — SwiftFormat clean; SwiftLint 0 violations.
  • Full suite: make test — all 49 shards passed.
  • Autoreview: clean; no accepted/actionable findings (confidence 0.94).
  • Package: exact source built as com.steipete.codexbar.debug, signed by Developer ID Application Peter Steinberger (Y5PE65HELJ), and accepted by codesign --verify --deep --strict plus spctl. CLI SHA-256: a9aaa0af7abb27741f3089c108ecc35768fce8c285e2d487b124b14b9088caea.
  • Live boundary: the contributor's redacted real Google One AI Pro response establishes the live paidTier.name signal. This host has Gemini CLI 0.46.0 but no Gemini OAuth session; the exact signed CLI therefore live-verified the honest not-logged-in path, not a fabricated paid account. Exact-head network fixtures verify the real response shape through parser, snapshot, menu, CLI text, and card badge without credentials.
  • Public Model Identifier Gate: PASS. No public model identifier was added or changed.
  • Dependencies: unchanged.

CI is running against this exact head. The addressed standard-tier review thread is resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21c3cfb2f1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1178 to +1179
guard let paidTier = json["paidTier"] as? [String: Any],
let rawName = paidTier["name"] as? String

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve paid-tier signals when names are omitted

When loadCodeAssist returns a paidTier object that has an id but no name, this parser returns nil, so resolveAccountPlan falls through to currentTier and can still display a paid consumer account as Free when currentTier.id is free-tier. Preserve paidTier.id or at least the presence of paidTier as a paid fallback when the specific display name is absent.

Useful? React with 👍 / 👎.

@steipete steipete merged commit 6517892 into steipete:main Jul 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemini plan displayed incorrectly

2 participants