fix(stagehand): cap the stagehand dependency below the breaking 4.x API - #2153
Merged
Conversation
vdusek
marked this pull request as ready for review
August 12, 2026 12:03
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2153 +/- ##
==========================================
+ Coverage 93.51% 93.66% +0.15%
==========================================
Files 181 181
Lines 12653 12653
==========================================
+ Hits 11832 11851 +19
+ Misses 821 802 -19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pijukatel
approved these changes
Aug 12, 2026
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.
The scheduled E2E tests fail on every stagehand template job with:
stagehand4.0.0, released on 2026-08-10, is a breaking API redesign.AsyncStagehandandAsyncSessionare gone in favour of a singleStagehandplusPage/Locator, and the wholestagehand.types.session_*module tree that_stagehand_types.pyimports was removed. Thestagehandextra declaredstagehand>=3.19.5with no upper bound, so the Actor image resolved 4.0.0 and the plugin's top-level import failed, surfaced throughtry_importas the misleading message above.Our own CI never saw it, because
uv.lockpins 3.22.0 and only the Actor image resolves the dependency fresh. That is also why some stagehand jobs still passed: they reused image layers cached before 4.0.0 was published.This caps the extra at
<4.0.0, matching the existingsqlalchemy[asyncio]>=2.0.0,<3.0.0style. Migrating the integration to the 4.x API is a separate piece of work.Verified by mirroring the Actor Dockerfile's
pip install ./wheel[stagehand,httpx]: the capped wheel resolves stagehand 3.22.0 and importsStagehandCrawler,StagehandBrowserPlugin,StagehandOptionsandStagehandPagecleanly, while a wheel built from master resolves 4.0.0 and reproduces the traceback above.Failing run: https://github.com/apify/crawlee-python/actions/runs/31583394515
✍️ Drafted by Claude Code