Skip to content

fix(core): ignore empty project filter in session stats - #51540

Open
5h4d0wn1k wants to merge 1 commit into
anomalyco:v2from
5h4d0wn1k:stats-empty-project
Open

5h4d0wn1k wants to merge 1 commit into
anomalyco:v2from
5h4d0wn1k:stats-empty-project

Conversation

@5h4d0wn1k

@5h4d0wn1k 5h4d0wn1k commented Sep 26, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #51534
Issue: #51534

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Project.ID accepts "". Stats previously treated that as a real project ID in both its message SQL and its compaction-event session lookup. The result was an all-zero report, and the inferred from time was wrong.

Use the same truthiness guard at both sites so an empty project ID means no project filter. Non-empty project IDs keep their existing filter.

How did you verify your code works?

Added a regression assertion in the existing seeded stats test. It compares the full result for projectID: "" with the result for an omitted project ID, using the same fixed end time. It failed before the fix and passes after it, including the inferred range, usage, and tool totals.

  • bun run test test/session-stats.test.ts in packages/core: 1 pass
  • bun typecheck in packages/core: pass
  • bun run check at the root: pass

Screenshots / recordings

No UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant