You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the shared branch-filter foundation for a scoped (project, branch) dimension.
This layer adds branch-token parsing, branch predicates, branch metadata listing with an encoded token clients can pass back, matching SQLite/Postgres/DuckDB behavior, and generated client support for the shared filter shape. Follow-up branches can build CLI, MCP, activity, usage, and UI affordances on one API contract.
Branch filtering is mostly wired in, but several Medium issues remain around backend parity and the branch token API contract.
Medium
internal/postgres/search_content.go:61, internal/duckdb/store.go:1039 ContentSearchFilter.GitBranch is accepted by the HTTP/service layer, but the PostgreSQL and DuckDB content-search session filter adapters drop it. As a result, search/content?git_branch=... can return matches from all branches on those backends. Fix: Pass GitBranch: f.GitBranch into both db.SessionFilter literals and add backend parity coverage for content search.
internal/server/huma_routes_usage.go:160
Usage comparison builds the prior-period filter without copying f.GitBranch, so branch-scoped comparisons compare the selected branch’s current cost against all branches in the prior period. Fix: Add GitBranch: f.GitBranch to priorFilter.
internal/db/sessions.go:2424
The branch metadata response exposes only project and branch, while the new git_branch query parameters expect opaque encoded tokens and document them as coming from /branches. HTTP clients cannot pass the endpoint response back verbatim without duplicating the hidden separator format. Fix: Include an encoded token field in the branch response, or change the filter API to accept explicit project/branch values.
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
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.
Adds the shared branch-filter foundation for a scoped
(project, branch)dimension.This layer adds branch-token parsing, branch predicates, branch metadata listing with an encoded token clients can pass back, matching SQLite/Postgres/DuckDB behavior, and generated client support for the shared filter shape. Follow-up branches can build CLI, MCP, activity, usage, and UI affordances on one API contract.
Tracking issue: #928
Follow-ups are staged as fork-internal PRs that fan out from this branch:
Those PRs stay in the fork until this foundation lands. After that, each one can be restacked onto
mainand opened upstream independently.