Skip to content

fix(patch): cherry-pick 54de675 to release/v0.20.0-pr-14961 [CONFLICTS]#14967

Closed
gemini-cli-robot wants to merge 1 commit intorelease/v0.20.0-pr-14961from
hotfix/v0.20.0/0.20.1/stable/cherry-pick-54de675/pr-14961
Closed

fix(patch): cherry-pick 54de675 to release/v0.20.0-pr-14961 [CONFLICTS]#14967
gemini-cli-robot wants to merge 1 commit intorelease/v0.20.0-pr-14961from
hotfix/v0.20.0/0.20.1/stable/cherry-pick-54de675/pr-14961

Conversation

@gemini-cli-robot
Copy link
Collaborator

This PR automatically cherry-picks commit 54de675 to patch version v0.20.0 in the stable release to create version 0.20.1.

⚠️ Merge Conflicts Detected

This cherry-pick resulted in merge conflicts that need manual resolution.

🔧 Next Steps:

  1. Review the conflicts: Check out this branch and review the conflict markers
  2. Resolve conflicts: Edit the affected files to resolve the conflicts
  3. Test the changes: Ensure the patch works correctly after resolution
  4. Update this PR: Push your conflict resolution

📋 Files with conflicts:

The commit has been created with conflict markers for easier manual resolution.

🚨 Important:

  • Do not merge this PR until conflicts are resolved
  • The automated patch release will trigger once this PR is merged

…quota is present. (#14961)

# Conflicts:
#	packages/cli/src/ui/components/StatsDisplay.test.tsx
#	packages/cli/src/ui/components/StatsDisplay.tsx
#	packages/cli/src/ui/components/__snapshots__/StatsDisplay.test.tsx.snap
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gemini-cli-robot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request is an automated cherry-pick that aims to significantly improve the clarity and comprehensiveness of the model statistics display within the CLI. It introduces a more granular breakdown of token usage, distinguishing between uncached input and cache reads, and integrates user quota information directly into the model usage table. These changes provide users with a more precise understanding of their token consumption and remaining allowances, although merge conflicts require manual resolution.

Highlights

  • Refined Token Statistics Display: The display of token usage has been enhanced. 'Prompt' tokens are now labeled 'Input' and represent uncached input, while 'Cached' tokens are now explicitly shown as 'Cache Reads'.
  • Improved Model Usage Table: The ModelUsageTable component has been refactored to dynamically display model usage and quota information, including dedicated columns for 'Cache Reads' and 'Usage left'.
  • Enhanced Quota Integration: User quota information is now more seamlessly integrated into the statistics display, showing 'Usage left' for both actively used and unused models.
  • UI/UX Polish: Minor styling adjustments have been applied to text colors and layout, and some redundant information or tips have been removed from the stats display for a cleaner user experience.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request cherry-picks changes to improve the UI for displaying model and session statistics. The changes include relabeling metrics for clarity (e.g., "Prompt" to "Input", "Cached" to "Cache Reads"), adjusting calculations for token counts, and refactoring the stats table to conditionally display information based on available quota data. However, the cherry-pick has resulted in several unresolved merge conflicts across multiple files, including StatsDisplay.tsx, StatsDisplay.test.tsx, and its snapshot. These conflicts introduce markers like <<<<<<< HEAD into the code, which will cause build failures and must be resolved before this PR can be merged.

Comment on lines +79 to +83
<<<<<<< HEAD
expect(output).not.toContain('Efficiency & Optimizations');
expect(output).not.toContain('Model'); // The table header
=======
>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

Comment on lines +73 to +126
<<<<<<< HEAD
=======
// Logic for building the unified list of table rows
const buildModelRows = (
models: Record<string, ModelMetrics>,
quotas?: RetrieveUserQuotaResponse,
) => {
const getBaseModelName = (name: string) => name.replace('-001', '');
const usedModelNames = new Set(Object.keys(models).map(getBaseModelName));

// 1. Models with active usage
const activeRows = Object.entries(models).map(([name, metrics]) => {
const modelName = getBaseModelName(name);
const cachedTokens = metrics.tokens.cached;
const totalInputTokens = metrics.tokens.prompt;
const uncachedTokens = Math.max(0, totalInputTokens - cachedTokens);
return {
key: name,
modelName,
requests: metrics.api.totalRequests,
cachedTokens: cachedTokens.toLocaleString(),
uncachedTokens: uncachedTokens.toLocaleString(),
totalInputTokens: totalInputTokens.toLocaleString(),
outputTokens: metrics.tokens.candidates.toLocaleString(),
bucket: quotas?.buckets?.find((b) => b.modelId === modelName),
isActive: true,
};
});

// 2. Models with quota only
const quotaRows =
quotas?.buckets
?.filter(
(b) =>
b.modelId &&
VALID_GEMINI_MODELS.has(b.modelId) &&
!usedModelNames.has(b.modelId),
)
.map((bucket) => ({
key: bucket.modelId!,
modelName: bucket.modelId!,
requests: '-',
cachedTokens: '-',
uncachedTokens: '-',
totalInputTokens: '-',
outputTokens: '-',
bucket,
isActive: false,
})) || [];

return [...activeRows, ...quotaRows];
};

>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains several unresolved merge conflicts, starting here. Conflict markers like <<<<<<< HEAD and >>>>>>> must be removed and the conflicts resolved by choosing the correct code from the conflicting branches. This is a critical issue that prevents the PR from being merged.

Comment on lines +154 to +168
<<<<<<< HEAD
}> = ({ models, totalCachedTokens, cacheEfficiency, quotas }) => {
=======
cacheEfficiency: number;
totalCachedTokens: number;
}> = ({ models, quotas, cacheEfficiency, totalCachedTokens }) => {
const rows = buildModelRows(models, quotas);

if (rows.length === 0) {
return null;
}

const showQuotaColumn = !!quotas && rows.some((row) => !!row.bucket);

>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

width="100%"
></Box>

<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

Comment on lines +297 to +375
=======
{rows.map((row) => (
<Box key={row.key}>
<Box width={nameWidth} flexGrow={1}>
<Text color={theme.text.primary} wrap="truncate-end">
{row.modelName}
</Text>
</Box>
<Box
width={requestsWidth}
flexDirection="column"
alignItems="flex-end"
flexShrink={0}
>
<Text
color={row.isActive ? theme.text.primary : theme.text.secondary}
>
{row.requests}
</Text>
</Box>
{!showQuotaColumn && (
<>
<Box
width={uncachedWidth}
flexDirection="column"
alignItems="flex-end"
flexShrink={0}
>
<Text
color={
row.isActive ? theme.text.primary : theme.text.secondary
}
>
{row.uncachedTokens}
</Text>
</Box>
<Box
width={cachedWidth}
flexDirection="column"
alignItems="flex-end"
flexShrink={0}
>
<Text color={theme.text.secondary}>{row.cachedTokens}</Text>
</Box>
<Box
width={outputTokensWidth}
flexDirection="column"
alignItems="flex-end"
flexShrink={0}
>
<Text
color={
row.isActive ? theme.text.primary : theme.text.secondary
}
>
{row.outputTokens}
</Text>
</Box>
</>
)}
<Box
width={usageLimitWidth}
flexDirection="column"
alignItems="flex-end"
>
{row.bucket &&
row.bucket.remainingFraction != null &&
row.bucket.resetTime && (
<Text color={theme.text.secondary} wrap="truncate-end">
{(row.bucket.remainingFraction * 100).toFixed(1)}%{' '}
{formatResetTime(row.bucket.resetTime)}
</Text>
)}
</Box>
</Box>
))}

{cacheEfficiency > 0 && !showQuotaColumn && (
>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

Comment on lines +387 to +392
<<<<<<< HEAD
{models && (
=======

{showQuotaColumn && (
>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

</Text>
</SubStatRow>
</Section>
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

Comment on lines +536 to +543
=======
<ModelUsageTable
models={models}
quotas={quotas}
cacheEfficiency={computed.cacheEfficiency}
totalCachedTokens={computed.totalCachedTokens}
/>
>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This file contains an unresolved merge conflict. Conflict markers like <<<<<<< HEAD must be removed and the conflict resolved before this pull request can be merged.

Comment on lines +148 to +180
<<<<<<< HEAD
=======
exports[`<StatsDisplay /> > Quota Display > renders quota information for unused models 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Session Stats │
│ │
│ Interaction Summary │
│ Session ID: test-session-id │
│ Tool Calls: 0 ( ✓ 0 x 0 ) │
│ Success Rate: 0.0% │
│ │
│ Performance │
│ Wall Time: 1s │
│ Agent Active: 0s │
│ » API Time: 0s (0.0%) │
│ » Tool Time: 0s (0.0%) │
│ │
│ │
│ Model Usage Reqs Usage left │
│ ────────────────────────────────────────────────────────────────────────────────────────────── │
│ gemini-2.5-flash - 50.0% (Resets in 2h) │
│ │
│ Usage limits span all sessions and reset daily. │
│ /auth to upgrade or switch to API key. │
│ │
│ │
│ » Tip: For a full token breakdown, run \`/stats model\`. │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

>>>>>>> 54de67536 (feat(cli): polish cached token stats and simplify stats display when quota is present. (#14961))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This snapshot file contains an unresolved merge conflict. Please resolve the conflict in the source component (StatsDisplay.tsx) and then update the snapshots to reflect the correct output.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Jan 7, 2026
@bdmorgan
Copy link
Collaborator

Hi @gemini-cli-robot, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 15, 2026

Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request.

To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues.

If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding!

@gemini-cli gemini-cli bot closed this Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants