Skip to content

fix: make chat-scoped message search complete - #44

Open
b-pm wants to merge 3 commits into
beeper:mainfrom
b-pm:fix/messages-chat-search-integrity
Open

b-pm wants to merge 3 commits into
beeper:mainfrom
b-pm:fix/messages-chat-search-integrity

Conversation

@b-pm

@b-pm b-pm commented Oct 4, 2026

Copy link
Copy Markdown

Summary

Work around the Desktop API's current chatIDs message-search truncation so beeper messages search --chat ... does not silently return only one message per chat.

What changes

When one or more --chat selectors are supplied, the CLI now:

  1. resolves the requested chat(s)
  2. retrieves chat metadata to canonicalize IDs and narrow to the relevant account(s) when safe
  3. deliberately omits chatIDs from /v1/messages/search
  4. filters returned messages client-side to the requested canonical/local/merged chat IDs
  5. continues until the requested CLI limit is satisfied or search is exhausted

Searches without --chat are unchanged.

Why

beeper/desktop-api-mcp#2 documents that the server's chatIDs filter silently caps results to one message per chat and marks the response complete. That is especially dangerous for agents because incomplete history looks authoritative.

This keeps the CLI honest while the server-side defect remains open.

Merged chats

For merged chats, member chat IDs are included in the client-side match set. Account narrowing is disabled for that case so messages from member chats on different accounts are not accidentally excluded.

Tests

Adds a command-level local-server test that proves:

  • --chat does not send chatIDs to message search
  • the resolved chat account is used to narrow search when safe
  • unrelated-chat search results are filtered out client-side
  • multiple matching messages from the requested chat are returned, avoiding the one-result truncation

Copilot AI balanced review requested due to automatic review settings October 4, 2026 05:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants