Repository navigation
mcpx: populate Group.Messages in grouped opencode statistics (#261) - #262
Merged
Merged
Conversation
group() selected no message count, so ByAgent/ByModel/ByProject always reported messages: 0 in JSON output even though Group.Messages is a declared field and ByModel merges it. Count messages per session with the correlated subquery Busiest already uses, summed over the group, guarded by has(message, session_id) so a moved schema degrades to 0 instead of failing the statistic. First test file for internal/opencode. Mirrors dezren39/nix PR #394 (fix for dezren39/darwin-nix#393); the two copies of opencode.go were identical before that fix.
5 of 16 tasks
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.
Fixes #261. Mirrors dezren39/nix PR #394 (the fix for dezren39/darwin-nix#393) — this repo's
pkgs/mcpx/internal/opencode/opencode.gowas byte-identical to the pre-fix version in dezren39/nix.group()selected no message count, soByAgent/ByModel/ByProjectalways reportedmessages: 0even thoughGroup.Messagesis a declared field andByModelmerges it.Busiestalready uses, summed over the group, guarded byhas(message, session_id)so a moved schema degrades to 0 instead of failing the statistic.internal/opencode: grouped counts by agent,ByModelmerge summing messages across sessions sharing a model, and the missing-session_iddegradation case.Verification:
go test ./internal/opencode/passes with the fix.opencode.goreverted,TestGroupCountsMessagesfails withMessages:0for every group (build want 5, got 0; plan want 1, got 0; test/m-a want 4, got 0; test/m-b want 2, got 0).gofmt -lclean,go vet ./internal/opencode/clean.Summary by CodeRabbit