Skip to content

docs(proposal): add How section to #214 token usage response headers#586

Merged
shaneutt merged 2 commits into
praxis-proxy:mainfrom
noalimoy:proposal/token-usage-response-headers-how
Jun 17, 2026
Merged

docs(proposal): add How section to #214 token usage response headers#586
shaneutt merged 2 commits into
praxis-proxy:mainfrom
noalimoy:proposal/token-usage-response-headers-how

Conversation

@noalimoy

Copy link
Copy Markdown
Contributor

Summary

Add the implementation approach section to the token usage response
headers proposal, completing the What/Why/How structure.

Changes

  • Add ## How? section with requirements and design
  • Cover key design decisions: metadata transport, all-or-nothing
    injection, compile-time header names, pipeline ordering
  • Resolve header naming open question (X-Praxis-Token-*)
  • Add streaming header injection as remaining open question

Related Issues

Relates to #214

@noalimoy noalimoy requested a review from a team June 11, 2026 19:47
@noalimoy noalimoy requested review from shaneutt and twghu as code owners June 11, 2026 19:47
@shaneutt shaneutt self-assigned this Jun 11, 2026
@shaneutt shaneutt added the area/ai AI and inference filters label Jun 11, 2026
@shaneutt shaneutt moved this to Review in AI Gateway Jun 11, 2026
@shaneutt shaneutt added this to the v0.4.0 milestone Jun 11, 2026

@praxis-bot praxis-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

test

Comment thread docs/proposals/00214_token-usage-response-headers.md
Comment thread docs/proposals/00214_token-usage-response-headers.md
Comment thread docs/proposals/00214_token-usage-response-headers.md
Comment thread docs/proposals/00214_token-usage-response-headers.md

@praxis-bot praxis-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review Summary

The How? section is well-structured and follows the proposal template conventions. The design decisions are clear and well-justified with cross-references to related PRs. A few items need attention before merging.

Findings

Severity Description
Large X-Praxis-Token-* naming conflicts with reserved internal header convention (see inline)
Medium Data flow diagram shows explicit Some(500) for total, but set_token_usage auto-computes it (see inline)
Small Graduation criteria jump (see inline)
Nit Goals list still claims streaming support but streaming is an open question (see inline)

Key Observation

The most significant finding is the tension between X-Praxis-Token-* as a client-facing response header and the existing x-praxis-* reserved header convention, which is documented and enforced as proxy-internal only. The reserved header stripping in response_filter.rs runs before filters execute, so filter-injected x-praxis-* headers technically survive to the client. But this creates an architectural inconsistency that should be explicitly addressed in the proposal before implementation proceeds.

(Please disregard the earlier empty test review above.)

Reviewed with praxis-bot

@noalimoy noalimoy force-pushed the proposal/token-usage-response-headers-how branch from 9a801ec to 26bec8d Compare June 15, 2026 11:14

@praxis-bot praxis-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review: docs(proposal): add How section to #214 token usage response headers

Adds the implementation approach (How?) section to the token usage response headers proposal, resolving the header naming question and detailing requirements, design, data flow, and pipeline ordering.

Overall Assessment

Solid proposal that follows the established template structure (Requirements + Design). The header naming rationale is thorough and well-reasoned. A few technical inaccuracies in the data flow diagram and a missing context note about set_token_usage() should be addressed before this guides implementation.

Findings Summary

Severity Count
Medium 2
Small 3
Nit 2

All findings were placed as inline comments.


Automated review by praxis-bot

Comment thread docs/proposals/00214_token-usage-response-headers.md
Comment thread docs/proposals/00214_token-usage-response-headers.md
Comment thread docs/proposals/00214_token-usage-response-headers.md
@noalimoy noalimoy force-pushed the proposal/token-usage-response-headers-how branch from 4ff7ed0 to aa77cc9 Compare June 16, 2026 10:27
…nse headers

Add implementation details covering requirements, design decisions
(string-based metadata transport, all-or-nothing injection,
compile-time header names, X-Praxis-Token-* prefix), pipeline
ordering, and streaming open question.

Signed-off-by: noalimoy <nlimoy@redhat.com>
@noalimoy noalimoy force-pushed the proposal/token-usage-response-headers-how branch from 1d0f4c1 to bcecafa Compare June 17, 2026 13:57
@praxis-proxy praxis-proxy deleted a comment from praxis-bot Jun 17, 2026
@praxis-proxy praxis-proxy deleted a comment from praxis-bot Jun 17, 2026
@praxis-proxy praxis-proxy deleted a comment from praxis-bot Jun 17, 2026
@praxis-proxy praxis-proxy deleted a comment from praxis-bot Jun 17, 2026
@shaneutt shaneutt merged commit 20c0c7c into praxis-proxy:main Jun 17, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in AI Gateway Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ai AI and inference filters

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants