Skip to content

feat(session): filter comment list by author#500

Open
abgregs wants to merge 1 commit into
modem-dev:mainfrom
abgregs:feat/comment-list-author-filter
Open

feat(session): filter comment list by author#500
abgregs wants to merge 1 commit into
modem-dev:mainfrom
abgregs:feat/comment-list-author-filter

Conversation

@abgregs

@abgregs abgregs commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Adds --author <name> and --no-author filters to hunk session comment list, letting the CLI narrow inline review comments by author — mirroring the existing --file and --type filters.

Why

In an agent-assisted review, an agent and a human both leave notes on the same session, so hunk session comment list --json returns a mixed set. Today the only way to isolate one author's notes is to pipe the JSON through jq (jq '[.comments[] | select(.author=="pi")]'), which pushes a conceptually one-flag filter into every consumer. A native --author <name> flag — plus a --no-author companion for untagged notes — keeps --json consumers thin and matches the ergonomics of --file / --type.

How it works

The filter threads through the same layers as --type, with the actual filtering in a single place (the daemon list handler):

  • core/cli.ts--author <name> / --no-author options, parsed and forwarded into the command input
  • core/types.ts, session/protocol.tsauthor / noAuthor on the command input and wire shapes
  • hunk-session/cli.ts — the client includes them in the request
  • session-broker/brokerServer.ts — one post-branch filter narrows the result by author, covering both the live-comment and review-note paths (both carry author)

--author <name> matches that author exactly; --no-author returns only comments with no author tag — comments added via comment add/apply without an author. (Human c notes are auto-tagged author: "user", so they're matched by --author user.) Neither flag returns everything. Documented in docs/agent-workflows.md.

Testing

  • Parse (core/cli.test.ts): --author pi{ author: "pi" }; --no-author{ noAuthor: true }.
  • Filter (brokerServer.helpers.test.ts): for a mixed-author comment set, --author returns only the matching author, --no-author returns only the author-less, and no flag returns all.
  • bun run typecheck, bun run lint, and bun run format:check clean.
  • Verified end-to-end on macOS (screenshots below).

Screenshots

End-to-end via hunkdev on this branch — drag each PNG into the GitHub editor to upload it in place:

1. Add one --author pi comment and one untagged comment

add-authored-and-authorless-comments

2. hunk session comment list --author pi → only pi's

list-pi-authored

3. hunk session comment list --no-author → only the untagged one

list-authorless

4. hunk session comment list (no filter) → both

list-all

Fixes #489

- Add `--author <name>` and `--no-author` flags to `hunk session comment list`
- Thread the author filters through CLI parsing, types, and session protocol
- Apply filtering in the broker for both live and stored comment paths
- Cover parsing and broker filtering with unit tests and update agent docs

Fixes modem-dev#489
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@benvinegar

Copy link
Copy Markdown
Member

Don't love --no-author meaning "human notes", but I guess we can go with it. Wish there was better / clearer language ... I feel agents would perform better.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --author filter to hunk session comment list

2 participants