Repository navigation
feat(search): search every chat on MAX's server with opcode 68 when no chat is named - #565
Merged
Merged
Conversation
…o chat is named A server search with no chat now sends one opcode 68 request, as web.max.ru's search box does (count 30, no marker on the first page). MAX answers one result per chat: its best message plus a per-chat match count. Only MESSAGES-section results become hits; CHATS (title hits), PUBLIC_CHATS and sectionless results are dropped, and the per-chat count is dropped because a message has no field for it. The marker is never followed, so a query costs one call; its presence sets hasMore. A named chat keeps using opcode 73. - spec: messages.searchGlobal (68, measured 2026-10-11, PR #562); protocol docs regenerated - client.messages.searchGlobal; adapter routes a chatless searchMessages to it - messenger declares serverSearch: true (cli-messaging only skips on "chat") - archive-only MCP/CLI tests now say --backend archive; new end-to-end test proves one 68 call Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
leemour
added a commit
that referenced
this pull request
Oct 11, 2026
MAX global search (#565): a search with no chat named asks the server once with opcode 68. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Task
max search messageswith no chat should ask MAX's server across every chat, with the opcode web.max.ru's search box uses (68), once. A named chat keeps opcode 73. No automatic follow-up into the top chats (this replaces the "then 73 per top chat" idea in #562).Why
The server search was refused without a chat, so an unscoped search only saw the local archive. #562 measured that opcode 68 searches message text in all chats (owner's account, read-only, 2026-10-11).
What
messages.searchGlobal, opcode 68, confidencemeasured; request{query, count, marker?}; evidence and the answer shape in the operation's notes (src/spec/operations/messages.ts).docs/dev/protocol.mdandsrc/generated/*regenerated withpnpm generate. The constantMSG_SEARCH_GLOBALis ours: no source we hold names 68.messages.searchGlobal(query, count)keeps onlysection: "MESSAGES"results with a message, chat id fromresult.chatId.hasMoreismarker !== undefined.a OR bsplits into up to 3 queries, as before) withcount: 30(web client's value), cut to the caller's limit; the marker is never followed, so cli-messaging's 3-call / 5 s bounds see exactly one call per query. Chat given → 73 as before.count—MessageHithas no field for it, and putting it inproviderMetadatawould persist a query-specific number into the store.serverSearch: true. cli-messaging 0.231.0 (the current pin) only skips on"chat"(server-search.ts), so no cli-messaging change or pin bump is needed.max serveforwards 68 with no change: it forwards what the spec lists.search messageswith words now connects to MAX by default (--backend both);--backend archivekeeps it local. Four MCP tests and one CLI test meant archive-only and now say so.Testing
{query, count: 30}, CHATS / PUBLIC_CHATS / sectionless dropped, marker →hasMore, limit cut.max search messages invoice --jsonsends exactly one 68, no 73, hit returned withsource: "server",server.calls: 1.pnpm lint,pnpm typecheck,pnpm test(1568 passed),pnpm test:matrix(0 missing),pnpm parity:check— all pass.pnpm release:checkfails only on the release-time steps (version not raised, «Не выпущено» not dated).🤖 Generated with Claude Code