Conversation
Failed --action specs IndexError and skip context.close(), so the HAR never lands. CDP attach drives pages[0] (and --goto navigates it), and derivation drops form params and base64 response bodies. Share a validated run_action helper, flush the Playwright HAR in finally, listen on every CDP context, open a new tab for --goto, and flush in-flight requests. har_to_client now reads params-only postData and decodes base64 content. Does not change header redaction, scheme printing, or CDP queryString (NousResearch#85053). Null postData is handled by the new body helper.
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
Follow-up to #70823 that does not overlap #85053 (redaction / scheme / CDP
queryString).The capture scripts currently die on a bad
--actionbefore the HAR is flushed, so a guessed selector produces no file. CDP attach drivespages[0]ofcontexts[0], and--gotonavigates that tab, which can wipe the session Hermes is already using. Derivation also drops urlencoded form bodies (postData.paramswith notext) and prints base64 response samples undecoded.Changes
scripts/har_actions.py: sharedrun_actionwithValueErroron malformed specs, pluschoose_drive_page/flush_pending.har_capture.py: close the Playwright context infinallyso a failed action still writes a partial HAR.har_capture_cdp.py: listen on every context (not one page), open a new tab for--goto, flush in-flight requests, still write the HAR if an action fails. Does not close the attached browser.har_to_client.py: readpostData.paramswhentextis missing, decodecontent.encoding == "base64"before printing.postData: nullis treated as empty (this subsumes fix(har-derived-api-client): handle postData: null in HAR entries #84977 if that is still open).Left alone on purpose: header redaction, hardcoded
https://, and CDPqueryString: [](#85053).Verification
No live network. No Playwright needed for the tests.