Commit 48c131a
committed
🔄 synced local 'skyvern/' with remote 'skyvern/'
## Summary
- Fix critical bug where `self._page` was used instead of `self.page` in `_wait_for_page_ready_before_action`
- **Added diagnostic logging** for screenshot timeouts to help debug Flinks issues
## Bug Fix
The `SkyvernPage` class uses `self.page` but `_wait_for_page_ready_before_action` was checking `self._page` which doesn't exist. This caused every cached script action to log:
```
AttributeError: 'ScriptSkyvernPage' object has no attribute '_page'
```
## Added Logging for Screenshot Diagnostics
### Screenshot timeout now logs context:
```
Screenshot timeout | timeout_ms=3000 | url=https://... | viewport=1920x1080 | full_page=False | mode=detailed
```
### Scrape retry attempts now logged:
```
Scrape attempt failed, will retry with next strategy | attempt=1 | scrape_type=normal | error_type=FailedToTakeScreenshot | url=...
Scrape attempt failed, will retry with next strategy | attempt=2 | scrape_type=normal | error_type=FailedToTakeScreenshot | url=...
All scrape attempts failed | total_attempts=3 | error_type=FailedToTakeScreenshot | url=... | step_order=0 | step_retry=1
```
This will help identify:
- **Which URLs** are causing timeouts
- **What timeout value** is actually being used
- **Page viewport size** (large pages may timeout)
- **Which retry attempt** failed
- **Step context** (order and retry index)
## Test plan
- [ ] Deploy to staging and verify logs appear correctly
- [ ] Have Nick deploy and check if new logs provide insight into slowness
- [ ] Monitor for patterns in failing URLs/viewport sizes
🤖 Generated with [Claude Code](https://claude.ai/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Refactor**
* Use the public page attribute for readiness handling to improve stability when a page is unavailable.
* **Chores / Diagnostics**
* Enhanced screenshot error/debug logs with URL and viewport info.
* Improved scrape retry and failure logs to include attempt counts, error context, and next-step details.
* **Tests**
* Added unit tests validating readiness behavior and resilience around frame creation and wait routines.
<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Fix `AttributeError` in `ScriptSkyvernPage` and enhance logging for diagnostics.
>
> - **Bug Fix**:
> - Fix `AttributeError` in `ScriptSkyvernPage._wait_for_page_ready_before_action` by replacing `self._page` with `self.page`.
> - **Logging Enhancements**:
> - Add detailed logging for screenshot timeouts in `_current_viewpoint_screenshot_helper()` in `page.py`.
> - Log scrape retry attempts and failures in `build_and_record_step_prompt()` in `agent.py`.
> - **Testing**:
> - Add unit tests in `test_script_skyvern_page.py` to verify correct attribute access and exception handling in `_wait_for_page_ready_before_action`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for cbe137ff395b4ef7b17a3b86bf839e46fc357a1f. You can [customize](https://app.ellipsis.dev/Skyvern-AI/settings/summaries) this summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent 6ac311e commit 48c131a
File tree
3 files changed
+45
-5
lines changed- skyvern
- core/script_generations
- forge
- webeye/utils
3 files changed
+45
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
| 550 | + | |
550 | 551 | | |
551 | 552 | | |
552 | | - | |
| 553 | + | |
553 | 554 | | |
554 | 555 | | |
555 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2456 | 2456 | | |
2457 | 2457 | | |
2458 | 2458 | | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
2459 | 2466 | | |
2460 | | - | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
2461 | 2476 | | |
2462 | 2477 | | |
2463 | 2478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
| |||
94 | 103 | | |
95 | 104 | | |
96 | 105 | | |
97 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
98 | 115 | | |
99 | 116 | | |
100 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
101 | 125 | | |
102 | 126 | | |
103 | 127 | | |
| |||
0 commit comments