Repository navigation
Conversation
NavigationResponseTracker keeps the latest responseReceivedExtraInfo per request id. A redirect hop shares the request id with the final response, so when the final response has no extra info of its own (for example, it comes from the disk cache) the 3xx hop's headers were applied to it. Only apply stored extra info whose statusCode matches the response status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b22e7ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
This branch has not been deployed
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.
why
NavigationResponseTrackerkeeps the latestresponseReceivedExtraInfoper request id. A redirect hop shares its request id with the final response, so when the final response has no extra info of its own (for example, it is served from the disk cache), the 3xx hop's headers, such as itsset-cookieandlocation, are applied to the final 200 response returned bygoto().what changed
selectResponseapplies stored extra info only when itsstatusCodematches the response status, and always clears the stored entry.tests/navigation-response-tracker.test.tswith a fake page and session.test plan
headerValue("set-cookie")returns the redirect'shop=1; with this change it is null. A second test checks that matching early extra info is still applied.pnpm --filter @browserbasehq/stagehand-extension test:unit: 78 files, 1266 passed.pnpm exec turbo run fmt:check lint typecheck --continue: 47/47 tasks passed.Written with help from an AI coding agent; I've reproduced and tested it as described.
🤖 Generated with Claude Code
Summary by cubic
Fixes
goto()sometimes returning a navigation response with headers from a redirect hop instead of the final response. Redirect hops share the request ID with the final response, so when the final response has no extra info of its own (for example, it comes from the disk cache), the 3xx hop's headers, such as itsset-cookieandlocation, were applied to it.statusCodematches the response status, and the stored entry is always cleared afterward.Written for commit b22e7ef. Summary will update on new commits.