Repository navigation
Add the summary, errors, actions, detail and transcript queries - #622
vishnuv688 wants to merge 3 commits into
Conversation
traceSummary, traceErrors, traceActions, traceActionDetail and traceTranscript are the queries an agent starts a failure with, named after @wdio/mcp's trace tools. Each returns the package's own result types, times relative to the trace start, every string cut and every result held within its character budget. A failure is judged by shared's rules, so a poll that a passing wait retried past is never reported and a failed wait is listed once, by the wait. A trace failed by a step alone, such as a failing hook, gets a step error: the reader now keeps a step's own error message, and refuses a non-string message on a step or a command. Cursors carry a fingerprint of their listing, so one handed to another listing is refused even at equal length, and a full page counts its own wrapper against the budget. The trace outcome rule moves from the app into shared, so the player and these queries judge a trace alike, as does the rule for a failed request that otel used. Closes #604
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] The changes appear safe to merge. SummaryAdds five queries for reading trace summaries, errors, actions, action details and transcripts.
No new actionable issues were found in the changes since the previous review. Reviews (3) · Last reviewed commit: "Refuse a query budget too small for any ..." · Reviewed by Greptile |
- A traceActions row too large for a page sheds the rows it issued, counting them in omittedChildren, then cuts its own title and error, so a page always fits maxChars even when its one row is a wait with many polls. - A summary still over its budget cuts the first error's text, then leaves the test tree out and counts it in omittedTests. - traceActionDetail drops the call's own source line before it cuts any argument, result or error value.
Below a thousand characters a summary's own fields, or one error with its message, cannot fit, so a result could still overrun maxChars. The queries now refuse a budget below MIN_QUERY_CHARS, and from there up a test holds every query's whole result within its budget on every adapter fixture and on a trace of oversized values. The tests that forced paging and cutting with smaller budgets use larger runs.
|
Greptile's remaining concern, that the size limits must hold, is addressed in f52155a. A query now refuses a |
What & why
The queries an agent starts a failed run with (#493), named after
@wdio/mcp's trace tools:traceSummary(handle)traceErrors(handle)traceActions(handle, { status, group, fromMs, toMs })traceActionDetail(handle, callId)traceTranscript(handle)transcript.md, a page of lines at a timeThe whole point is reading few tokens, so every result uses the package's own types, times are ms from the trace start, every string is cut, and every result is held within its character budget.
Closes #604
Type of change
Packages touched
shared(types and contracts)core(framework-agnostic capture/reporting)elements(published element/snapshot API:@wdio/elements)service(WebdriverIO adapter)nightwatch-devtools(Nightwatch adapter)selenium-devtools(Selenium adapter)selenium-devtools-py(Selenium Python adapter)backend(server)app(UI)script(page-injected runtime)trace(Trace mode)Also
trace-queryandotel, which the list does not name.Capability matrix
Not applicable yet: no adapter behaviour and no user-facing tool. Whether the trace tools get a row is decided with the docs in #608.
Notes for reviewers
Stacked on Open a trace from a zip, an output folder or an https URL #620 (Add the trace query library package #619 and Share manifest-to-zip resolution and the action key through trace #618 below it). Review this PR's own commit.
Failure semantics come from shared's rules, never reimplemented: a poll that a passing wait retried past is never reported, a failed wait is listed once by the wait, with its failed polls reachable through
traceActionsandtraceActionDetail, andfirstErroris the first failed top-level action, then the first failed step. When the trace failed and neither exists,firstErrorstays unset rather than naming an unrelated console error or request.Moves into shared: the app's trace outcome rule (
trace-outcome.ts; ESLint lets the app import onlytrace-readerfromtrace, so shared rather thantrace), otel's failed-request rule (request-failure.ts, which Trace query: console and network #605 replaces with the Network tab's rule so there is one), and the row-level failure rule (rowFailure). The app'sTraceSummarytype is renamedTraceRunSummaryto free the name fortraceSummary's result. The app and otel changes are meant to change no behaviour; the reviews compared them line by line.Reader changes:
TraceActionGroupNode.errorkeeps a step's own error message, so a trace failed by a hook can say so. A step or command error whose message is not a string is refused at the reader (a command keeps its failure with a fixed message, so it never turns into a pass).Budget rule: a cursor is
offset/total/fingerprint, a 32-bit FNV-1a hash of the listing's scope (its filters), so a cursor handed to a different listing is refused even at equal length; a full page counts its{ items, total, nextCursor }wrapper and separators againstmaxChars. A detail that overflows drops source lines first, then cuts its fields step by step.Known limits:
openTraceselected is a follow-up.Token measurements (serialized characters), against each fixture's
transcript.md:On these 2 to 5 action fixtures the queries cost a little more than the transcript, and give the test tree, expected and actual values and source lines it lacks. On a synthetic 300-action run with one failure,
transcript.mdis 11,153 characters against 2,496 for summary + errors + detail.Tests run every query over all 8 committed adapter fixtures, plus zips written in the test with this checkout's writer (a passing wait with a retried poll, a timed-out wait, a failed assertion, console errors, failed requests) and fixtures edited to carry a failing hook and malformed errors.
Checks run.
pnpm build,pnpm test(365 files, 5033 tests),pnpm lint(0 errors) andpnpm typecheckpass; leak grep clean on thetrace-queryandoteldists.Screenshots / recordings
Not applicable: no UI change.
🤖 Generated with Claude Code