MoonshotAI / MoonshotAI/kimi-code

feat: configurable footer line 2 & expose plan quotas (weekly/5h) to status_line.command

Open
#2,435 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Summary

Follow-up to #2255 (shipped in 0.30.0, thanks @he-yufeng!). While building a custom
footer with [status_line] I ran into three gaps. All are about making the footer
fully customizable for status_line.command users.

1. Footer line 2 is hardcoded and cannot be hidden

status_line.items / status_line.command only control line 1. Line 2's
right side is always formatContextStatus(state.contextUsage, state.contextTokens, state.maxContextTokens) (see FooterComponent.render), with no way to hide or
customize it.

Once a user renders their own context bar via status_line.command, the built-in
context: 45% (114k/256k) on line 2 shows the same data twice.

Ask: a way to hide or reconfigure line 2, e.g.

[status_line]
line2 = false            # hide the second footer line entirely
# or make context a slot: items = [...], line2_items = ["context"]

2. statusLinePayload does not include plan quotas

Current payload (from statusLinePayload() in the footer component):

{ "model", "cwd", "gitBranch", "permissionMode", "planMode",
  "contextUsage", "contextTokens", "maxContextTokens", "sessionId", "version" }

The managed-plan quotas shown by /usage and on footer line 2 (e.g. 25% wk · 4% 5h)
are not exposed, so command scripts cannot render them. The data already exists
client-side via GET https://api.kimi.com/coding/v1/usages
(IOAuthService.getManagedUsage{ summary, limits[], extraUsage },
rows shaped { name, window, used, limit, resetAt }).

Ask: include a quota snapshot in the payload, e.g.

"quota": {
  "weekly": { "used": 37, "limit": 100, "resetAt": "..." },
  "limits": [ { "windowMinutes": 300, "used": 11, "limit": 100, "resetAt": "..." } ]
}

3. A refresh-interval setting for quota data

Quota values change slowly (per-minute granularity is plenty), but
status_line.command runs every second and must stay under 300ms — far too tight
for an HTTP call per run. If the engine polls quotas itself and serves a cached
snapshot to the payload, scripts stay fast and the API stays calm.

Ask: something like

[status_line]
quota_refresh_seconds = 120   # engine-side quota poll interval; 0 disables

Current workaround (fragile)

My script reads ~/.kimi-code/credentials/kimi-code.json, calls
/coding/v1/usages directly, and caches the result for 2 minutes with a
detached refresher. It works, but it re-implements auth and depends on internal
file formats — hence this request.

Environment

  • kimi-code v0.31.0
  • macOS (darwin arm64)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with FooterComponent.render and statusLinePayload(), then trace IOAuthService.getManagedUsage and the /coding/v1/usages response shape. Review the existing status_line configuration and footer tests or entry points before deciding how line 2, quota data, and refresh timing should fit together. Done means the configuration and payload behavior are implemented with cached quota data while status_line.command remains responsive.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.