feat: add search filter to agent tracer @W-22434499@#207
Conversation
Add a live search input under the tabs in the tracer panel that filters trace history entries and steps in realtime. The query matches against userMessage, sessionId, planId, step display names, and stringified step content. When the query matches entry metadata, all steps in that entry remain visible; otherwise only matching steps are shown. The counter reports matched steps out of total steps across all visible entries. Also adds display names and icons for OutputEvaluationStep and BeforeReasoningIterationStep, and renames ReasoningStep's display name from "Output Evaluation" to "Reasoning".
Code reviewFound 1 issue:
vscode-agents/webview/src/components/AgentTracer/AgentTracer.tsx Lines 313 to 341 in 9e18b63 Selection state is set here: vscode-agents/webview/src/components/AgentTracer/AgentTracer.tsx Lines 398 to 410 in 9e18b63 And passed back into the row from the filtered list: vscode-agents/webview/src/components/AgentTracer/AgentTracer.tsx Lines 668 to 682 in 9e18b63 Generated with Claude Code If this code review was useful, please react with thumbs up. Otherwise, react with thumbs down. |
Translate the stored selectedStepIndex from the original plan position into the filtered timeline's compacted position before passing it to TraceHistoryRow, so the highlight follows the selected step when the filter is active. If the selected step is filtered out, no item is highlighted. Also clear the filter query when traceHistory or sessionStarted resets the panel state, so a stale filter cannot hide a fresh batch.
Code reviewNo issues found. Re-reviewed commit ad851dc which addresses the prior feedback. The selection-translation logic and the filter-reset placement check out, and the new tests cover the edge cases. Generated with Claude Code If this code review was useful, please react with thumbs up. Otherwise, react with thumbs down. |
npiccolo
left a comment
There was a problem hiding this comment.
Manual testing ✅
Setup: Extension Development Host launched from ml/w-22434499-tracer-filtering, agent script project afdx-pro-code-testdrive opened in the test window.
Search input — visible under the tabs with correct placeholder text and styling.
Filter by user message — typing a word from an existing user message narrowed to the matching entry with all steps visible and counter showing matched vs total steps.
Empty state — typing a string with no matches showed "No traces match …" with 0 of N counter.
Clear button — clicking × emptied the input, hides the counter, and restored the full unfiltered list.
New session resets filter — starting a fresh simulation cleared any stale filter automatically.
Display name fix — BeforeReasoningIterationStep correctly shows "Before Reasoning Iteration" and ReasoningStep correctly shows "Reasoning" (previously mislabelled "Output Evaluation").
Automated tests: npm run test:backend (381/381) and npm run test:frontend (434/434) all pass.
LGTM ✅
What does this PR do?
Adds a live search input under the tabs in the Agent Tracer panel so PMs and engineers can find specific events in long traces. The query matches against
userMessage,sessionId,planId, step display names (e.g. "Action Executed", "Reasoning"), and stringified step content (so any value buried in a step's JSON is searchable).When the query matches an entry's metadata (userMessage / sessionId / planId), all steps in that entry remain visible to preserve full context. Otherwise only matching steps are shown inside the entry's timeline, and entries with zero matches are hidden entirely. The counter reports matched steps out of total steps across all visible entries.
Also fills in display names and icons for
OutputEvaluationStepandBeforeReasoningIterationStep, and renamesReasoningStep's display name from "Output Evaluation" to "Reasoning" (the previous mapping had two step types pointing at the same label).What issues does this PR fix or reference?
@W-22434499@
Functionality Before
No way to filter the trace history. PMs had to expand each entry and scroll through every step to find a specific event type, variable, or function call.
Functionality After
A search input sits under the tabs when the tracer is selected. Typing live-filters the visible entries and steps; an "X of Y" counter shows matched steps out of total steps; an × button clears the query. Entries that do not match are hidden; inside a matching entry, only matching steps appear unless the query matched the entry's metadata (in which case all steps stay visible).
Testing Setup Notes
Automated
npx jest --config jest.config.webview.js test/webview/AgentTracer— 100 passing tests acrossAgentTracer.test.tsxandAgentTracer.helpers.test.tsx. New coverage:entryMetadataMatches,stepMatchesFilter, andbuildTimelineItemswith a filter argumentnpx jest --config jest.config.webview.js— 424 passing tests across 22 suites (no regressions).Manual verification
Build and launch:
Press F5 to launch the Extension Development Host.
Open the Agentforce DX side panel, select an agent, and start a session. Send a few messages so multiple traces are recorded.
Switch to the Agent Tracer tab. Confirm a search input is visible directly under the tabs (no top margin, padding/border-radius matches the agent selector style).
Type part of a user message (e.g.
weather). The list narrows to entries whoseuserMessagecontains "weather"; all steps inside the matching entry remain visible. The counter showsN of Mmatched steps.Clear the input and type part of a step type (e.g.
reasoning). Entries that contain a Reasoning step remain, but inside each entry only the Reasoning steps appear; other step types are hidden.Type a value you know exists in step JSON (e.g. an account id, a function name, a variable name). Confirm only the steps containing that value are shown.
Type a
sessionIdorplanIdsubstring (visible in the expanded entry's info table). Confirm only the matching entry remains and all of its steps stay visible.Type a string that doesn't exist (e.g.
xyz_no_match). Confirm the empty-state message "No traces match …" appears.Click the × clear button. Confirm the input empties, the counter disappears, and the full unfiltered list returns.