Skip to content

Restrict quota display to macOS due to Keychain OAuth dependency#225

Merged
AnnatarHe merged 1 commit intomainfrom
claude/fix-statusline-quota-linux-Mkdt2
Feb 12, 2026
Merged

Restrict quota display to macOS due to Keychain OAuth dependency#225
AnnatarHe merged 1 commit intomainfrom
claude/fix-statusline-quota-linux-Mkdt2

Conversation

@AnnatarHe
Copy link
Copy Markdown
Contributor

@AnnatarHe AnnatarHe commented Feb 12, 2026

Summary

This PR restricts the quota utilization display feature to macOS only, as it requires Keychain access for OAuth token management. On non-macOS platforms, the quota section is omitted from the statusline output.

Key Changes

  • Added runtime OS detection using runtime.GOOS to conditionally include quota information
  • Modified formatStatuslineOutput() to only append quota part on macOS (darwin)
  • Updated outputFallback() to exclude the quota indicator (🚦) on non-macOS systems
  • Updated test cases to verify correct behavior on both macOS and non-macOS platforms:
    • macOS tests assert presence of quota indicators and emoji
    • Non-macOS tests assert absence of quota emoji

Implementation Details

  • The quota utilization feature (showing 5-hour and 7-day usage percentages) is now gated behind a macOS check
  • Non-macOS systems will display a simplified statusline without the quota section
  • Tests use runtime.GOOS == "darwin" to conditionally verify expected output format
  • Added explanatory comment noting the Keychain/OAuth dependency for the macOS-only restriction

https://claude.ai/code/session_01WFViMSBVF4NRgg9igRsqb3


Open with Devin

Quota data requires macOS Keychain for OAuth token retrieval, so it's
always unavailable on Linux. Remove the section entirely on non-darwin
platforms instead of showing a useless gray dash.

https://claude.ai/code/session_01WFViMSBVF4NRgg9igRsqb3
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AnnatarHe AnnatarHe merged commit 80026a9 into main Feb 12, 2026
2 checks passed
@AnnatarHe AnnatarHe deleted the claude/fix-statusline-quota-linux-Mkdt2 branch February 12, 2026 07:33
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @AnnatarHe, 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 refines the statusline output by making the quota utilization display an exclusive feature for macOS users. This change ensures that the application functions correctly across different operating systems by only enabling features that rely on macOS-specific components, such as Keychain for OAuth token management, where they are supported.

Highlights

  • OS-specific Quota Display: The quota utilization display feature is now restricted to macOS due to its dependency on Keychain for OAuth token management.
  • Conditional Logic Implementation: Runtime OS detection using "runtime.GOOS" was added to conditionally include or omit quota information in the statusline output.
  • Test Case Updates: Existing test cases were updated to verify the correct presence or absence of quota indicators and emojis on macOS and non-macOS platforms, respectively.
Changelog
  • commands/cc_statusline.go
    • Imported the "runtime" package.
    • Modified "formatStatuslineOutput" to conditionally append the quota part only if the operating system is macOS ("darwin").
    • Updated "outputFallback" to display the quota indicator ("🚦") only on macOS, providing a simplified statusline for other operating systems.
  • commands/cc_statusline_test.go
    • Imported the "runtime" package.
    • Adjusted "TestFormatStatuslineOutput_WithQuota" and "TestFormatStatuslineOutput_WithoutQuota" to conditionally assert the presence or absence of quota-related elements based on the detected operating system.
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
Copy Markdown
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 correctly restricts the quota utilization display to macOS systems due to its dependency on Keychain for OAuth token management. The changes are implemented using runtime.GOOS checks in both the main logic and the tests, which is appropriate. I've suggested a small refactoring to improve maintainability in the fallback output function. Overall, the changes are well-implemented and the accompanying documentation updates are clear.

Comment thread commands/cc_statusline.go
Comment on lines +230 to +235
if runtime.GOOS == "darwin" {
quotaPart := wrapOSC8Link(claudeUsageURL, "🚦 -")
fmt.Println(color.Gray.Sprint("🌿 - | 🤖 - | 💰 - | 📊 - | " + quotaPart + " | ⏱️ - | 📈 -%"))
} else {
fmt.Println(color.Gray.Sprint("🌿 - | 🤖 - | 💰 - | 📊 - | ⏱️ - | 📈 -%"))
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and reduce code duplication, you could refactor this function to build a slice of parts and then join them. This approach is already used in formatStatuslineOutput and would make it easier to add or remove parts of the status line in the future.

	parts := []string{"🌿 -", "🤖 -", "💰 -", "📊 -"}
	if runtime.GOOS == "darwin" {
		quotaPart := wrapOSC8Link(claudeUsageURL, "🚦 -")
		parts = append(parts, quotaPart)
	}
	parts = append(parts, "⏱️ -", "📈 -%")
	fmt.Println(color.Gray.Sprint(strings.Join(parts, " | ")))

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
commands/cc_statusline.go 0.00% 6 Missing and 1 partial ⚠️
Flag Coverage Δ
unittests 38.02% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
commands/cc_statusline.go 67.54% <0.00%> (-2.52%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

2 participants