hermes - 💡(How to fix) Fix [Feature Request]: Configurable gateway response metadata/footer hooks [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#17037Fetched 2026-04-29 06:37:42
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Please consider adding a configurable response metadata/footer hook for gateway platforms.

Local deployments often need lightweight observability directly in delivered gateway messages: model name, elapsed time, token usage, cache read/write tokens, context window, provider route, and similar metadata. Today, adding this to platform messages can require patching platform-specific gateway code and the agent/gateway handoff path.

Root Cause

Gateway messages are often the primary user interface for Hermes. A small, configurable observability layer would reduce source patches while making production deployments easier to operate.

Fix Action

Fix / Workaround

Local deployments often need lightweight observability directly in delivered gateway messages: model name, elapsed time, token usage, cache read/write tokens, context window, provider route, and similar metadata. Today, adding this to platform messages can require patching platform-specific gateway code and the agent/gateway handoff path.

Expose response metadata to gateway renderers and allow deployments to configure a footer/template without patching source code.

A deployment should be able to add or remove gateway response metadata using config/templates. Upgrades should not require patches to platform adapters or gateway/run.py just to pass token/cache/context metadata through.

Code Example

gateway:
  response_metadata:
    enabled: true
    platforms:
      feishu:
        footer_template: "{model} · {elapsed}s · ctx {context_window} · cache {cache_read_tokens}/{cache_write_tokens}"

---

gateway:
  message_hooks:
    after_response:
      include_metadata:
        - model
        - provider
        - elapsed_seconds
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_write_tokens
        - context_window
RAW_BUFFERClick to expand / collapse

Summary

Please consider adding a configurable response metadata/footer hook for gateway platforms.

Local deployments often need lightweight observability directly in delivered gateway messages: model name, elapsed time, token usage, cache read/write tokens, context window, provider route, and similar metadata. Today, adding this to platform messages can require patching platform-specific gateway code and the agent/gateway handoff path.

Proposed capability

Expose response metadata to gateway renderers and allow deployments to configure a footer/template without patching source code.

For example:

gateway:
  response_metadata:
    enabled: true
    platforms:
      feishu:
        footer_template: "{model} · {elapsed}s · ctx {context_window} · cache {cache_read_tokens}/{cache_write_tokens}"

Or a more generic hook/template mechanism:

gateway:
  message_hooks:
    after_response:
      include_metadata:
        - model
        - provider
        - elapsed_seconds
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_write_tokens
        - context_window

The exact design can differ. The important part is that the gateway pipeline exposes the relevant metadata and lets platform renderers append or update a footer in a supported way.

Use cases

  • Operational visibility for Feishu/Lark, Slack, Telegram, etc.
  • Debugging cache and context-window behavior from mobile/chat clients
  • Cost-awareness without opening logs or dashboards
  • Enterprise/local deployments that want message-level provenance

Expected outcome

A deployment should be able to add or remove gateway response metadata using config/templates. Upgrades should not require patches to platform adapters or gateway/run.py just to pass token/cache/context metadata through.

Why this matters

Gateway messages are often the primary user interface for Hermes. A small, configurable observability layer would reduce source patches while making production deployments easier to operate.

extent analysis

TL;DR

Implement a configurable response metadata/footer hook for gateway platforms to enable deployments to add observability metadata without patching source code.

Guidance

  • Introduce a response_metadata configuration option in the gateway settings to enable or disable metadata inclusion.
  • Develop a template mechanism, such as footer_template or message_hooks, to allow deployments to customize the metadata format and content.
  • Expose relevant metadata, like model name, elapsed time, and cache read/write tokens, to the gateway renderers.
  • Ensure the solution is extensible to support various platforms, such as Feishu, Slack, and Telegram.

Example

gateway:
  response_metadata:
    enabled: true
    platforms:
      feishu:
        footer_template: "{model} · {elapsed}s · ctx {context_window} · cache {cache_read_tokens}/{cache_write_tokens}"

Notes

The proposed solution should be designed to be flexible and adaptable to different use cases and platforms, without requiring patches to the source code.

Recommendation

Apply a workaround by implementing a configurable response metadata/footer hook, as this will provide the necessary flexibility and observability for deployments without modifying the existing codebase.

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 Request]: Configurable gateway response metadata/footer hooks [1 comments, 2 participants]