Repository navigation
acpmux: search chats by what was said, not only titles (_acpmux/chats_search, chats search) - #28755
Conversation
…no _acpmux/chats_search) HQ#5333: Search chats matches titles only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-80fea2c04bdd31e52544
…hats search) HQ#5333: Search chats matched titles and folders only. The new local-socket method reads each chat's turns from its harness's store (the reader _acpmux/chat_transcript uses), returns the chats whose prompt or answer holds every query word, newest first, each with its newest such message's turn, role and snippet. The scan stops at limit hits or the time budget (default 2 s) and says so; nothing is indexed or kept. Red on 27adacc (tests/chats_search.rs:139, no hits), green here: cargo test -p acpmux --test chats_search. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-80fea2c04bdd31e52544
…s as text Astra review of 9f77928 (BLOCK): - A JSONL store (Droid, Copilot CLI, older Goose) was read to its end, so one huge or growing transcript ran past budgetMs. It is now read from its newest 64 MiB, as adopt's reader reads Claude Code and Codex, up to the length it had when opened (fold_newest_lines). - acpmux chats search sends page after page until --limit chats are found or every chat was searched, so a time-cut page never hides an older chat. - Query words were lowered with str::to_lowercase and the text per char: a final sigma (ΟΣ) never found itself. Both now lower per char. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-80fea2c04bdd31e52544
… totals Astra review of 741f013 (BLOCK): - adopt's reader (Claude Code, Codex) sought the newest 64 MiB but read to EOF: it now stops at the length the file had when opened. - Folding lowers each character and reads a final sigma (ς) as σ, so ΟΣ, ος and οσ find each other. - fold_newest_lines is a whole read and returns no offset, so no caller can resume from one that falls inside a skipped line. - chats_search says what unreadable counts (a Claude Code or Codex file that fails mid-read gives the turns before it, as chat_transcript does). - The CLI sums scanned over its pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-80fea2c04bdd31e52544
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (gpt-6-astra, high, fast): SHIP at 1be6852 Three rounds. BLOCK at 9f77928, three findings: per-chat read bound, CLI paging, case folding. BLOCK at 741f013, five findings: Claude/Codex read frozen at open length, final-sigma folding, no resumable offset from fold_newest_lines, the unreadable contract, CLI scanned total. SHIP at 1be6852: no remaining blockers. |
|
Found 2 test failures on Blacksmith runners: Failures
|
The panic ratchet's tracked arithmetic rows (acpmux, cmux-chat-index) rose with this branch's counters and offsets: they saturate now, and the budget is read as elapsed time. acpmux is back to base's 1494 (its row over the 1430 baseline is base's, cmux#28673); cmux-chat-index is at its baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-80fea2c04bdd31e52544
Conflicts with #28055 (chats_window, chat_projects) in chats/mod.rs and server/chats.rs: both sides kept. Protocol IR re-blessed, methods.ts regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-80fea2c04bdd31e52544
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a web and size checks: green Shipped in:
|
|
Review (gpt-6-astra, high, fast): SHIP at 828935c This head is a merge of feat-cmux-next. Its conflicts with #28055 in chats/mod.rs and server/chats.rs were resolved by keeping both sides; the reviewer checked that nothing of #28055 was lost or doubled. The branch's own code is unchanged since the SHIP at 7a27a72. |
|
[P2 / fleet-scale resource bound] Each local request calls Small fix that preserves search semantics: add a dedicated shared Test: launch 30 requests with a stand-in transcript reader that blocks on a barrier; assert at most N simultaneous scans and that canceling 20 queued requests never starts them. At 3,000 indexed chats and 64-MiB transcripts, compare p95 chat-open/agent-host adoption latency with search traffic to no-search baseline. Keep the local-only authorization gate; it is correct here. This is an independent follow-up suggestion on the owner's current head; no source ownership changed. |
|
Review (next-review patch-id; carried): SHIP at a30b728 The independent SHIP at 6942e40 carries to this head: the PR's own change ( |
|
Review (next-review patch-id; carried): SHIP at bb2f4f6 The independent SHIP at 6942e40 carries to this head: the PR's own change ( |
…ples test) (#30025) #28755 added `acpmux chats search` without help examples, so cli::help_examples::tests::every_visible_command_has_an_about_line_and_examples fails on feat-cmux-next whenever the acpmux tests job runs. Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Part of manaflow-ai/cmuxterm-hq#5333 (Search chats matches titles only, never the conversation): the daemon half (its step 2) and a CLI verb. The palette hookup is a follow-up, below.
What
acpmux can now find a chat by what was said in it, not only by its title or folder.
_acpmux/chats_search {query, harness?, folder?, account?, limit?, cursor?, budgetMs?}: returns the chats whose prompts or answers hold every word ofquery(any case, any order, within one prompt or one answer). Newest chat first. Each hit has:chat: the same value_acpmux/chatsgives;turn: an index into_acpmux/chat_transcript'sturns;role:promptoranswer;snippet: up to 160 characters around the words;matches: how many of the chat's messages hold the words.limithits (default 50, at most 200) or afterbudgetMs(default 2000 ms, 50 to 10000). The budget is checked between chats, and each chat's read is bounded too, so a search ends at most one read past it.partialsays the time ran out, andnextCursorgoes on from the last chat read. A chat whose store can't be read is skipped and counted inunreadable.cmux-chat-index(Droid, Copilot CLI, older Goose) used to read to the end of the file. They now read the newest 64 MiB the file held when it was opened (fold_newest_lines), the same bound adopt's reader already puts on Claude Code and Codex. Whole-JSON stores were already capped at 8 MiB and SQLite stores at 2000 rows. This also bounds_acpmux/chat_transcriptfor those harnesses; its newest-200-turns answer doesn't change unless a file is over 64 MiB._acpmux/chat_transcriptalready uses (the newest 200 turns, 20k characters per message). Tool calls, tool results and injected<tags>context are not searched._acpmux/chat*. Web, LocalApp and Peer get "Method not found", so no transcript text leaves the machine.acpmux chats search WORDS… [--harness H] [--folder DIR] [-n N](alsocmux chats search) prints each chat's key and title, then the role and snippet of its newest matching message. It requests page after page until it has N chats or has searched every chat, so a page cut short by the time budget never hides an older chat.Why not the palette in this PR
AgentChatsPalettePage.swiftis being rewritten by lawrencecchen's open #28090 (with #28055): the page becomes a window over acpmux's own index (palette.chats). Wiring search into today's static page would conflict with that and be thrown away. The next step, once #28090 lands, is a second provider on that page: for a query of 3+ characters it calls_acpmux/chats_searchand shows chats whose title didn't match, with the snippet as subtitle. Opening a hit can scroll to the message byturn.Tests
cargo test -p acpmux --test chats_search(new). It covers:panicked at tests/chats_search.rs:139: nohits, method not found). Green on the head.cargo test -p acpmux --lib -- chats::search cli::chats protocol: snippet bounds, whitespace folding, lowercasing that changes length (İ), refusal of empty and over-long queries, the CLI text, andprotocol_ir_is_current(spec blessed,methods.tsregenerated withbun scripts/acpmux-protocol-codegen.ts).cargo test -p cmux-chat-index:lines::tests::the_newest_lines_are_read_from_a_whole_line_and_no_further_than_the_file_wascovers the cut inside a line, the cut on a line start, a trailing partial line, and the returned offset.cargo test -p acpmux --test chats_transcriptstill passes for every harness's reader.tests/chats_window.rs(from Chats: acpmux owns the chat list; the sidebar history holds only its window (P0 stall) #28055)a_window_over_three_thousand_chats_is_sorted_filtered_and_one_change_is_one_rowtimes out at line 84 on this VM. It fails the same way on base 51ed666 (same line, 30 s), so it is not this PR's.a_word_is_lowered_as_the_text_is:ΟΣ,οςandοσall find each other.Review
gpt-6-astra (high, fast) at 9f77928 gave BLOCK with three findings: a single huge JSONL transcript could run past the budget, the CLI couldn't continue a cut-short search, and query and text were lowercased differently. All three are fixed in 741f013. Its re-review at 741f013 found five more, all fixed in 1be6852:
ςfolds asσ, soΟΣfindsος;fold_newest_linesreturns no resumable offset;unreadablecontract is documented (a mid-read failure keeps the turns before it, aschat_transcriptdoes);scannedover its pages.Review (gpt-6-astra high, fast): SHIP at 1be6852, then a delta review of 7a27a72 (its arithmetic made saturating for the panic ratchet): SHIP at 7a27a72, then a review of the base merge 828935c (conflicts with #28055 resolved by keeping both): SHIP at 828935c.
Panic ratchet
The
clippy (changed cmux-tui packages)ratchet step is red on acpmux for base reasons: acpmuxarithmetic_side_effectsis 1494 on the merge base against a 1430 baseline (#28673 brings it back under), and the same step is red on #28772 and #28700. Its failures are deny-lint hits in other crates (cmux-automationsindexing_slicing/string_sliceas a new crate; cmux-tuiindexing_slicing832 > 831; cmux-tui-coreindexing_slicing856 > 853,string_slice57 > 52), none in a file this PR touches. This branch adds no hits at 7a27a72: acpmux is still 1494 and cmux-chat-index is at its 65 baseline (rust_panic_ratchet.pyovercargo clippy -p acpmux -p cmux-chat-index --lib --bins).Observed / Not run
cargo clippy -p acpmux -p cmux-chat-index --all-targetswith nothing new in the changed files.Changelog
acpmux chats search(and the daemon's_acpmux/chats_search) finds agent chats by words from their prompts and answers, not only their titles.Risk: normal. A new read-only, local-socket-only method; nothing existing changes.
Agent session: agent session
🤖 Generated with Claude Code