fix(web): clamp dashboard session search limit parameter - #35316
Closed
aydnOktay wants to merge 2 commits into
Closed
fix(web): clamp dashboard session search limit parameter#35316aydnOktay wants to merge 2 commits into
aydnOktay wants to merge 2 commits into
Conversation
Bound the /api/sessions/search limit query parameter so invalid or excessive values cannot overload FTS queries from the web dashboard, with unit and endpoint regression coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
When progressive edits fail before finish(), deliver only the missing tail instead of retrying a doomed finalize edit. Mirrors the segment-break flush path and fixes test_edit_failure_sends_only_unsent_tail_at_finish. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
Contributor
|
Thanks for the focused dashboard hardening. This is an automated hermes-sweeper review; current
|
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.
Summary
This PR clamps the
limitquery parameter onGET /api/sessions/searchin the web dashboard so invalid or excessive values cannot overload SQLite FTS queries.Problem
The dashboard session search endpoint forwarded
limitdirectly toSessionDB.search_messages(). Callers could passlimit=0, negative values, or very large numbers (e.g.9999), which is unnecessary load for a UI search endpoint and produces surprising behavior.Solution
_clamp_session_search_limit()with default 20, minimum 1, maximum 100.search_sessions()before opening the DB connection.Tests
SessionDB.search_messages().4 tests passed locally.
Notes
hermes_cli/web_server.pyonly; no workflow or unrelated file changes.