Skip to content

feat(eversale): Captcha solver integration + pip installability verified#55

Merged
Zeeeepa merged 6 commits into
mainfrom
codegen-bot/eversale-captcha-integration-a7f9c2
Mar 12, 2026
Merged

feat(eversale): Captcha solver integration + pip installability verified#55
Zeeeepa merged 6 commits into
mainfrom
codegen-bot/eversale-captcha-integration-a7f9c2

Conversation

@codegen-sh
Copy link
Copy Markdown
Contributor

@codegen-sh codegen-sh Bot commented Mar 12, 2026

Summary

Integrates the existing captcha_solver.py infrastructure (1909-line module) directly into run_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, random for screenshot encoding and human-like randomization
  • Captcha solver classes: PageCaptchaHandler, LocalCaptchaSolver, ScrappyCaptchaBypasser, AuthChallengeManager, ChallengeType
  • Graceful fallback: HAS_CAPTCHA_SOLVER flag prevents crashes if captcha module unavailable

6 new methods in SimpleAgent:

Method Purpose
_detect_and_solve_captcha() Main orchestrator — 3-tier detection (DOM → slider → vision)
_detect_and_solve_slider_captcha() Specialized slider/puzzle solver with vision model
_perform_human_drag() Human-like mouse drag with cubic bezier easing, wobble, overshoot
_detect_captcha_via_vision() Generic captcha detection via screenshot + vision model
_solve_captcha_via_vision() Delegates to appropriate solver based on vision description

Main loop integration:
After each click, type, press, or navigate action → automatic captcha check

Detection Strategy (3-tier)

  1. DOM-based (fast, <10ms) — Standard reCAPTCHA, hCaptcha, Turnstile via PageCaptchaHandler
  2. Slider-specific DOM (fast) — GeeTest, Chinese frameworks, canvas/iframe detection
  3. Vision fallback (slow, LLM call) — Screenshot → glm-4.7v → captcha type identification

Verification ✅

✅ run_simple.py syntax OK (ast.parse)
✅ eversale_cli.py syntax OK 
✅ pip install -e . → Successfully installed eversale-2.1.218
✅ eversale --version → "Eversale CLI v2.1.218 (Python)"
✅ eversale --help → Shows all options
✅ LLM client connects to Z.AI (glm-5) → Response: "Hello to you"
✅ eversale --headless "Navigate to example.com" → SUCCESS in 3 steps
✅ No /mnt/c/ paths in codebase
✅ All key Python files pass syntax validation

Usage

# Simple mode
eversale "Task description"

# Ultimate mode
eversale --ultimate "Complex task"

# With captcha-heavy sites
OPENAI_MODEL_VISION=glm-4.7v eversale "Navigate to chat.z.ai and sign in"

💻 View my work • 👤 Initiated by @ZeeeepaAbout 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 eversale CLI runs end to end.

  • New Features

    • Automatic captcha handling in engine/run_simple.py (DOM → slider → vision), checked after navigate/click/type/press; graceful fallback if solver missing.
    • Auto headless detection to prevent hangs in CI/WSL/Docker.
    • More robust LLM JSON parsing with retry and fence stripping.
  • Bug Fixes

    • playwright 1.58+ compatibility via get_accessibility_snapshot() fallback.
    • Loop detection for navigate↔snapshot oscillations; exits with collected data.
    • Navigate URL resolution from value when target isn’t a URL; supports bare domains.
    • CLI stdout line-buffering for real-time progress.
    • Platform-agnostic docs paths; added .gitignore for runtime artifacts.

Written for commit 11c8955. Summary will update on new commits.

codegen-sh Bot added 6 commits March 11, 2026 23:18
… 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
@Zeeeepa Zeeeepa marked this pull request as ready for review March 12, 2026 16:28
@Zeeeepa Zeeeepa merged commit 67794e8 into main Mar 12, 2026
2 checks passed
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Captcha solver integration, Playwright compatibility layer, and environment-driven LLM configuration

✨ Enhancement 🐞 Bug fix

Grey Divider

Walkthroughs

Description
  **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
Diagram
flowchart 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
Loading

Grey Divider

File Changes

1. eversale/engine/run_simple.py ✨ Enhancement +553/-25

Captcha solver integration and browser automation enhancements

• Integrated automatic captcha detection and solving with 3-tier strategy (DOM → slider → vision)
• Added 6 new methods for captcha handling: _detect_and_solve_captcha(),
 _detect_and_solve_slider_captcha(), _perform_human_drag(), _detect_captcha_via_vision(),
 _solve_captcha_via_vision()
• Enhanced LLM response parsing with retry logic, markdown fence stripping, and fallback
 interpretation
• Auto-detect headless mode on Linux when no display server available; improved URL resolution for
 navigate actions
• Integrated captcha checks after click/type/press/navigate actions; added progress output to CLI

eversale/engine/run_simple.py


2. eversale/engine/agent/a11y_compat.py Compatibility +187/-0

Playwright accessibility API compatibility layer

• New compatibility layer for Playwright accessibility snapshots across versions 1.48+
• Provides get_accessibility_snapshot() function with fallback chain: legacy API →
 aria_snapshot() → CDP
• Includes helper functions to parse aria_snapshot YAML format and CDP tree responses into legacy
 dict format

eversale/engine/agent/a11y_compat.py


3. eversale/engine/agent/bootstrap.py 🐞 Bug fix +98/-39

Path resolution and non-interactive setup improvements

• Made directory and config paths engine-relative instead of CWD-dependent using _engine_dir()
 helper
• Added _get_initialized_marker() to use EVERSALE_HOME (~/.eversale) for stable initialization
 tracking
• Made first-time setup non-interactive when stdin is not a TTY (CI/piped input environments)
• Improved backward compatibility by writing to both new and legacy marker locations

eversale/engine/agent/bootstrap.py


View more (158)
4. eversale/engine/agent/react_loop.py ✨ Enhancement +84/-0

Agent stall detection and recovery mechanism

• Added stall detection to identify when agent is stuck in observe-only loops (snapshot/navigate
 without interaction)
• Tracks last 20 tool calls and detects 6+ consecutive observe-only actions without clicks/fills
• Injects guidance prompts to force interaction or exits with collected data after 10+ stalled calls
• Distinguishes between interactive tools (click, fill, type) and observe-only tools (snapshot,
 navigate)

eversale/engine/agent/react_loop.py


5. eversale/engine/agent/playwright_direct.py 🐞 Bug fix +9/-8

Playwright compatibility and environment variable integration

• Imported get_accessibility_snapshot from new a11y_compat module for Playwright 1.48+
 compatibility
• Replaced all page.accessibility.snapshot() calls with get_accessibility_snapshot(page) wrapper
• Updated vision model references to use OPENAI_MODEL_VISION environment variable with fallback

eversale/engine/agent/playwright_direct.py


6. eversale/engine/agent/config_loader.py ✨ Enhancement +33/-8

Environment variable support for LLM model configuration

• Added propagation of OPENAI_MODEL and OPENAI_MODEL_VISION environment variables into config
 for remote API support
• Environment variables take priority over config file values and local model mappings
• Applied to both Ollama (local) and CLI (remote) modes

eversale/engine/agent/config_loader.py


7. eversale/engine/agent/agent_roles.py ✨ Enhancement +9/-6

Environment-driven model selection for agent roles

• Made default role models respect OPENAI_MODEL environment variable instead of hardcoded local
 model
• Updated DEFAULT_MODELS dict to use env var with fallback to local model
• Applied to all agent roles (PLANNER, EXECUTOR, CRITIC, HEALER, DOM_NAVIGATOR)

eversale/engine/agent/agent_roles.py


8. eversale/engine/agent/strategic_planner.py ✨ Enhancement +3/-2

Environment variable support in strategic planner

• Updated fallback LLM chain initialization to use OPENAI_MODEL environment variable
• Applied to both config-loaded and hardcoded fallback paths

eversale/engine/agent/strategic_planner.py


9. eversale/engine/agent/brain_config.py ✨ Enhancement +5/-4

Environment-driven LLM configuration defaults

• Made all default LLM models respect environment variables: OPENAI_BASE_URL, OPENAI_MODEL,
 OPENAI_MODEL_VISION
• Environment variables take priority over hardcoded defaults
• Supports OpenAI-compatible APIs like Z.AI

eversale/engine/agent/brain_config.py


10. eversale/engine/agent/accessibility_element_finder.py 🐞 Bug fix +5/-7

Accessibility snapshot compatibility updates

• Replaced page.accessibility.snapshot() calls with get_accessibility_snapshot() from new
 a11y_compat module
• Updated _get_snapshot() method to use compatibility wrapper for Playwright version independence

eversale/engine/agent/accessibility_element_finder.py


11. eversale/engine/agent/orchestration.py ✨ Enhancement +5/-1

Environment variable support in LLM response generation

• Updated _generate_llm_response() to resolve model name from OPENAI_MODEL environment variable
• Applies fallback chain: instance model → env var → default model

eversale/engine/agent/orchestration.py


12. eversale/engine/agent/a11y_browser.py 🐞 Bug fix +2/-1

Accessibility snapshot compatibility integration

• Imported and integrated get_accessibility_snapshot from a11y_compat module
• Replaced page.accessibility.snapshot() call with compatibility wrapper

eversale/engine/agent/a11y_browser.py


13. eversale/engine/agent/coordinate_targeting.py 🐞 Bug fix +2/-1

Accessibility snapshot compatibility update

• Imported get_accessibility_snapshot from a11y_compat module
• Updated snapshot retrieval to use compatibility wrapper

eversale/engine/agent/coordinate_targeting.py


14. eversale/engine/agent/dom_first_browser.py 🐞 Bug fix +2/-1

Accessibility snapshot compatibility integration

• Imported and integrated get_accessibility_snapshot from a11y_compat module
• Replaced page.accessibility.snapshot() with compatibility wrapper

eversale/engine/agent/dom_first_browser.py


15. eversale/engine/agent/cdp_browser_connector.py 🐞 Bug fix +2/-1

Accessibility snapshot compatibility update

• Imported get_accessibility_snapshot from a11y_compat module
• Updated snapshot call to use compatibility wrapper

eversale/engine/agent/cdp_browser_connector.py


16. eversale/eversale_cli.py ✨ Enhancement +6/-1

CLI stdout buffering for real-time progress

• Added stdout line-buffering configuration to ensure real-time progress display for CLI users
• Uses sys.stdout.reconfigure(line_buffering=True) with fallback for Python < 3.7

eversale/eversale_cli.py


17. eversale/engine/run_ultimate.py 🐞 Bug fix +4/-0

Engine directory path resolution fix

• Added automatic CWD change to engine directory to ensure relative paths resolve correctly
• Prevents path resolution issues when script is invoked from different directories

eversale/engine/run_ultimate.py


18. eversale/engine/agent/NL_TRIGGERS_SUMMARY.md 📝 Documentation +21/-21

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file references to use relative paths (e.g., engine/agent/...)

eversale/engine/agent/NL_TRIGGERS_SUMMARY.md


19. eversale/engine/agent/SECURITY_IMPROVEMENTS.md 📝 Documentation +13/-13

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated workspace boundary references from /mnt/c/ev29 to .
• Updated all file path references to relative paths

eversale/engine/agent/SECURITY_IMPROVEMENTS.md


20. eversale/engine/agent/ASYNC_IMPLEMENTATION_INDEX.md 📝 Documentation +10/-10

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file location references to relative paths

eversale/engine/agent/ASYNC_IMPLEMENTATION_INDEX.md


21. eversale/engine/agent/humanization/FAST_TRACK_CHANGELOG.md 📝 Documentation +8/-8

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file references to use relative paths

eversale/engine/agent/humanization/FAST_TRACK_CHANGELOG.md


22. eversale/engine/agent/IMPLEMENTATION_COMPLETE.md 📝 Documentation +11/-11

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/IMPLEMENTATION_COMPLETE.md


23. eversale/engine/agent/VALIDATION_ENHANCEMENT_SUMMARY.md 📝 Documentation +10/-10

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/VALIDATION_ENHANCEMENT_SUMMARY.md


24. eversale/engine/agent/SNAPSHOT_CONFLICT_ANALYSIS.md 📝 Documentation +6/-6

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file location references to relative paths

eversale/engine/agent/SNAPSHOT_CONFLICT_ANALYSIS.md


25. eversale/engine/agent/ASYNC_IMPLEMENTATION_COMPLETE.md 📝 Documentation +7/-7

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/ASYNC_IMPLEMENTATION_COMPLETE.md


26. eversale/engine/agent/DEVTOOLS_CHECKLIST.md 📝 Documentation +8/-8

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/DEVTOOLS_CHECKLIST.md


27. eversale/engine/agent/INTEGRATION_CHECKLIST.md 📝 Documentation +10/-10

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/INTEGRATION_CHECKLIST.md


28. eversale/engine/agent/HISTORY_PRUNER_INDEX.md 📝 Documentation +8/-8

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/HISTORY_PRUNER_INDEX.md


29. eversale/engine/agent/CHANGES_SUMMARY.md 📝 Documentation +6/-6

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/CHANGES_SUMMARY.md


30. eversale/engine/RUN_SIMPLE_INTEGRATION.md 📝 Documentation +9/-9

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/RUN_SIMPLE_INTEGRATION.md


31. eversale/engine/agent/CONFLICT_REPORT.txt 📝 Documentation +8/-8

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/CONFLICT_REPORT.txt


32. eversale/engine/agent/STRUCTURED_LOGGER_README.md 📝 Documentation +10/-10

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/STRUCTURED_LOGGER_README.md


33. eversale/engine/agent/A11Y_PHASE5_COMPLETE.md 📝 Documentation +10/-10

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/A11Y_PHASE5_COMPLETE.md


34. eversale/engine/agent/CAPTCHA_SOLVER_CHANGELOG.md 📝 Documentation +8/-8

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/CAPTCHA_SOLVER_CHANGELOG.md


35. eversale/engine/agent/COMPLEX_FORM_INTEGRATION.md 📝 Documentation +6/-6

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/COMPLEX_FORM_INTEGRATION.md


36. eversale/engine/agent/STEALTH_AUDIT_FIXES.md 📝 Documentation +6/-6

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/STEALTH_AUDIT_FIXES.md


37. eversale/engine/agent/SELECTOR_FALLBACKS_SUMMARY.md 📝 Documentation +6/-6

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/SELECTOR_FALLBACKS_SUMMARY.md


38. eversale/engine/agent/UI_TARS_CAPTCHA_UPGRADE.patch 📝 Documentation +5/-5

Documentation path normalization

• Removed absolute /mnt/c/ paths from patch file
• Updated all file path references to relative paths

eversale/engine/agent/UI_TARS_CAPTCHA_UPGRADE.patch


39. eversale/engine/agent/reddit_commenters_usage.md 📝 Documentation +2/-2

Documentation path normalization

• Removed absolute /mnt/c/ paths from documentation
• Updated all file path references to relative paths

eversale/engine/agent/reddit_commenters_usage.md


40. eversale/engine/agent/RELIABLE_BROWSER_INTEGRATION_COMPLETE.md 📝 Documentation +5/-5

Remove absolute paths, use relative paths for portability

• Removed absolute Windows paths (/mnt/c/ev29/cli/) and replaced with relative paths (engine/)
• Updated all file location references to use platform-agnostic relative paths
• Improved documentation portability across different development environments

eversale/engine/agent/RELIABLE_BROWSER_INTEGRATION_COMPLETE.md


41. eversale/engine/LINKEDIN_SEARCH_QUICK_REF.md 📝 Documentation +8/-8

Normalize file paths to relative references

• Replaced absolute Windows paths with relative paths throughout the document
• Updated file references from /mnt/c/ev29/cli/engine/ to engine/
• Improved cross-platform compatibility for documentation

eversale/engine/LINKEDIN_SEARCH_QUICK_REF.md


42. eversale/engine/RUN_SIMPLE_SUMMARY.md 📝 Documentation +6/-6

Convert absolute to relative file paths

• Converted absolute paths to relative paths for all file references
• Updated directory navigation examples to use relative paths
• Enhanced documentation portability across platforms

eversale/engine/RUN_SIMPLE_SUMMARY.md


43. eversale/engine/agent/SNAPSHOT_CONFLICTS_INDEX.md 📝 Documentation +7/-7

Standardize paths to relative format

• Replaced all /mnt/c/ev29/cli/ absolute paths with engine/ relative paths
• Updated file location references throughout the conflict analysis document
• Improved documentation accessibility across different systems

eversale/engine/agent/SNAPSHOT_CONFLICTS_INDEX.md


44. eversale/engine/agent/PROTECTION_TRIGGERS_IMPLEMENTATION_SUMMARY.md 📝 Documentation +7/-7

Replace absolute paths with relative paths

• Changed absolute Windows paths to relative paths
• Updated deployment instructions to use relative paths
• Improved cross-platform documentation consistency

eversale/engine/agent/PROTECTION_TRIGGERS_IMPLEMENTATION_SUMMARY.md


45. eversale/engine/agent/CACHING_SUMMARY.md 📝 Documentation +6/-6

Normalize paths to relative format

• Converted all /mnt/c/ev29/cli/ paths to engine/ relative paths
• Updated file location references in implementation summary
• Enhanced documentation portability

eversale/engine/agent/CACHING_SUMMARY.md


46. eversale/engine/ORCHESTRATION_PROSPECT_FIX.md 📝 Documentation +5/-5

Convert paths to relative format

• Replaced absolute paths with relative paths throughout the document
• Updated test script location references
• Improved documentation for cross-platform use

eversale/engine/ORCHESTRATION_PROSPECT_FIX.md


47. eversale/engine/agent/LLM_FALLBACK_CHAIN.md 📝 Documentation +6/-6

Standardize file paths to relative format

• Changed absolute paths to relative paths in configuration and file references
• Updated directory navigation examples
• Improved documentation portability

eversale/engine/agent/LLM_FALLBACK_CHAIN.md


48. eversale/engine/agent/FLASH_MODE_CONFLICT_ANALYSIS.md 📝 Documentation +5/-5

Remove absolute paths, use relative paths

• Replaced /mnt/c/ev29/cli/ absolute paths with engine/ relative paths
• Updated all file location references
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/FLASH_MODE_CONFLICT_ANALYSIS.md


49. eversale/engine/RUN_SIMPLE_QUICKSTART.md 📝 Documentation +7/-7

Normalize paths to relative format

• Converted absolute Windows paths to relative paths throughout the document
• Updated configuration file references and code structure examples
• Improved documentation accessibility across platforms

eversale/engine/RUN_SIMPLE_QUICKSTART.md


50. eversale/engine/agent/config/IMPLEMENTATION_SUMMARY.md 📝 Documentation +6/-6

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated test execution examples to use relative paths
• Enhanced cross-platform documentation consistency

eversale/engine/agent/config/IMPLEMENTATION_SUMMARY.md


51. eversale/engine/agent/RUST_INTEGRATION.md 📝 Documentation +7/-7

Standardize paths to relative format

• Changed all /mnt/c/ev29/ absolute paths to relative paths
• Updated build and test instructions to use relative paths
• Improved documentation portability across systems

eversale/engine/agent/RUST_INTEGRATION.md


52. eversale/engine/agent/STEALTH_IMPROVEMENTS_SUMMARY.md 📝 Documentation +5/-5

Remove absolute paths, use relative paths

• Replaced absolute Windows paths with relative paths
• Updated file location references throughout the document
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/STEALTH_IMPROVEMENTS_SUMMARY.md


53. eversale/engine/agent/UI_TARS_INTEGRATION_AUDIT.md 📝 Documentation +5/-5

Normalize file paths to relative format

• Converted absolute paths to relative paths in file references
• Updated test file creation and execution examples
• Improved documentation portability

eversale/engine/agent/UI_TARS_INTEGRATION_AUDIT.md


54. eversale/engine/agent/VERIFICATION_LOG_ROTATION.md 📝 Documentation +7/-7

Convert absolute to relative file paths

• Replaced /mnt/c/ev29/cli/ absolute paths with engine/ relative paths
• Updated file location references and test execution examples
• Enhanced cross-platform documentation consistency

eversale/engine/agent/VERIFICATION_LOG_ROTATION.md


55. eversale/engine/agent/SECURITY_FIXES.md 📝 Documentation +5/-5

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated test execution examples to use relative paths
• Improved documentation accessibility across platforms

eversale/engine/agent/SECURITY_FIXES.md


56. eversale/engine/agent/HISTORY_PRUNER_CODE_REFERENCES.md 📝 Documentation +4/-4

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths throughout the document
• Updated file location references for all modules
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/HISTORY_PRUNER_CODE_REFERENCES.md


57. eversale/engine/agent/TRIGGER_IMPLEMENTATION_SUMMARY.md 📝 Documentation +5/-5

Normalize paths to relative format

• Converted absolute paths to relative paths in file references
• Updated example execution and test commands
• Improved documentation portability

eversale/engine/agent/TRIGGER_IMPLEMENTATION_SUMMARY.md


58. eversale/engine/LINKEDIN_FALLBACK_FIX.md 📝 Documentation +6/-6

Convert absolute to relative file paths

• Replaced absolute paths with relative paths throughout the document
• Updated test execution examples and file references
• Enhanced cross-platform documentation consistency

eversale/engine/LINKEDIN_FALLBACK_FIX.md


59. eversale/engine/agent/CAPTCHA_SOLVER_TEST_REPORT.md 📝 Documentation +6/-6

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated test file and documentation location references
• Improved documentation accessibility

eversale/engine/agent/CAPTCHA_SOLVER_TEST_REPORT.md


60. eversale/engine/agent/stealth_fixes_diagram.txt 📝 Documentation +6/-6

Remove absolute paths, use relative paths

• Replaced /mnt/c/ev29/ absolute paths with engine/ and ./ relative paths
• Updated file location references in ASCII diagram
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/stealth_fixes_diagram.txt


61. eversale/engine/agent/BROWSER_IMPROVEMENTS_EXPORTS.md 📝 Documentation +5/-5

Normalize file paths to relative format

• Converted absolute paths to relative paths in file references
• Updated documentation file location references
• Improved cross-platform documentation consistency

eversale/engine/agent/BROWSER_IMPROVEMENTS_EXPORTS.md


62. eversale/engine/agent/CAPTCHA_SOLVER_SUMMARY.txt 📝 Documentation +5/-5

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated test file and documentation location references
• Enhanced documentation portability

eversale/engine/agent/CAPTCHA_SOLVER_SUMMARY.txt


63. eversale/engine/agent/FB_ADS_EXTRACTION_IMPROVEMENTS.md 📝 Documentation +5/-5

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated test execution examples and related code locations
• Improved documentation accessibility across platforms

eversale/engine/agent/FB_ADS_EXTRACTION_IMPROVEMENTS.md


64. eversale/engine/agent/PLANNING_AGENT_QUICKSTART.md 📝 Documentation +6/-6

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths throughout the document
• Updated file location references and example paths
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/PLANNING_AGENT_QUICKSTART.md


65. eversale/engine/agent/PROTECTION_TRIGGERS_README.md 📝 Documentation +5/-5

Normalize paths to relative format

• Converted absolute paths to relative paths in file references
• Updated file location references for modified and created files
• Improved documentation portability

eversale/engine/agent/PROTECTION_TRIGGERS_README.md


66. eversale/engine/agent/SLEEP_OPTIMIZATION_VERIFICATION.md 📝 Documentation +5/-5

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated file location references for verified modules
• Enhanced cross-platform documentation consistency

eversale/engine/agent/SLEEP_OPTIMIZATION_VERIFICATION.md


67. eversale/engine/RUN_SIMPLE_INDEX.md 📝 Documentation +6/-6

Standardize paths to relative format

• Changed absolute paths to relative paths throughout the document
• Updated file location references and directory structure examples
• Improved documentation accessibility

eversale/engine/RUN_SIMPLE_INDEX.md


68. eversale/engine/agent/A11Y_ASSERTION_METHODS.md 📝 Documentation +4/-4

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths in file references
• Updated test execution examples and file location references
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/A11Y_ASSERTION_METHODS.md


69. eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md 📝 Documentation +6/-6

Normalize file paths to relative format

• Converted absolute paths to relative paths in file references
• Updated test execution examples and related file locations
• Improved documentation portability

eversale/engine/agent/NL_TRIGGERS_QUICK_REF.md


70. eversale/engine/agent/HISTORY_PRUNER_SUMMARY.txt 📝 Documentation +5/-5

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated source file and documentation location references
• Enhanced cross-platform documentation consistency

eversale/engine/agent/HISTORY_PRUNER_SUMMARY.txt


71. eversale/engine/agent/ASYNC_IMPLEMENTATION_SUMMARY.md 📝 Documentation +3/-3

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated file structure examples and documentation location references
• Improved documentation accessibility

eversale/engine/agent/ASYNC_IMPLEMENTATION_SUMMARY.md


72. eversale/engine/agent/GOOGLE_MAPS_URL_EXTRACTION_SUMMARY.md 📝 Documentation +5/-5

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths in file references
• Updated test script location and execution examples
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/GOOGLE_MAPS_URL_EXTRACTION_SUMMARY.md


73. eversale/engine/agent/LOCAL_PLANNER_OPTIMIZATIONS.md 📝 Documentation +4/-4

Normalize paths to relative format

• Converted absolute paths to relative paths in file references
• Updated related file location references
• Improved documentation portability

eversale/engine/agent/LOCAL_PLANNER_OPTIMIZATIONS.md


74. eversale/engine/agent/SEARCH_HANDLER_INTEGRATION.md 📝 Documentation +5/-5

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated test execution examples and related file locations
• Enhanced cross-platform documentation consistency

eversale/engine/agent/SEARCH_HANDLER_INTEGRATION.md


75. eversale/engine/agent/STEALTH_UPGRADE_PATCH.md 📝 Documentation +3/-3

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated file location references for new and modified files
• Improved documentation accessibility

eversale/engine/agent/STEALTH_UPGRADE_PATCH.md


76. eversale/engine/agent/utils/VALIDATORS_CONSOLIDATION.md 📝 Documentation +4/-4

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths in file references
• Updated file location references for created modules
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/utils/VALIDATORS_CONSOLIDATION.md


77. eversale/engine/agent/TOKEN_OPTIMIZER_README.md 📝 Documentation +5/-5

Normalize file paths to relative format

• Converted absolute paths to relative paths in file references
• Updated test execution examples and related file locations
• Improved documentation portability

eversale/engine/agent/TOKEN_OPTIMIZER_README.md


78. eversale/engine/agent/RELIABLE_BROWSER_USAGE.md 📝 Documentation +3/-3

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated file location references for all modules
• Enhanced cross-platform documentation consistency

eversale/engine/agent/RELIABLE_BROWSER_USAGE.md


79. eversale/engine/agent/CONCURRENT_LOCKS_QUICKREF.md 📝 Documentation +6/-6

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated file location references throughout the document
• Improved documentation accessibility

eversale/engine/agent/CONCURRENT_LOCKS_QUICKREF.md


80. eversale/engine/agent/SELECTOR_FALLBACKS_CHEATSHEET.md 📝 Documentation +5/-5

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths in file references
• Updated code and documentation file location references
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/SELECTOR_FALLBACKS_CHEATSHEET.md


81. eversale/engine/agent/FAST_MODE_IMPLEMENTATION_CHECKLIST.md 📝 Documentation +5/-5

Normalize paths to relative format

• Converted absolute paths to relative paths in file references
• Updated publish commands and file location references
• Improved documentation portability

eversale/engine/agent/FAST_MODE_IMPLEMENTATION_CHECKLIST.md


82. eversale/engine/agent/SIMPLE_AGENT_README.md 📝 Documentation +5/-5

Convert absolute to relative file paths

• Replaced absolute paths with relative paths in file references
• Updated test execution examples and file location references
• Enhanced cross-platform documentation consistency

eversale/engine/agent/SIMPLE_AGENT_README.md


83. eversale/engine/agent/A11Y_OPTIMIZATION_SUMMARY.md 📝 Documentation +4/-4

Standardize paths to relative format

• Changed absolute paths to relative paths in file references
• Updated key files modified section with relative paths
• Improved documentation accessibility

eversale/engine/agent/A11Y_OPTIMIZATION_SUMMARY.md


84. eversale/engine/agent/ELEMENT_INSPECTOR_INTEGRATION.md 📝 Documentation +5/-5

Remove absolute paths, use relative paths

• Replaced absolute paths with relative paths in file references
• Updated related documentation file location references
• Enhanced cross-platform documentation compatibility

eversale/engine/agent/ELEMENT_INSPECTOR_INTEGRATION.md


85. eversale/engine/agent/VALIDATION_QUICK 📦 Other +0/-0

eversale/engine/agent/VALIDATION_QUICK


86. eversale/engine/agent/A11Y_ASSERTIONS_QUICK_REF.md Additional files +2/-2

...

eversale/engine/agent/A11Y_ASSERTIONS_QUICK_REF.md


87. eversale/engine/agent/ACCESSIBILITY_ELEMENT_FINDER_ARCHITECTURE.txt Additional files +1/-1

...

eversale/engine/agent/ACCESSIBILITY_ELEMENT_FINDER_ARCHITECTURE.txt


88. eversale/engine/agent/ACCESSIBILITY_INTEGRATION_GUIDE.md Additional files +1/-1

...

eversale/engine/agent/ACCESSIBILITY_INTEGRATION_GUIDE.md


89. eversale/engine/agent/ACTION_VALIDATION_GUIDE.md Additional files +1/-1

...

eversale/engine/agent/ACTION_VALIDATION_GUIDE.md


90. eversale/engine/agent/ASSERTION_IMPLEMENTATION_SUMMARY.md Additional files +2/-2

...

eversale/engine/agent/ASSERTION_IMPLEMENTATION_SUMMARY.md


91. eversale/engine/agent/ASYNC_SKILL_LIBRARY_USAGE.md Additional files +1/-1

...

eversale/engine/agent/ASYNC_SKILL_LIBRARY_USAGE.md


92. eversale/engine/agent/AUTO_OPTIMIZE_SUMMARY.md Additional files +2/-2

...

eversale/engine/agent/AUTO_OPTIMIZE_SUMMARY.md


93. eversale/engine/agent/BENCHMARK_INDEX.md Additional files +1/-1

...

eversale/engine/agent/BENCHMARK_INDEX.md


94. eversale/engine/agent/BROWSER_BACKEND_COMPARISON.md Additional files +1/-1

...

eversale/engine/agent/BROWSER_BACKEND_COMPARISON.md


95. eversale/engine/agent/CAPTCHA_CONFIDENCE_SCORING.md Additional files +3/-3

...

eversale/engine/agent/CAPTCHA_CONFIDENCE_SCORING.md


96. eversale/engine/agent/CAPTCHA_QUICK_REFERENCE.md Additional files +4/-4

...

eversale/engine/agent/CAPTCHA_QUICK_REFERENCE.md


97. eversale/engine/agent/CAPTCHA_VISION_IMPROVEMENTS.md Additional files +1/-1

...

eversale/engine/agent/CAPTCHA_VISION_IMPROVEMENTS.md


98. eversale/engine/agent/CDP_CONNECTOR_README.md Additional files +2/-2

...

eversale/engine/agent/CDP_CONNECTOR_README.md


99. eversale/engine/agent/COMPLEX_FORM_HANDLER_README.md Additional files +1/-1

...

eversale/engine/agent/COMPLEX_FORM_HANDLER_README.md


100. eversale/engine/agent/COMPLEX_FORM_QUICKREF.md Additional files +1/-1

...

eversale/engine/agent/COMPLEX_FORM_QUICKREF.md


101. eversale/engine/agent/CONCURRENT_LOCKS_SUMMARY.md Additional files +1/-1

...

eversale/engine/agent/CONCURRENT_LOCKS_SUMMARY.md


102. eversale/engine/agent/CONFIG_VALIDATOR_GUIDE.md Additional files +5/-5

...

eversale/engine/agent/CONFIG_VALIDATOR_GUIDE.md


103. eversale/engine/agent/CONFLICT_INVESTIGATION_SUMMARY.txt Additional files +1/-1

...

eversale/engine/agent/CONFLICT_INVESTIGATION_SUMMARY.txt


104. eversale/engine/agent/DATE_PICKER_CHECKLIST.md Additional files +1/-1

...

eversale/engine/agent/DATE_PICKER_CHECKLIST.md


105. eversale/engine/agent/DATE_PICKER_INDEX.md Additional files +3/-3

...

eversale/engine/agent/DATE_PICKER_INDEX.md


106. eversale/engine/agent/DATE_PICKER_README.md Additional files +1/-1

...

eversale/engine/agent/DATE_PICKER_README.md


107. eversale/engine/agent/DEAD_CODE_ANALYSIS.md Additional files +3/-3

...

eversale/engine/agent/DEAD_CODE_ANALYSIS.md


108. eversale/engine/agent/DEVTOOLS_SUMMARY.md Additional files +1/-1

...

eversale/engine/agent/DEVTOOLS_SUMMARY.md


109. eversale/engine/agent/DOM_FIRST_BROWSER_QUICKREF.md Additional files +1/-1

...

eversale/engine/agent/DOM_FIRST_BROWSER_QUICKREF.md


110. eversale/engine/agent/DOM_FIRST_BROWSER_README.md Additional files +1/-1

...

eversale/engine/agent/DOM_FIRST_BROWSER_README.md


111. eversale/engine/agent/FAST_MODE_README.md Additional files +1/-1

...

eversale/engine/agent/FAST_MODE_README.md


112. eversale/engine/agent/FAST_MODE_SUMMARY.md Additional files +2/-2

...

eversale/engine/agent/FAST_MODE_SUMMARY.md


113. eversale/engine/agent/IMPLEMENTATION_VERIFICATION.md Additional files +1/-1

...

eversale/engine/agent/IMPLEMENTATION_VERIFICATION.md


114. eversale/engine/agent/INTEGRATION_DOCUMENTATION.md Additional files +1/-1

...

eversale/engine/agent/INTEGRATION_DOCUMENTATION.md


115. eversale/engine/agent/INTEGRATION_SUMMARY.md Additional files +1/-1

...

eversale/engine/agent/INTEGRATION...

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Mar 12, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Vision captcha checks always 🐞 Bug ⛨ Security
Description
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.
Code

eversale/engine/run_simple.py[R958-985]

+        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,
+            )
Evidence
The main loop triggers captcha handling after common actions; the captcha handler always reaches the
vision layer unless a captcha was detected+solved earlier, and that vision layer always takes a
screenshot and calls the LLM. Separately, the default LLM client selects remote mode for CLI usage,
making this screenshot call a remote upload by default.

eversale/engine/run_simple.py[1126-1128]
eversale/engine/run_simple.py[636-677]
eversale/engine/run_simple.py[961-985]
eversale/engine/agent/llm_client.py[208-224]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### 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 &quot;captcha&quot;, 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


2. Package CWD forced 🐞 Bug ⛯ Reliability
Description
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.
Code

eversale/engine/run_ultimate.py[R105-111]

+# 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
Evidence
Ultimate mode explicitly chdirs into the engine directory and immediately creates logs/ relative
to CWD. Other engine modules create memory/ and output/workflows/ relative to CWD as part of
normal operation; combined with the new chdir, these artifacts will be attempted under the package
directory.

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]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Ultimate mode forces the process CWD into the engine directory. Because many modules use relative paths (`Path(&quot;memory&quot;)`, `Path(&quot;logs&quot;)`, `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



Remediation recommended

3. Debug prints in hot-loop 🐞 Bug ✧ Quality
Description
ReactLoop writes [DEBUG-TOOL] messages to stderr and stdout on every tool-execution iteration,
polluting CLI output and adding avoidable I/O overhead. One of the prints is also incorrect and
always renders an empty tool name (repr("")).
Code

eversale/engine/agent/react_loop.py[R965-966]

+                import sys; sys.stderr.write(f'[DEBUG-TOOL] current_tool={current_tool!r} history={self._recent_tool_history[-6:] if self._recent_tool_history else []}\n')
+                print(f'[DEBUG-TOOL] current_tool={repr("")} history={self._recent_tool_history[-6:] if self._recent_tool_history else []}')
Evidence
The new debug output is unconditional and sits in the core tool-call loop; it will run for every
iteration and the second print is clearly a bug because it prints repr("") rather than the
computed current_tool.

eversale/engine/agent/react_loop.py[963-966]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The ReAct loop currently emits unconditional debug output on every tool-call iteration, and one line is plainly incorrect (`repr(&quot;&quot;)`). This pollutes user output and adds I/O overhead.

### Issue Context
These messages are in the hot path of tool execution and are not guarded by a debug flag.

### Fix Focus Areas
- Remove the prints, or guard them behind an explicit debug flag (e.g., `_DEBUG_MODE` / `EVERSALE_DEBUG`).
- If keeping output, use `logger.debug(...)` instead of `print`/`sys.stderr.write`.
- Fix the incorrect `repr(&quot;&quot;)` to reference `current_tool`.

- eversale/engine/agent/react_loop.py[963-966]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Fix with Cubic

Quick test:
```bash
cd /mnt/c/ev29/cli/engine/agent
cd engine/agent
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Fix with Cubic

- `/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
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
- `engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser
- `eversale/engine/agent/command_parser.py` - Added SYSTEM2_PATTERNS and parser
Fix with Cubic

Run tests with:
```bash
cd /mnt/c/ev29/cli/engine/agent
cd engine/agent
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Fix with Cubic

Run the test suite to see all supported patterns:
```bash
cd /mnt/c/ev29/cli/engine/agent
cd engine/agent
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Fix with Cubic

### Enable/Disable Fast Mode

In `/mnt/c/ev29/cli/engine/config/config.yaml`:
In `engine/config/config.yaml`:
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
In `engine/config/config.yaml`:
In `~/.eversale/engine/config/config.yaml`:
Fix with Cubic

**Run Integration Tests**:
```bash
cd /mnt/c/ev29/cli/engine/agent
cd engine/agent
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Fix with Cubic

## 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.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

### Run tests:
```bash
cd /mnt/c/ev29/cli/engine/agent
cd engine/agent
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Fix with Cubic

Comment on lines +234 to +238
- 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`
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
- 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`
Fix with Cubic

Comment on lines +958 to +985
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,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

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

Comment on lines +105 to 111
# 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant