Repository navigation
History and sessions take a time window - #74
Merged
Merged
Conversation
The two list endpoints only took a limit, so the desktop app's traffic page could only ever say "the last 200" while its overview offers live / 24h / 7d / 30d. "What happened last Tuesday" was not a question the traffic page could be asked. The window is optional, and its absence does not mean today. The aggregating endpoints default to midnight because "how much did I spend" needs a period and today is the right one; a list does not — "the most recent N" is already a complete answer, and defaulting to today would empty the table at midnight while the user did nothing. Sessions filter by session, not by turn. Filtering turns and then grouping would report fewer turns and less cost for a task that straddles the boundary, and "what did that refactor cost" asks about the whole task, not the slice of it inside some window. So the aggregate is computed over everything and a session is kept when any of its turns falls inside. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The two list endpoints only took a limit, so the desktop app's traffic page could only ever show "the last 200" while its overview offers live / 24h / 7d / 30d. "What happened last Tuesday" was not a question the traffic page could be asked.
The window is optional, and its absence does not mean today. The aggregating endpoints default to midnight because "how much did I spend" needs a period and today is the right one. A list does not: "the most recent N" is already a complete answer, and defaulting to today would empty the table at midnight while the user did nothing.
Sessions filter by session, not by turn. Filtering turns and then grouping would report fewer turns and less cost for a task that straddles the boundary, and "what did that refactor cost" asks about the whole task, not the slice of it inside some window. The aggregate is computed over everything and a session is kept when any of its turns falls inside.
Tests cover both, plus a case going through a real query string — the note on
Windowrecords the time that flattening made every windowed request 400 while unwindowed ones were fine, which a unit test cannot see.🤖 Generated with Claude Code