hermes - 💡(How to fix) Fix [Feature]: Expand display.runtime_footer to include all variables from /usage [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#19922Fetched 2026-05-05 06:04:21
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1subscribed ×1unsubscribed ×1

Code Example

display:
  runtime_footer:
    enabled: true
    fields: [model, tokens, cost, latency]
RAW_BUFFERClick to expand / collapse

The messaging gateway currently supports an opt-in display.runtime_footer, but it is restricted to model, context_pct, and cwd. Users running multiple agents (different profiles) across Discord/Telegram need to monitor session costs and token usage in real-time without manually running the /usage command after every interaction.

This aligns with the goal of #11701, but proposes a more comprehensive implementation by exposing the full metrics already tracked by the AIAgent.

Proposed Solution

Extend the runtime_footer field logic in gateway/runtime_footer.py to support:

  • tokens (total tokens)
  • in / out (input/output tokens)
  • cache (cache read/write)
  • reasoning (thinking tokens)
  • cost (formatted USD)
  • latency (API response time)
  • api_calls (count for current session)

Implementation Strategy

  1. run_agent.py: Store the last API call duration as last_api_duration.
  2. gateway/run.py: Extract these metrics from agent_result and pass them to the footer builder.
  3. gateway/runtime_footer.py: Update the formatting logic to handle the new keys.

Example Config

display:
  runtime_footer:
    enabled: true
    fields: [model, tokens, cost, latency]

Output Example: gemini-3-flash-preview · 15.2k tokens · ~$0.0150 · 2.4s

extent analysis

TL;DR

To address the need for real-time monitoring of session costs and token usage, extend the runtime_footer field logic to include additional metrics such as tokens, cost, and latency.

Guidance

  • Review the proposed solution and implementation strategy to understand the required changes to run_agent.py, gateway/run.py, and gateway/runtime_footer.py.
  • Update the display.runtime_footer configuration to include the new fields, such as tokens, cost, and latency, as shown in the example config.
  • Verify that the agent_result contains the necessary metrics and that the footer builder correctly handles the new keys.
  • Test the updated implementation with different configurations and agent profiles to ensure compatibility and accuracy.

Example

# gateway/runtime_footer.py
def build_footer(agent_result, config):
    # ...
    if 'tokens' in config['fields']:
        footer += f" · {agent_result['tokens']} tokens"
    if 'cost' in config['fields']:
        footer += f" · ~${agent_result['cost']:.4f}"
    if 'latency' in config['fields']:
        footer += f" · {agent_result['latency']:.1f}s"
    return footer

Notes

The implementation relies on the AIAgent tracking the necessary metrics, and the agent_result containing the required information. Ensure that the run_agent.py and gateway/run.py changes are correctly implemented to store and extract the metrics.

Recommendation

Apply the proposed workaround by extending the runtime_footer field logic to support the additional metrics, as it aligns with the goal of providing real-time monitoring of session costs and token usage.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: Expand display.runtime_footer to include all variables from /usage [1 comments, 2 participants]