Skip to content

fix(browser): keep failed trace response statuses unknown - #12724

Merged
morluto merged 1 commit into
morluto:mainfrom
chessing234:fix/rea-20261120-agent-04-a
Nov 20, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
chessing234:fix/rea-20261120-agent-04-a

Conversation

@chessing234

Copy link
Copy Markdown
Contributor

Summary

Keep unavailable Playwright trace response statuses unknown instead of presenting -1 as an observed HTTP status.

Problem and expected behavior

Playwright 1.64.1 initializes HAR/trace responses with status: -1; a request that fails before headers retains that sentinel. REA currently publishes it as the trace event's HTTP status and reports scoped interpretation. Preserve the source failure while leaving the headline status unknown and reporting partial interpretation.

Change and scope

Reuse the recorded response declaration owner already used by HAR consumers. This follows the HTTP-status semantics from #12218; that merged change did not update the trace projection. No issue is linked because this remaining path was independently reproduced. No new provider or runtime capability.

Contract and boundary impact

  • Semantic owner and earliest changed stage: TraceEventProjection delegates status interpretation to readRecordedResponseDeclaration; trace views consume the resulting facts.
  • Contribution scope fit and linked maintainer decision: ordinary offline reader fix; separate scope decision not applicable.
  • CLI and MCP/tool-catalog contract: unchanged schemas; unsupported status headlines become null with existing partial-event diagnostics.
  • Provider/format compatibility: existing Playwright v10 profile only.
  • Evidence/provenance: original status, numeric lexeme, failure text and member/line identity remain retained.
  • Target authority and cleanup: unchanged offline archive reader; no browser launch or recorded-URL requests.
  • Generated metadata/package/install impact: none.

Expected effects:

  • Read existing files or captured data.

Evidence and regression coverage

  • Decoder-boundary fixture fails on main c0ee832a3: 1 failed / 19 passed. It incorrectly returns [-1, 0, 99, 200.5, 1000] as status headlines.

  • After the fix: invalid/sentinel headlines are null, valid 100/200/600/999 remain, raw -1 and its lexeme/failure/provenance survive, and coverage is partial.

  • Actual producer run: Playwright 1.64.1 / Chromium 156.0.8078.4 on macOS arm64, isolated browser and a self-owned loopback server that closes /failed before headers. Its recorded trace reproduces status: -1, net::ERR_EMPTY_RESPONSE, and scoped interpretation with no baseline diagnostic. The fixed production decoder returns null/partial with a line-2 diagnostic while preserving the raw failure, exact member/line provenance and valid 200/101 peers. Its resource scope closed with no pending resources. A separate authored ZIP regression covers the invalid-number and valid-boundary controls.

  • Boundary coverage: missing/unknown values, source preservation and valid controls. No lifecycle behavior changes.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Node 24.22.1 / npm 11.16.0, macOS arm64.

  • npm run test:local -- src/browser/history/playwrightTrace/PlaywrightTraceDecoder.test.ts src/domain/analysisView/webNetworkCaptureView.test.ts — 83 passed, private TMPDIR.
  • npm run typecheck — passed (source and script projects).
  • npm run lint — passed, zero errors; advisory warnings remain.
  • npm run check:fast — passed through the normal pre-push hook, including typecheck, lint and architecture guards.
  • Focused oxlint / oxfmt --check, npm run verify:test-discovery, git diff --check — passed; discovery includes the new regression.
  • npm run check — failed environmentally during compile with ENOSPC creating the MCP catalog temporary directory; not reported as passing. Its full formatting check passed. The source typecheck/lint commands above were then run independently.

Compatibility, safety, and release

No migration, dependency or release metadata changes. Real browser generation and production decoder checks ran as described above. The supported public CLI launcher was attempted but failed because the compiled runtime was missing after an interrupted build; no successful public CLI workflow was established. Public MCP and other browser/platform lanes were not run. An earlier focused attempt failed before test collection because shared temporary Vite files disappeared; the private-TMPDIR run above completed. CI and the remaining full static gate still need completion.

Author readiness

Human owner: Chessing234

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Required CI and maintainer review complete.

Use the recorded HTTP response owner for Playwright trace headlines.
Preserve producer status sentinels and failure facts in the raw record,
without presenting unavailable responses as observed HTTP status codes.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T03:55:31.801355Z a2c5109 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The reviewed changes appear safe to merge.

Summary

Trace network headlines now use readRecordedResponseDeclaration, matching the existing HTTP-status rules.

  • Playwright trace events show unknown status for invalid response numbers.

No actionable code or security issues were found. No tests were run during this review. Whether another PR supersedes this one could not be checked because GitHub access was unavailable.

Reviews (3) · Last reviewed commit: "fix(browser): keep failed trace response..." · Reviewed by Greptile

@morluto
morluto merged commit 79171a4 into morluto:main Nov 20, 2026
39 checks passed
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants