Skip to content

/status should report context window usage (used / max KB + percentage) #100

Description

@vokasug

Summary

The /status slash command (available in Telegram and other IM bridges) currently shows routing/binding info but no information about how full the current session's context window is. Users have no easy way to tell when a /new (or /clear) is advisable before the model starts forgetting things or refusing turns.

Current behavior

/status output (from ChannelSlashCommandHandler.handleStatus, daemon.js ~line 354157):

Platform: telegram
Chat: p2p (<chatId>)
Client: (default)
Agent: mavis
Strategy: root
Rule: (default)
Status: active
Session: mvs_xxx
Pinned: no

There is no signal about context consumption.

Proposed change

Add context usage to the /status reply, e.g.:

Context: 38.2k / 200.0k tokens (19%)

(k/M formatting for readability. Numbers from whatever the runtime already tracks for input-token accounting — no need to invent new metrics.)

Why it matters

  • Users running long sessions in Telegram have no warning before context fills up.
  • It pairs naturally with /new / /clear — same chat, two complementary controls.
  • Useful for support and debugging "the bot forgot what we said 10 messages ago" reports.

Acceptance criteria

  • /status in Telegram (and Feishu, etc.) shows Context: <used> / <max> (<percent>%) when a session is bound.
  • When usage data isn't available, the line is omitted (no error, no fake zero).
  • No regression in existing /status lines.

Environment

  • Mavis Code (macOS), latest.
  • Telegram bridge, root session strategy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions