-
Notifications
You must be signed in to change notification settings - Fork 112
docs(rfd): Add session usage and context status RFD #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
docs(rfd): Add session usage and context status RFD #316
Conversation
Proposes standardized tracking of token usage, cost estimation, and context window status across ACP implementations. - Token usage reported in PromptResponse (per-turn data) - Context window and cost reported in session/status (session state)
| "percentage": 26.5, | ||
| "remaining": 147000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these two fields needed, they are fully derivable from size and used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They’re redundant mathematically, but they carry the agent’s own calculation/rounding and simplify client work
| - `percentage` (number, required) - Percentage used (0-100) | ||
| - `remaining` (number, required) - Tokens remaining |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto on the derived fields from size and used are these fields needed
|
|
||
| ### Design Principles | ||
|
|
||
| 1. **Separation of concerns** - Token usage is per-turn data, context window and cost are session state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how will this work with subagent "tools" that aren't performing full turns but are actively updating token usage frequently
|
@josevalim @SteffenDE I'd love to get your input on this one since you were looking into this a bit |
|
We like the idea and we definitely want to have a way to do this in ACP! For us, the most important part is the current usage (in percent). Including a The PR proposes a new |
|
@SteffenDE Thanks a lot for the detailed explanation and context 🙏 If this matches what you had in mind, I can adjust the RFD in that direction. |
|
@ahmedhesham6 yes! I'd wait before changing things though, since I'm not a maintainer here and basically just stating my opinion :D |
|
What do you think @benbrandt? |
|
Yeah I think something simple to start would be great. As @SteffenDE mentioned, support for this will likely vary wildly (and we've also seen mixed support of even these basic metrics within the same agent lol) I think we should let this be driven by the agent, as they will likely get the information from the provider and may forward it, but might not hold on to it. Requiring them to have the data at all points might be too much... So I'd opt for a simple way to report the basic information we feel we need, and go from there |
…cations Refines the tracking of context window and cost information by transitioning from `session/status` requests to `session/update` notifications. This change allows agents to proactively push updates, enhancing flexibility and real-time data availability for clients. The `cost` field is now optional, and the `remaining` field has been removed, as clients can compute it from `size` and `used`. Updated documentation to reflect these changes and provide clearer usage patterns.
Proposes standardized tracking of token usage, cost estimation, and context window status across ACP implementations.