Skip to content

[DOCS] AG-UI RUN_FINISHED result now carries session stats #672

Closed

Description

Summary

CLI PR inference-gateway/cli#1187 (resolves inference-gateway/cli#1186) makes the AG-UI headless output carry the per-session totals in the terminal RUN_FINISHED event. result now includes inputTokens, outputTokens, cacheReadTokens, totalToolCalls, cost, lastInputTokens, and contextWindow. The event has no result when the run made no model request, and contextWindow is omitted when the model's window is unknown.

The CLI's own docs/ag-ui-output.md was updated in that PR with the exact key names. This issue tracks mirroring that in the user-facing documentation wherever headless output formats are documented.

Acceptance Criteria

  • The headless output format documentation mentions the RUN_FINISHED result keys exactly as the CLI emits them
  • AG-UI consumers (desktop sidecar) are pointed at lastInputTokens / contextWindow / cost for context-percentage and cost indicators
  • Plain hyphens only (no en or em dashes)

Refs: inference-gateway/cli#1186, inference-gateway/cli#1187

Activity

  1. added
    documentation
    on Sep 12, 2026
  2. edenreich commented on Sep 12, 2026

    @edenreich
    Contributor

    @claude Can you work on this? use /ponytail:ponytail

  3. moved this to Todo in 2026on Sep 12, 2026
  4. added theissue type on Sep 12, 2026
  5. inference-gateway-maintainer commented on Sep 12, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 1m 56s —— View job • docs/issue-672-20260912-1704 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-672-20260912-1704?quick_pull=1&title=Issue%20%23672%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23672%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Done

    • Gather context (issue + repo docs)
    • Read CLI docs/ag-ui-output.md for exact result key names
    • Document RUN_FINISHED result keys in cli.md
    • Point AG-UI consumers (desktop sidecar) at lastInputTokens / contextWindow / cost
    • Validate: lint:md, format:check, build (all pass)
    • Commit + open PR

    What changed

    cli.md gains an AG-UI RUN_FINISHED result subsection under the headless session-stats docs:

    • Example RUN_FINISHED event plus a key table with inputTokens, outputTokens, cacheReadTokens, totalToolCalls, cost, lastInputTokens, contextWindow - exactly as the CLI emits them.
    • Notes result is absent when the run made no model request, and contextWindow is omitted when the model's window is unknown.
    • Consumer guidance: context percentage comes from lastInputTokens / contextWindow (not inputTokens, which is a session-wide sum and overshoots), hide it when contextWindow is absent; cost indicator reads cost directly.
    • Cross-link from the --format ag-ui bullet in the format list.

    Plain hyphens only in the added text. One page touched, no new docs page - the existing headless output section is where consumers already look.

    PR: #674
    | Branch

  6. moved this from Todo to In progress in 2026on Sep 12, 2026
  7. moved this from In progress to QA in 2026on Sep 12, 2026
  8. moved this from QA to Done in 2026on Sep 12, 2026
  9. inference-gateway-releaser commented on Sep 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.14 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions