Skip to content

Wrong usage color #2019

@sunmy2019

Description

@sunmy2019

What version of Kimi Code CLI is running?

1.37.0

What issue are you seeing?

It uses wrong color in the usage command.

The color is chosen by the remaining ratio:

def _format_row(row: UsageRow, label_width: int) -> RenderableType:
ratio = (row.limit - row.used) / row.limit if row.limit > 0 else 0
color = _ratio_color(ratio)

def _ratio_color(ratio: float) -> str:
if ratio >= 0.9:
return "red"
if ratio >= 0.7:
return "yellow"
return "green"

What is the expected behavior?

+ # remaining ratio is passed in
  def _ratio_color(ratio: float) -> str:
-     if ratio >= 0.9:
+     if ratio <= 0.1:
          return "red"
-     if ratio >= 0.7:
+     if ratio <= 0.3:
        return "yellow"
     return "green"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions