feat(gateway): add opt-in tokens_in/tokens_out/effort runtime footer fields - #83553
Open
vanhci wants to merge 1 commit into
Open
feat(gateway): add opt-in tokens_in/tokens_out/effort runtime footer fields#83553vanhci wants to merge 1 commit into
vanhci wants to merge 1 commit into
Conversation
…fields Extend display.runtime_footer with token-count and reasoning-effort fields: - tokens_in / tokens_out: compact k-formatted (15.9k) per-turn token usage - effort: agent reasoning effort label from agent.reasoning_effort - context_pct now renders as 'ctx N%' (aligns with cc-connect style) - Feishu renders the footer as a card-style quote block (divider + '> ') instead of plain inline text All new fields are opt-in: the default field set is unchanged. Related: NousResearch#19922, NousResearch#17592, NousResearch#64526, NousResearch#28978
Contributor
feat(gateway): add opt-in tokens_in/tokens_out/effort runtime footer fields
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Extends the gateway runtime footer (
display.runtime_footer.fields) with three opt-in metadata fields:tokens_in,tokens_out, andeffort. Also improvescontext_pctrendering and gives Feishu a card-style footer.Related Issue
This PR complements those: it exposes tokens/effort as opt-in footer fields (not auto-appended), and is the only one covering per-platform card rendering for Feishu.
Type of Change
Changes Made
gateway/runtime_footer.py:_fmt_tokens(n)— compact token formatting (15932 -> 15.9k,28 -> 28)format_runtime_footer/build_footer_lineaccepttokens_in,tokens_out,effort; new field branches renderin 15.9k,out 1.2k,effort:highcontext_pctnow renders asctx 12%(cc-connect style)gateway/run.py:tokens_in(last_prompt_tokens),tokens_out(output_tokens),effort(agent.reasoning_effort) into the footer builder---+>) so it reads as a metadata card instead of inline textHow to Test
display.runtime_footer.enabled: trueandfields: [model, context_pct, tokens_in, tokens_out, effort]in configdeepseek-v4-flash · ctx 12% · in 15.9k · out 1.2k · effort:highChecklist
Code
pytest tests/ -qand all tests pass — full suite blocked by local env (Python 3.9 vs 3.11 requirement); footer logic verified directly via unit invocationDocumentation & Housekeeping
gateway/runtime_footer.pycli-config.yaml.example— N/A (no new config keys; reuses existing runtime_footer fields)