Skip to content

feat: include model in response usage footer - #56081

Closed
Ghabs95 wants to merge 1 commit into
openclaw:mainfrom
Ghabs95:feat/usage-footer-model
Closed

Ghabs95 wants to merge 1 commit into
openclaw:mainfrom
Ghabs95:feat/usage-footer-model

Conversation

@Ghabs95

@Ghabs95 Ghabs95 commented Mar 27, 2026

Copy link
Copy Markdown

Summary

  • include the actual answering provider/model in the response usage footer
  • pass providerUsed and modelUsed into formatResponseUsageLine
  • keep existing cost/session behavior unchanged

Example

Before:

Usage: 12k in / 970 out

After:

Usage: 12k in / 970 out · model openai-codex/gpt-5.4-mini

With cost enabled:

Usage: 12k in / 970 out · est $0.01 · model openai-codex/gpt-5.4-mini

Why

The runner already knows the actual model/provider that produced the reply at the point where the usage footer is assembled, so surfacing it there is low-risk and more informative than showing tokens alone.

This also avoids relying on router/planner intent: the footer reports the model that actually answered.

Validation

  • local focused smoke test for formatResponseUsageLine
  • repo checks triggered during commit/push completed successfully

Copilot AI review requested due to automatic review settings March 27, 2026 23:59
@greptile-apps

greptile-apps Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds providerUsed and modelUsed as optional parameters to formatResponseUsageLine, surfacing the actual model/provider used in the response usage footer (e.g. Usage: 12k in / 970 out · model openai-codex/gpt-5.4-mini).

  • The change is backward-compatible — the new params are optional and existing callers that omit them get the same output as before.
  • The modelLabel fallback logic correctly handles all partial-data cases (both provided → provider/model, only model → model name, only provider → provider name, neither → empty string).
  • The suffix is now assembled via a template literal, which cleanly composes the cost and model segments in order: · est $X.XX · model provider/model.
  • providerUsed and modelUsed are well-defined at the call site in agent-runner.ts — they're used earlier in the same block for cost resolution and diagnostics, so there's no risk of unexpected undefined leaking in.
  • No existing test files for formatResponseUsageLine were found; the PR relies on a local smoke test.

Confidence Score: 5/5

Safe to merge — the change is a small, well-scoped additive feature with no breaking changes and correct fallback logic.

No P0 or P1 issues found. The new params are optional and backward-compatible, the label construction logic handles all edge cases correctly, and the call site already has the required variables in scope.

No files require special attention.

Important Files Changed

Filename Overview
src/auto-reply/reply/agent-runner-usage-line.ts Adds optional providerUsed/modelUsed params and constructs a model label suffix; logic is correct for all partial-data cases and is backward-compatible.
src/auto-reply/reply/agent-runner.ts Passes already-defined providerUsed and modelUsed into formatResponseUsageLine; no behavioral risk at the call site.

Reviews (1): Last reviewed commit: "feat: include model in response usage fo..." | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the actual provider/model that produced the reply to the response usage footer, so usage output is more informative while keeping existing cost/session behavior unchanged.

Changes:

  • Pass providerUsed and modelUsed into formatResponseUsageLine from the reply agent runner.
  • Extend formatResponseUsageLine to append a model … segment (and keep est $… formatting as-is).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/auto-reply/reply/agent-runner.ts Passes the resolved runtime providerUsed/modelUsed into the usage line formatter.
src/auto-reply/reply/agent-runner-usage-line.ts Builds a model label and appends it to the Usage: footer alongside the existing optional cost suffix.

Comment on lines +45 to +49
const modelLabel =
params.providerUsed && params.modelUsed
? `${params.providerUsed}/${params.modelUsed}`
: (params.modelUsed ?? params.providerUsed ?? "");
const suffix = `${costLabel ? ` · est ${costLabel}` : ""}${modelLabel ? ` · model ${modelLabel}` : ""}`;

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new modelLabel formatting duplicates logic that already exists in formatProviderModelRef (and is less robust): it doesn’t trim values and can double-prefix if modelUsed already contains provider/…. Consider reusing formatProviderModelRef(params.providerUsed ?? "", params.modelUsed ?? "") (or similar) so display formatting stays consistent across the codebase (e.g., fallback/status output) and avoids provider/provider/model edge cases.

Copilot uses AI. Check for mistakes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dc161c982

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +46 to +47
params.providerUsed && params.modelUsed
? `${params.providerUsed}/${params.modelUsed}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize model label before prefixing provider

When both providerUsed and modelUsed are present, this unconditionally formats provider/model, which produces incorrect labels for providers whose model IDs are already provider-qualified (for example OpenRouter native IDs like openrouter/aurora-alpha). In those runs the footer becomes openrouter/openrouter/..., so the reported model is wrong and can mislead users copying the value for follow-up commands or debugging.

Useful? React with 👍 / 👎.

@Ghabs95
Ghabs95 force-pushed the feat/usage-footer-model branch from 1dc161c to 26be029 Compare March 28, 2026 00:10
@clawsweeper

clawsweeper Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and the useful part of this older PR is already implemented there.

Close: the older branch is no longer a useful landing candidate because current main already covers the central model-in-footer value through the built-in /usage full usage bar, while the remaining direct Usage: suffix change is conflicting, older-format churn against the documented token-only mode.

So I’m closing this older PR as already covered on main rather than keeping a mostly-duplicated branch open.

Review details

Best possible solution:

Keep the current /usage full usage-bar implementation as the model-rich footer and leave /usage tokens as the compact token-only mode unless maintainers open a narrower follow-up.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug repro; this is a feature PR. Current-main source, tests, and docs show the model-rich /usage full footer behavior directly.

Is this the best way to solve the issue?

No. The older direct formatter suffix is no longer the best solution because current main moved rich footer display into the usage-bar/template contract and keeps the compact tokens footer separate.

Security review:

Security review cleared: The stale PR diff only changes TypeScript footer formatting/call arguments and adds no dependency, workflow, secret, package, or executable-code surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • Peetiegonzalez: Authored the merged usage-bar renderer and built-in footer commits that now own the model-rich /usage full path. (role: feature-history contributor; confidence: high; commits: 505539c89929, b07d4c79ba16, 917f660635e7; files: src/auto-reply/usage-bar/default-template.ts, src/auto-reply/usage-bar/translator.ts, src/auto-reply/usage-bar/contract.ts)
  • obviyus: Landed and repaired the current usage-footer implementation through the merged renderer and built-in footer PRs. (role: recent area contributor and merger; confidence: high; commits: 89b7e837d14d, ff6940036b43, 071c82355309; files: src/auto-reply/usage-bar/template.ts, src/auto-reply/reply/agent-runner.ts, docs/concepts/usage-tracking.md)
  • Marvinthebored: Opened the merged native templated footer and built-in full footer PRs that supersede this older direct-suffix branch. (role: feature proposer with merged domain history; confidence: medium; files: src/auto-reply/usage-bar/default-template.ts, docs/concepts/usage-tracking.md)

Codex review notes: model internal, reasoning high; reviewed against 1c86769cb817; fix evidence: commit 799488086414, main fix timestamp 2026-06-13T13:46:02Z.

@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 11, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 9, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 10, 2026
@clawsweeper clawsweeper Bot removed the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label Jun 14, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants