Repository navigation
Let the history tool search earlier turns for text - #299
Merged
Merged
Conversation
A bot whose context left turns out could only read them by number, so it had to guess where something was said. `history` now takes `query` (and `before` to continue): it walks the lineage newest first, leaves out the turn the search runs in, and lists up to 20 matches with their turn, item type and the text around each, ignoring ASCII case. It stops at a turn boundary after 20 matches or 64 MiB of items and names that turn as `next_before`. The context note now mentions the search. Borrowed from fx, whose compacted turns are searchable by text. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97bf2bff79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A multiline item reads with its whitespace compacted, so a query copied from a history page may not occur in the item as stored. The raw-item prefilter now passes multiline items through to the view check. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
lydakis
pushed a commit
that referenced
this pull request
Oct 28, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
This was referenced Oct 28, 2026
Merged
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.
The first item borrowed from fx (vercel-labs/fx at
30b6bac). fx's agent can search compacted turns by text. Until now, ourhistorytool could read a left-out turn only by its number, so a bot had to guess where something was said.What changes
historytakesquery, andbeforeto continue an earlier search. A search walks the bot's lineage newest first, fork-inherited turns included. Withbot, it walks that agent's lineage instead.history_readpages. ASCII case is ignored, as SQLite'slower()folds it.next_beforeanddone: false.…to read any of them, or with query to search them for text.The tool description anddocs/RUST_PROTOTYPE.mddescribe the search.Daemon cost
The search runs only when a bot calls it, so nothing here is on a turn's path and no store job is added per turn. It is one reader-thread job. The chain query is ordered by depth inside the recursive CTE, so it streams from the head and stops early once it has enough matches. Each node's
instr(lower(...))check runs separately. The reading view (the picture-free form with encrypted reasoning removed) is built only for nodes that match, so a match that exists only in picture bytes or encrypted content is dropped. The 64 MiB cap bounds how long one call can hold the reader.Tests
store_contract: newest-first order, several matches in one turn, the 20-match stop andnext_before, continuing withbefore, a missingbeforeturn, an empty query, leaving out the running turn, fork lineage, an unknown bot.test_runtime: a real daemon window with omitted turns. The context note names the search, and ahistorycall withqueryfinds the omitted turn but not the turn it runs in.cargo test --workspaceandtests.test_runtimepass locally, except three SandFS tests insonny/tests/task.rs. Those fail because this container has no FUSE.