Skip to content

feat(cli): show ctx used/window pct% in statusline - #1059

Merged
Astro-Han merged 1 commit into
mainfrom
feat/cli-statusline-ctx
Jul 16, 2026
Merged

Astro-Han merged 1 commit into
mainfrom
feat/cli-statusline-ctx

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Replace the bare ctx <remaining> statusline segment with ctx used/window pct%, where used = modelContextWindow - contextRemaining. The segment is omitted entirely until both the window size and the latest contextRemaining are known.

Threads modelContextWindow through the data path:

  • ModelChoice gains contextWindow?: number, populated by listReadyModelChoices via resolveSelectedModelContextWindow.
  • MakaPiTuiInput and MakaPiTranscriptMetadata gain modelContextWindow?: number.
  • cli.ts passes the initial value from context.target; /model switch (both setModelChoice and setModel paths) updates it.

Refs #1053 (seam 4).

Verification

  • npm run build — clean
  • npm test — 369 tests pass (3 new: ctx segment shows/omits correctly)

Replace the bare ctx-remaining statusline segment with
ctx used/window pct%, where used = window - contextRemaining.

Thread modelContextWindow from the connection/model through ModelChoice,
MakaPiTuiInput, and MakaPiTranscriptMetadata so the statusline can compute
the ratio. The segment is omitted until both the window and the latest
contextRemaining are known.
@Astro-Han
Astro-Han merged commit a61d12e into main Jul 16, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the feat/cli-statusline-ctx branch July 25, 2026 15:14
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.

1 participant