feat(falcon): paginate event search results with a 100-event page cap#224
feat(falcon): paginate event search results with a 100-event page cap#224m-mizutani wants to merge 3 commits into
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces stable pagination and result-set snapshotting for Falcon event searches by utilizing a shared storage client. It defines a new StorageAware interface to inject storage configurations into agent factories, implements NDJSON-based snapshotting in the Falcon agent, and updates the CLI commands to support this integration. The review feedback highlights a valuable performance optimization: instead of decoding the entire NDJSON snapshot into memory within decodeNDJSON, the implementation can be optimized to decode only the requested page of events and discard the rest, thereby reducing memory overhead and garbage collection pressure for large result sets.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
falcon_search_eventspreviously returned the entire EDR event result set straight to the agent, flooding the LLM context with potentially thousands of events. This change paginates the results: at most 100 events are returned per call, along with the total result-set size, and later pages are served from a stored snapshot without re-running the query.Background (investigation)
queryjobsAPI — there is no streaming/export endpoint and nomimeTypeparameter.| tail(N)in the query string. The exact match count is best obtained via| count().Changes
limit(default 100, max 100),offset, andresult_set_idparameters tofalcon_search_events. Responses now includetotal,offset,returned,has_more, andresult_set_id.falcon/events/). Subsequent pages are read back viaresult_set_idwithout re-querying — stable across calls and multi-instance safe (no in-process state, matching Warren's stateless design).| tail(N)for more events and| count()for exact totals; the tool itself does not modify the query.doneresponse) and themetadataResult→metaDataresponse-key typo. When the API reportsmetaData.eventCount, surface it astotal_matched.agents.StorageAwareinterface; no new CLI flags (reuses--storage-bucket/--storage-prefix). Without storage, only the first page is returned.Tests
total_matchedfrom metadata, missing result set, the cumulative no-duplication fix, and the pagination helpers.go vet ./...,golangci-lint run,gosec, andgo test ./...all pass.🤖 Generated with Claude Code