Skip to content

feat(gateway): add usage fields to runtime footer - #106079

Open
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:feat/gateway-usage-footer
Open

konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:feat/gateway-usage-footer

Conversation

@konsisumer

Copy link
Copy Markdown
Contributor

What changed and why

Per the contributor's clarification that #11701 is an accepted S5 capability node in #79772, extend the existing opt-in gateway runtime footer with tokens and cost fields. The fields display session token totals and known estimated session cost, respectively; unknown pricing is omitted rather than reported as zero. This reuses the footer's existing per-platform configuration and streaming-safe final delivery path, while retaining the established default fields unchanged.

Configure it with:

display:
  runtime_footer:
    enabled: true
    fields: [tokens, cost, context_pct]

How to test

  • Configure the footer as above and complete a gateway turn with known model pricing; the final response includes compact token and estimated-cost values.
  • Use a model with unknown pricing and verify the token count remains while the cost value is omitted.
  • Run pytest tests/gateway/test_runtime_footer.py -q --timeout=60 (40 passed).

What platforms tested on

  • macOS (local formatter/configuration tests).
  • The shared gateway final-delivery path covers Discord, Telegram, Slack, and other messaging adapters.

Fixes #11701

test verification unavailable: the recorded local test command exited 3

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery area/usage-cost Token accounting, usage reporting, billing, cost tracking area/config Config system, migrations, profiles sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Sep 8, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Related: #79484 (context_usage/session_tokens), #83553 (tokens_in/tokens_out/effort) and #18188 (extended footer metadata) are open PRs adding overlapping runtime_footer fields for #11701. Flagging the cluster so a reviewer can pick one approach rather than merge several.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles area/usage-cost Token accounting, usage reporting, billing, cost tracking comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Persistent usage/cost footer on gateway (Discord, Telegram, Slack) messages

2 participants