perf(session-search): adapt discovery result hydration - #82595
Closed
blunkjamie-dev wants to merge 4 commits into
Closed
blunkjamie-dev wants to merge 4 commits into
blunkjamie-dev wants to merge 4 commits into
Conversation
teknium1
added a commit
that referenced
this pull request
Aug 15, 2026
… wrapper Main extracted a session_search() wrapper (owned-DB lifecycle) around _session_search_impl after #82595 was opened; the cherry-picked detail parameter landed on the impl only. Append it to the wrapper with the same positional-compatibility contract and pass it through.
Collaborator
|
Thanks for this fix! It was salvaged into #86764 (cherry-picked onto current main with your authorship preserved in the commit history) and is now merged. Closing since the work has landed. |
bobaba76
pushed a commit
to bobaba76/hermes-agent
that referenced
this pull request
Aug 27, 2026
… wrapper Main extracted a session_search() wrapper (owned-DB lifecycle) around _session_search_impl after NousResearch#82595 was opened; the cherry-picked detail parameter landed on the impl only. Append it to the wrapper with the same positional-compatibility contract and pass it through.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
… wrapper Main extracted a session_search() wrapper (owned-DB lifecycle) around _session_search_impl after NousResearch#82595 was opened; the cherry-picked detail parameter landed on the impl only. Append it to the wrapper with the same positional-compatibility contract and pass it through.
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.
What does this PR do?
Reduces routine
session_searchdiscovery payloads without changing FTS ranking, lineage deduplication, cron demotion, or scroll/read behavior.Discovery currently hydrates bookends plus a ±5-message window for every matched session. On a real 51,969-message database, SQLite lookup and complete tool execution were already fast (adaptive p50 up to 72 ms in the final query set), while a three-result response commonly carried 24–34 KB and broad ten-result searches had exceeded 130 KB. The bottleneck is returned context, not the index.
This PR adds adaptive discovery hydration:
detail="full"restores the prior all-results-full response;detailfields make the returned shape explicit.This intentionally stays complementary to three narrower fixes already under review:
profilearguments through the optimized agent handlers;This PR avoids routine over-hydration before serialization while preserving the best-ranked context inline. It does not duplicate those exact-title, cross-profile, or hard-cap patches.
Related Issue
Related PRs: #55640, #60819, #79219
Type of Change
Changes Made
tools/session_search_tool.pydetail={adaptive,full}schema and handler wiring;agent/agent_runtime_helpers.py,agent/tool_executor.pydetailthrough both optimized agent-loop dispatch paths.tests/tools/test_session_search.pytests/run_agent/test_token_persistence_non_cli.pydetail="full"reaches the tool through direct and sequential execution.website/docs/user-guide/sessions.mdHow to Test
Verified on Windows 10:
/docs/llms*.txthome-page link warnings);git diff --check: passed;Hermes,restart,proof,memory,project,Buzz):(session_id, match_message_id)ranking in adaptive/full modes;I also attempted the full
tests/toolssuite. The locked dev extra initially lacked the optional Slackaiohttpdependency; after adding the locked Slack extra only to the disposable worktree venv, that broad suite exceeded ten minutes and surfaced numerous unrelated optional-integration failures. I am therefore not claiming the repository-wide suite passes locally; the load-bearing focused gates above are green.Checklist
Code
pytest tests/ -qand all tests pass — focused gates pass; broad-suite limitation documented aboveDocumentation & Housekeeping
cli-config.yaml.example: N/A (no config key)CONTRIBUTING.md/AGENTS.md: N/A (no workflow change)