Page mail_people, leave out the owner's addresses, and shorten its rows #34

Merged
svc-agent-writer merged 1 commit from feat/people-paging into main 2026-10-31 05:12:54 +00:00

Output-efficiency feedback on mail_people from a live session.

Changes

  1. No repeated address. A name that is empty or only repeats the address (any case, with or without angle brackets) prints as -.
  2. The owner is left out by default. include_self: bool = false. Self is the configured From address of each account, plus every From seen in a Sent or Drafts mailbox of that account, which catches aliases with no config. The subquery is a row value, so SQLite builds the set once (LIST SUBQUERY, not correlated).
  3. One date column. first_seen | last_seen becomes one seen cell: 2026-02-19 when both are the same day, else 2015-08-07..2015-08-26.
  4. Paging. A cursor input, and the footer mail_search already uses: next_cursor=N more=M total=T. The order is received descending, then address, so pages are stable. min_received drops the long tail.

The footer reuses the existing convention rather than the proposed -- 100 of 342 shown form, so agents parse one format across tools.

Breaking for callers that parse rows

The row now has 4 cells instead of 5, and the response ends with a footer line. With the defaults, the owner's addresses no longer appear.

Tests

  • make check: 86 unit tests pass.
  • make test-integration: 7 pass against GreenMail.
  • New tests cover paging, the tie order, exclusion of the configured address and of Sent aliases, min_received, and the row rendering.

🤖 Generated with Claude Code

Output-efficiency feedback on `mail_people` from a live session. ## Changes 1. **No repeated address.** A name that is empty or only repeats the address (any case, with or without angle brackets) prints as `-`. 2. **The owner is left out by default.** `include_self: bool = false`. Self is the configured From address of each account, plus every From seen in a Sent or Drafts mailbox of that account, which catches aliases with no config. The subquery is a row value, so SQLite builds the set once (`LIST SUBQUERY`, not correlated). 3. **One date column.** `first_seen | last_seen` becomes one `seen` cell: `2026-02-19` when both are the same day, else `2015-08-07..2015-08-26`. 4. **Paging.** A `cursor` input, and the footer `mail_search` already uses: `next_cursor=N more=M total=T`. The order is `received` descending, then address, so pages are stable. `min_received` drops the long tail. The footer reuses the existing convention rather than the proposed `-- 100 of 342 shown` form, so agents parse one format across tools. ## Breaking for callers that parse rows The row now has 4 cells instead of 5, and the response ends with a footer line. With the defaults, the owner's addresses no longer appear. ## Tests - `make check`: 86 unit tests pass. - `make test-integration`: 7 pass against GreenMail. - New tests cover paging, the tie order, exclusion of the configured address and of Sent aliases, `min_received`, and the row rendering. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- cursor input and the mail_search footer (next_cursor, more, total);
  order is received descending, then address, so pages are stable.
- include_self (default false): the account's From address and every
  From seen in Sent or Drafts are left out. The subquery is a row
  value, so SQLite builds the set once.
- min_received drops the long tail of one-off senders.
- A name that only repeats the address prints as "-"; first and last
  seen collapse to one "seen" cell, one date or first..last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Member

Held for the next batch of changes: no 0.2.2 release for this PR alone. It ships in the first release that follows its merge.

Held for the next batch of changes: no 0.2.2 release for this PR alone. It ships in the first release that follows its merge.
Sign in to join this conversation.
No description provided.