stagehand-python@4.2.0a0.dev1576: refactor : use progress tracker in act / extract / observe ( 3109)
Stagehand (Python dev pre-release) refactors timeout handling across act() , extract() , and observe() to use a unified progress tracker with a single shared deadline.
Why this signal matters
In pre-release version 4.2.0a0.dev1576 of stagehand-python , timeout management for act() , extract() , and observe() was refactored via PR 3109 to utilize a shared progress tracker. Previously, each service used isolated timeout tracking that only evaluated elapsed time between major I/O steps, allowing individual stalled operations (such as snapshots, model requests, or browser actions) to exceed configured timeouts. Key updates include: - Shared Deadline: Each invocation shares a single deadline covering snapshots, cache reads/writes, model requests, and browser operations. Nested steps (such as act 's self-healing, two-step actions, replay, or extract 's second model request and screenshot) inherit only remaining time. - Expiry Enforcement: Reaches timeout error upon expiration, strictly blocking subsequent steps. In-flight requests or commands already dispatched may finish, but late responses cannot trigger subsequent actions. - Resource Cleanup: Interrupted executions now clean up settling listeners, temporary element references, and release pressed inputs (e.g., held keys or dragging mouse buttons). - Defaults Maintained: Omitted or 0 timeouts remain treated as unlimited. Removed the redundant timeoutGuard utility.
Actionable summary
Stagehand-python v4.2.0a0.dev1576 replaces per-step timeout checks in act() , extract() , and observe() with a unified progress tracker. A single deadline is now enforced across snapshots, cache operations, LLM requests, and browser interactions, ensuring nested operations share remaining time and preventing late responses from executing subsequent steps.
- Agent usefulness
- 77/100
- Confidence
- 96%
- Canonical data
- JSON + Markdown
What builders should check
- Test automation suites using pre-release builds to verify that long-running operations previously exceeding timeouts between I/O boundaries now consistently terminate at their set deadlines.
- Ensure error handlers accommodate uniform timeout rejections across act() , extract() , and observe() .