Thread

A
Abhinav10:04 AMOpen in Slack
team, what do you think about a proper context window breakdown in the chat UI?
right now the indicator shows how full the window is, not what's filling it. thinking of something like: click the context icon to open a modal showing per-category details (system prompt / tools / messages / tool results / files), expandable to see the biggest token hogs + a rough per-turn cost.
tried to build a quick prototype (we can enhance it as per feedback). let me know what you think

10 replies
A
Abhinav10:05 AMOpen in Slack
we could also have a /context slash command (alongside the existing /compact) to pull it up without leaving the keyboard.
MK
Matvey Kukuy (archestra team)5:52 PMOpen in Slack
Summoning @user here 🙂
👀1
A
arseny5:55 PMOpen in Slack
@user hey, thanks for the highlight. can you elaborate if this breakdown is supposed to be directly actionable or just stats for curiosity?
A
Abhinav5:04 AMOpen in Slack
@user mostly actionable. The idea is you open it, see what's actually eating the window, and there's a clear next step right there. So if tools are taking up most of it, you can trim them or switch to search-and-run mode. If it's old messages piling up, that's exactly when /compact helps. If a file or the system prompt is hogging space, you can spot it and cut it down.
We can plan it whichever direction you think is best though.
A
arseny7:39 AMOpen in Slack
@user changing the toolset (or earlier message) mid-conversation is typically not a best thing to do because it is not cache friendly. Transformers are autoregressive, and conversation prefix is used as KV cache key, so we try to do the compaction 1) cache friendly when possible [meaning we try appending the compaction prompt, so the cache prefix stays], 2) universal [meaning it does not really matter if the context was hogged by tools or files or what else.
Having said that, stats may be useful to plan your next session and overall adjust your chatting style. So if you’re interested in sending a PR, happy to review it!
A
Abhinav7:58 AMOpen in Slack
yeah that makes sense... didn't realize mutating the toolset/history mid-conversation would invalidate the KV-cache prefix. I'll frame it purely as read-only stats to understand what's filling the window and plan future sessions better. Will open an issue + PR. Thanks a lot!
👍1
A
Abhinav7:10 AMOpen in Slack
PR is up here: #5260. Please take a look once you get a chance
👀1
A
arseny11:49 AMOpen in Slack
@user i left some AI review nits to address please
👍1
A
Abhinav3:10 AMOpen in Slack
@user the review comments are addressed, please take a look. Thanks!
A
arseny7:13 AMOpen in Slack
will do today, thanks!