feat(eversale): Captcha solver integration + pip installability verified#55
Conversation
… fix Major changes: - Fix Playwright 1.58+ compatibility: page.accessibility.snapshot() removed - New a11y_compat.py: 3-tier fallback (legacy → aria_snapshot → CDP) - All 6 affected files patched to use get_accessibility_snapshot() - Fix non-blocking first-run setup (bootstrap.py) for pip-installed CLI - Fix CWD resolution using Path(__file__).resolve() in run_ultimate.py - Fix alternating loop detection (snapshot↔navigate pattern) - Tracks tool history, detects oscillation after 6 steps - Auto-completes with collected data instead of looping forever - Remove /mnt/c/ WSL paths (none found - already clean) Tested with: OPENAI_API_KEY/BASE_URL/MODEL via Z.AI (glm-5) eversale --ultimate --headless 'Navigate to example.com and tell me the page title' → Returns 'Example Domain' correctly in 32s
…uto-detect - Navigate action: resolve URL from 'value' field when 'target' is a non-URL literal (e.g. 'URL'). Handles bare domains like 'chat.z.ai'. - CLI: enable stdout line-buffering so progress appears in real-time. - Agent loop: print step-by-step progress (e.g. [1/20] navigate: ...). - Browser: auto-detect headless environments (no DISPLAY on Linux) to prevent silent hangs in WSL/SSH/Docker/CI.
Replace /mnt/c/ev29/cli/engine/ with engine/, /mnt/c/ev29/cli/ with ./, /mnt/c/ev29/agent/ with engine/agent/, etc. across 143 .md/.txt/.patch files. Documentation is now platform-agnostic.
…error handling - Add retry loop (2 attempts) for LLM response parsing failures - Strip markdown code fences (```json...```) before regex matching - Check for LLM errors and empty responses before parsing - Dual regex strategy: simple JSON first, then aggressive match - Validate parsed JSON contains 'action' field - On retry, append stricter formatting instruction to prompt - Natural language fallback for unparseable responses - Log raw LLM responses for debugging
- Add 3-tier captcha detection: DOM-based, slider-specific, and vision-based - Integrate PageCaptchaHandler, ScrappyCaptchaBypasser from captcha_solver.py - Add slider captcha solving with vision model (glm-4.7v) for drag distance analysis - Implement human-like drag kinematics (cubic bezier, wobble, overshoot) - Auto-detect captchas after click/type/press/navigate actions - Graceful degradation if captcha_solver not available - All syntax validated, pip install -e . works, CLI tested end-to-end
Review Summary by QodoCaptcha solver integration, Playwright compatibility layer, and environment-driven LLM configuration
WalkthroughsDescription**Captcha Detection & Solving Integration** • Integrated automatic captcha detection and solving into run_simple.py with 3-tier strategy: DOM-based detection → slider-specific handling → vision model fallback • Added 6 new methods for captcha orchestration: _detect_and_solve_captcha(), _detect_and_solve_slider_captcha(), _perform_human_drag(), _detect_captcha_via_vision(), _solve_captcha_via_vision() • Captcha checks automatically triggered after click/type/press/navigate actions with graceful fallback if solver unavailable **Playwright Compatibility & Version Support** • Created new a11y_compat.py module providing compatibility layer for Playwright 1.48+ accessibility snapshots • Replaced all page.accessibility.snapshot() calls across 6 modules with get_accessibility_snapshot() wrapper supporting legacy API, aria_snapshot(), and CDP fallbacks **Environment Variable Support for LLM Configuration** • Added propagation of OPENAI_MODEL, OPENAI_MODEL_VISION, and OPENAI_BASE_URL environment variables throughout agent configuration • Updated 6 modules (config_loader.py, agent_roles.py, brain_config.py, strategic_planner.py, orchestration.py, playwright_direct.py) to respect environment variables with fallback chains • Enables seamless integration with OpenAI-compatible APIs like Z.AI **Agent Robustness & Path Resolution** • Added stall detection in react_loop.py to identify and recover from observe-only loops (6+ consecutive snapshot/navigate without interaction) • Improved LLM response parsing with retry logic, markdown fence stripping, and fallback interpretation • Fixed path resolution in bootstrap.py to use engine-relative paths and EVERSALE_HOME for stable initialization tracking • Made first-time setup non-interactive in CI/piped environments **CLI & Runtime Improvements** • Added stdout line-buffering to eversale_cli.py for real-time progress display • Auto-detect headless mode on Linux when no display server available • Enhanced URL resolution for navigate actions supporting bare domains • Fixed engine directory path resolution in run_ultimate.py **Documentation Normalization** • Removed absolute Windows paths (/mnt/c/) from 50+ documentation files • Converted all file references to platform-agnostic relative paths for improved portability across development environments Diagramflowchart LR
A["Browser Automation<br/>click/type/press/navigate"] -->|"triggers"| B["Captcha Detection<br/>3-tier strategy"]
B -->|"DOM check"| C["Standard reCAPTCHA<br/>hCaptcha, Turnstile"]
B -->|"Slider DOM"| D["GeeTest, Canvas<br/>Puzzle detection"]
B -->|"Vision fallback"| E["Screenshot + LLM<br/>glm-4.7v analysis"]
C -->|"solved"| F["Human-like drag<br/>with bezier easing"]
D -->|"solved"| F
E -->|"solved"| F
F -->|"continue"| A
G["Environment Variables<br/>OPENAI_MODEL<br/>OPENAI_MODEL_VISION"] -->|"configure"| H["LLM Chain<br/>6 agent modules"]
I["Playwright 1.48+<br/>Compatibility Layer"] -->|"wraps"| J["get_accessibility_snapshot<br/>legacy/aria/CDP fallback"]
J -->|"used by"| H
File Changes1. eversale/engine/run_simple.py
|
Code Review by Qodo
1. Vision captcha checks always
|
There was a problem hiding this comment.
11 issues found across 161 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="eversale/engine/agent/INTEGRATION_SUMMARY.md">
<violation number="1" location="eversale/engine/agent/INTEGRATION_SUMMARY.md:272">
P3: The documented `cd` path is inconsistent with the repository layout and can break the integration test command when run from repo root.</violation>
</file>
<file name="eversale/engine/agent/LOCAL_PLANNER_OPTIMIZATIONS.md">
<violation number="1" location="eversale/engine/agent/LOCAL_PLANNER_OPTIMIZATIONS.md:5">
P3: The new relative paths are incorrect for this repository layout; they drop the `eversale/` prefix and point to non-existent files.</violation>
</file>
<file name="eversale/engine/agent/DOM_FIRST_BROWSER_README.md">
<violation number="1" location="eversale/engine/agent/DOM_FIRST_BROWSER_README.md:433">
P2: The documented `cd` path is incorrect for this repository layout; from repo root it should include the `eversale/` prefix.</violation>
</file>
<file name="eversale/engine/agent/NATURAL_LANGUAGE_TRIGGERS.md">
<violation number="1" location="eversale/engine/agent/NATURAL_LANGUAGE_TRIGGERS.md:432">
P2: The quick-test `cd` path is incorrect relative to this repository and will cause the documented command to fail from repo root.</violation>
</file>
<file name="eversale/engine/agent/NL_TRIGGERS_SUMMARY.md">
<violation number="1" location="eversale/engine/agent/NL_TRIGGERS_SUMMARY.md:28">
P2: The documented module paths are incorrect (`engine/agent/...` does not exist in this repo). Use `eversale/engine/agent/...` so references are navigable.</violation>
<violation number="2" location="eversale/engine/agent/NL_TRIGGERS_SUMMARY.md:195">
P3: The test command uses a non-existent directory (`engine/agent`). Update it to the actual path so the documented test steps work.</violation>
</file>
<file name="eversale/engine/agent/CACHING_SUMMARY.md">
<violation number="1" location="eversale/engine/agent/CACHING_SUMMARY.md:148">
P2: The test command uses an incorrect relative path; from repo root it should include the `eversale/` prefix.</violation>
</file>
<file name="eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md">
<violation number="1" location="eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md:193">
P2: The updated `cd engine/agent` path is inconsistent with the documented repository layout and likely breaks the test command from repo root.</violation>
<violation number="2" location="eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md:234">
P3: The new Related Files paths are missing the `eversale/` prefix and are inconsistent with the repository’s documented directory structure.</violation>
</file>
<file name="eversale/engine/agent/PLANNER_USAGE.md">
<violation number="1" location="eversale/engine/agent/PLANNER_USAGE.md:327">
P2: `cd .` is a no-op here and can leave users in the wrong working directory for `python3 -m agent.planner`.</violation>
</file>
<file name="eversale/engine/agent/FAST_MODE_README.md">
<violation number="1" location="eversale/engine/agent/FAST_MODE_README.md:58">
P2: This path points to a repo-relative config file, but users should edit the runtime config at `~/.eversale/engine/config/config.yaml`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| ```bash | ||
| cd /mnt/c/ev29/cli/engine/agent | ||
| cd engine/agent |
There was a problem hiding this comment.
P2: The documented cd path is incorrect for this repository layout; from repo root it should include the eversale/ prefix.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/DOM_FIRST_BROWSER_README.md, line 433:
<comment>The documented `cd` path is incorrect for this repository layout; from repo root it should include the `eversale/` prefix.</comment>
<file context>
@@ -430,7 +430,7 @@ logger.debug(f"Snapshot cache hit - DOM unchanged")
```bash
-cd /mnt/c/ev29/cli/engine/agent
+cd engine/agent
pytest test_dom_first_browser.py -v
</file context>
</details>
```suggestion
cd eversale/engine/agent
| Quick test: | ||
| ```bash | ||
| cd /mnt/c/ev29/cli/engine/agent | ||
| cd engine/agent |
There was a problem hiding this comment.
P2: The quick-test cd path is incorrect relative to this repository and will cause the documented command to fail from repo root.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/NATURAL_LANGUAGE_TRIGGERS.md, line 432:
<comment>The quick-test `cd` path is incorrect relative to this repository and will cause the documented command to fail from repo root.</comment>
<file context>
@@ -429,6 +429,6 @@ See `example_natural_language_triggers.py` for complete working examples.
Quick test:
```bash
-cd /mnt/c/ev29/cli/engine/agent
+cd engine/agent
python example_natural_language_triggers.py
</file context>
</details>
```suggestion
cd eversale/engine/agent
| - `/mnt/c/ev29/cli/engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser | ||
| - `/mnt/c/ev29/cli/engine/agent/action_templates.py` - Added enable_system2_reasoning template | ||
| - `/mnt/c/ev29/cli/engine/agent/intelligent_task_router.py` - Added router detection | ||
| - `engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser |
There was a problem hiding this comment.
P2: The documented module paths are incorrect (engine/agent/... does not exist in this repo). Use eversale/engine/agent/... so references are navigable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/NL_TRIGGERS_SUMMARY.md, line 28:
<comment>The documented module paths are incorrect (`engine/agent/...` does not exist in this repo). Use `eversale/engine/agent/...` so references are navigable.</comment>
<file context>
@@ -25,9 +25,9 @@ Enable THOUGHT + REFLECTION prompts for deliberate reasoning before actions.
-- `/mnt/c/ev29/cli/engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser
-- `/mnt/c/ev29/cli/engine/agent/action_templates.py` - Added enable_system2_reasoning template
-- `/mnt/c/ev29/cli/engine/agent/intelligent_task_router.py` - Added router detection
+- `engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser
+- `engine/agent/action_templates.py` - Added enable_system2_reasoning template
+- `engine/agent/intelligent_task_router.py` - Added router detection
</file context>
| - `engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser | |
| - `eversale/engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser |
| Run tests with: | ||
| ```bash | ||
| cd /mnt/c/ev29/cli/engine/agent | ||
| cd engine/agent |
There was a problem hiding this comment.
P2: The test command uses an incorrect relative path; from repo root it should include the eversale/ prefix.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/CACHING_SUMMARY.md, line 148:
<comment>The test command uses an incorrect relative path; from repo root it should include the `eversale/` prefix.</comment>
<file context>
@@ -145,7 +145,7 @@ All changes are backward compatible:
Run tests with:
```bash
-cd /mnt/c/ev29/cli/engine/agent
+cd engine/agent
python3 test_caching.py
</file context>
</details>
```suggestion
cd eversale/engine/agent
| Run the test suite to see all supported patterns: | ||
| ```bash | ||
| cd /mnt/c/ev29/cli/engine/agent | ||
| cd engine/agent |
There was a problem hiding this comment.
P2: The updated cd engine/agent path is inconsistent with the documented repository layout and likely breaks the test command from repo root.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md, line 193:
<comment>The updated `cd engine/agent` path is inconsistent with the documented repository layout and likely breaks the test command from repo root.</comment>
<file context>
@@ -190,7 +190,7 @@ Quick reference for all natural language commands available in the Eversale CLI
Run the test suite to see all supported patterns:
```bash
-cd /mnt/c/ev29/cli/engine/agent
+cd engine/agent
python3 test_nl_triggers.py
</file context>
</details>
```suggestion
cd eversale/engine/agent
| ### Enable/Disable Fast Mode | ||
|
|
||
| In `/mnt/c/ev29/cli/engine/config/config.yaml`: | ||
| In `engine/config/config.yaml`: |
There was a problem hiding this comment.
P2: This path points to a repo-relative config file, but users should edit the runtime config at ~/.eversale/engine/config/config.yaml.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/FAST_MODE_README.md, line 58:
<comment>This path points to a repo-relative config file, but users should edit the runtime config at `~/.eversale/engine/config/config.yaml`.</comment>
<file context>
@@ -55,7 +55,7 @@ Fast Mode automatically falls back to full LLM mode for:
### Enable/Disable Fast Mode
-In `/mnt/c/ev29/cli/engine/config/config.yaml`:
+In `engine/config/config.yaml`:
```yaml
</file context>
| In `engine/config/config.yaml`: | |
| In `~/.eversale/engine/config/config.yaml`: |
| **Run Integration Tests**: | ||
| ```bash | ||
| cd /mnt/c/ev29/cli/engine/agent | ||
| cd engine/agent |
There was a problem hiding this comment.
P3: The documented cd path is inconsistent with the repository layout and can break the integration test command when run from repo root.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/INTEGRATION_SUMMARY.md, line 272:
<comment>The documented `cd` path is inconsistent with the repository layout and can break the integration test command when run from repo root.</comment>
<file context>
@@ -269,7 +269,7 @@ All reliability-related logs use these prefixes:
**Run Integration Tests**:
```bash
-cd /mnt/c/ev29/cli/engine/agent
+cd engine/agent
python3 test_reliable_integration.py
</file context>
</details>
```suggestion
cd eversale/engine/agent
| ## Summary | ||
|
|
||
| Optimized `/mnt/c/ev29/cli/engine/agent/local_planner.py` to eliminate redundant computations and reduce planning overhead by up to 90% for repeated tasks. | ||
| Optimized `engine/agent/local_planner.py` to eliminate redundant computations and reduce planning overhead by up to 90% for repeated tasks. |
There was a problem hiding this comment.
P3: The new relative paths are incorrect for this repository layout; they drop the eversale/ prefix and point to non-existent files.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/LOCAL_PLANNER_OPTIMIZATIONS.md, line 5:
<comment>The new relative paths are incorrect for this repository layout; they drop the `eversale/` prefix and point to non-existent files.</comment>
<file context>
@@ -2,7 +2,7 @@
## Summary
-Optimized `/mnt/c/ev29/cli/engine/agent/local_planner.py` to eliminate redundant computations and reduce planning overhead by up to 90% for repeated tasks.
+Optimized `engine/agent/local_planner.py` to eliminate redundant computations and reduce planning overhead by up to 90% for repeated tasks.
## Optimizations Implemented
</file context>
| ### Run tests: | ||
| ```bash | ||
| cd /mnt/c/ev29/cli/engine/agent | ||
| cd engine/agent |
There was a problem hiding this comment.
P3: The test command uses a non-existent directory (engine/agent). Update it to the actual path so the documented test steps work.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/NL_TRIGGERS_SUMMARY.md, line 195:
<comment>The test command uses a non-existent directory (`engine/agent`). Update it to the actual path so the documented test steps work.</comment>
<file context>
@@ -188,11 +188,11 @@ Deterministic workflows automatically detected by intelligent_task_router.py:
### Run tests:
```bash
-cd /mnt/c/ev29/cli/engine/agent
+cd engine/agent
python3 test_nl_triggers.py
</file context>
</details>
```suggestion
cd eversale/engine/agent
| - Full documentation: `engine/agent/NL_TRIGGERS_SUMMARY.md` | ||
| - Test suite: `engine/agent/test_nl_triggers.py` | ||
| - Parser code: `engine/agent/command_parser.py` | ||
| - Templates: `engine/agent/action_templates.py` | ||
| - Router: `engine/agent/intelligent_task_router.py` |
There was a problem hiding this comment.
P3: The new Related Files paths are missing the eversale/ prefix and are inconsistent with the repository’s documented directory structure.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md, line 234:
<comment>The new Related Files paths are missing the `eversale/` prefix and are inconsistent with the repository’s documented directory structure.</comment>
<file context>
@@ -231,8 +231,8 @@ python3 test_nl_triggers.py
-- Parser code: `/mnt/c/ev29/cli/engine/agent/command_parser.py`
-- Templates: `/mnt/c/ev29/cli/engine/agent/action_templates.py`
-- Router: `/mnt/c/ev29/cli/engine/agent/intelligent_task_router.py`
+- Full documentation: `engine/agent/NL_TRIGGERS_SUMMARY.md`
+- Test suite: `engine/agent/test_nl_triggers.py`
+- Parser code: `engine/agent/command_parser.py`
</file context>
| - Full documentation: `engine/agent/NL_TRIGGERS_SUMMARY.md` | |
| - Test suite: `engine/agent/test_nl_triggers.py` | |
| - Parser code: `engine/agent/command_parser.py` | |
| - Templates: `engine/agent/action_templates.py` | |
| - Router: `engine/agent/intelligent_task_router.py` | |
| - Full documentation: `eversale/engine/agent/NL_TRIGGERS_SUMMARY.md` | |
| - Test suite: `eversale/engine/agent/test_nl_triggers.py` | |
| - Parser code: `eversale/engine/agent/command_parser.py` | |
| - Templates: `eversale/engine/agent/action_templates.py` | |
| - Router: `eversale/engine/agent/intelligent_task_router.py` |
| if not self.llm_client or not self.page: | ||
| return None | ||
|
|
||
| try: | ||
| screenshot_bytes = await self.page.screenshot(full_page=False) | ||
| screenshot_b64 = base64.b64encode(screenshot_bytes).decode('utf-8') | ||
|
|
||
| vision_model = os.getenv('OPENAI_MODEL_VISION', '') or 'glm-4.7v' | ||
| prompt = """Look at this screenshot. Is there any CAPTCHA, verification challenge, or security puzzle visible? | ||
|
|
||
| Types to look for: | ||
| - Slider captcha (drag a puzzle piece) | ||
| - Text captcha (type the distorted text) | ||
| - Image selection captcha (click on matching images) | ||
| - Checkbox captcha ("I'm not a robot") | ||
| - Turnstile/Cloudflare challenge | ||
| - Any other verification widget | ||
|
|
||
| Respond ONLY with one of: | ||
| - "none" if no captcha is visible | ||
| - A brief description like "slider captcha" or "text captcha" if one is visible""" | ||
|
|
||
| response = await self.llm_client.generate( | ||
| prompt, | ||
| model=vision_model, | ||
| images=[screenshot_b64], | ||
| temperature=0.1, | ||
| ) |
There was a problem hiding this comment.
1. Vision captcha checks always 🐞 Bug ⛨ Security
After each click/type/press/navigate, _detect_and_solve_captcha() proceeds to a vision-based screenshot check even when DOM/slider checks do not detect a captcha, causing an LLM request on normal pages. Because the default LLMClient mode is remote for CLI usage, this can upload page screenshots off-machine and add large latency/cost per step.
Agent Prompt
### Issue description
`SimpleAgent` currently runs a vision-based captcha check (screenshot + LLM request) after most actions, even on pages without captchas. This can cause unintended screenshot exfiltration to the default remote LLM backend and adds significant latency/cost.
### Issue Context
- Captcha checks are invoked after `click/type/press/navigate`.
- `_detect_and_solve_captcha()` always calls `_detect_captcha_via_vision()` unless an earlier layer *detected and solved* a captcha.
- `_detect_captcha_via_vision()` always screenshots and calls `llm_client.generate(...)`.
### Fix Focus Areas
- Add an explicit opt-in switch (env var and/or CLI flag) controlling whether the vision layer is enabled.
- Add throttling/caching: e.g., skip vision checks if the URL hasn’t changed and a recent check found no captcha.
- Consider only invoking vision when DOM heuristics indicate a likely challenge (keywords like "captcha", known challenge iframes, overlays, etc.).
- eversale/engine/run_simple.py[636-677]
- eversale/engine/run_simple.py[948-995]
- eversale/engine/run_simple.py[1126-1128]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Ensure CWD is the engine directory so all relative paths resolve correctly | ||
| _ENGINE_DIR = Path(__file__).resolve().parent | ||
| os.chdir(_ENGINE_DIR) | ||
|
|
||
| # Configure loguru BEFORE any agent imports | ||
| from loguru import logger | ||
| logger.remove() # Remove default handler |
There was a problem hiding this comment.
2. Package cwd forced 🐞 Bug ⛯ Reliability
run_ultimate.py changes the process working directory to the engine package directory, so any relative-path writes (logs/memory/output) now resolve inside the installed package location. Multiple modules create directories like memory/ and output/workflows/ relative to CWD, so this can break typical pip installs due to permissions and misplace runtime artifacts.
Agent Prompt
### Issue description
Ultimate mode forces the process CWD into the engine directory. Because many modules use relative paths (`Path("memory")`, `Path("logs")`, `output/workflows`), runtime artifacts will be written under the package directory, which is often not writable in standard pip installations.
### Issue Context
- `run_ultimate.py` calls `os.chdir(_ENGINE_DIR)` and creates `logs/` relative to CWD.
- Several agent modules create `memory/` and workflow outputs relative to CWD.
### Fix Focus Areas
- Remove `os.chdir(_ENGINE_DIR)`; do not rely on CWD for path correctness.
- Introduce a single “runtime base” directory (prefer `EVERSALE_HOME`, defaulting to `~/.eversale`), and build `logs/`, `memory/`, `output/` under it.
- Update components that use relative paths (notably workflow outputs) to use the runtime base.
- eversale/engine/run_ultimate.py[105-113]
- eversale/engine/agent/memory_architecture.py[209-210]
- eversale/engine/agent/subagent_executor.py[85-99]
- eversale/engine/agent/bootstrap.py[44-66]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Integrates the existing
captcha_solver.pyinfrastructure (1909-line module) directly intorun_simple.py's execution loop, making captcha detection and solving automatic during browser automation tasks.Changes
eversale/engine/run_simple.py(+446 lines)New imports:
base64,randomfor screenshot encoding and human-like randomizationPageCaptchaHandler,LocalCaptchaSolver,ScrappyCaptchaBypasser,AuthChallengeManager,ChallengeTypeHAS_CAPTCHA_SOLVERflag prevents crashes if captcha module unavailable6 new methods in
SimpleAgent:_detect_and_solve_captcha()_detect_and_solve_slider_captcha()_perform_human_drag()_detect_captcha_via_vision()_solve_captcha_via_vision()Main loop integration:
After each
click,type,press, ornavigateaction → automatic captcha checkDetection Strategy (3-tier)
PageCaptchaHandlerglm-4.7v→ captcha type identificationVerification ✅
Usage
💻 View my work • 👤 Initiated by @Zeeeepa • About Codegen
⛔ Remove Codegen from PR • 🚫 Ban action checks
Summary by cubic
Adds automatic captcha detection/solving to the simple agent so browsing can continue without manual steps. Confirms the package installs via pip and the
eversaleCLI runs end to end.New Features
engine/run_simple.py(DOM → slider → vision), checked after navigate/click/type/press; graceful fallback if solver missing.Bug Fixes
playwright1.58+ compatibility viaget_accessibility_snapshot()fallback.valuewhentargetisn’t a URL; supports bare domains..gitignorefor runtime artifacts.Written for commit 11c8955. Summary will update on new commits.