Local Qwen Models Achieve Browser Automation with Stepwise Planning and Compact DOM

✍️ OpenClawRadar📅 Published: March 17, 2026🔗 Source
Local Qwen Models Achieve Browser Automation with Stepwise Planning and Compact DOM
Ad

Stepwise Planning Overcomes Upfront Planning Failures

The developer discovered that asking models to invent a full multi-step plan before seeing the real page state works on familiar sites but breaks quickly on unexpected elements. What worked better was stepwise planning where the model replans from the current DOM snapshot at each step.

Example Flow on Ace Hardware

The tested flow with Qwen 8B as planner and 4B as executor on Ace Hardware (a site the model had no prior task for) completed a full cart flow with zero vision model usage. The stepwise approach looked like this:

  • Step 1: see search box → TYPE "grass mower"
  • Step 2: see results → CLICK Add to Cart
  • Step 3: drawer appears → dismiss it
  • Step 4: cart visible → CLICK View Cart
  • Step 5: DONE
Ad

Compact DOM Representation Enables Small Models

The model never sees raw HTML or screenshots—just a semantic table representation:

id|role|text|importance|bg|clickable|nearby_text
665|button|Proceed to checkout|675|orange|1|
761|button|Add to cart|720|yellow|1|$299.99
1488|link|ThinkPad E16|478|none|1|Laptop 16"

This allows the 4B executor to pick an element ID from a short list. Vision approaches burn 2-3K tokens per screenshot, easily 50-100K+ for a full flow, while compact snapshots use ~15K total for the same task.

Modal Handling Critical for Success

After each click, if the DOM suddenly grows, the agent scans for dismiss patterns (close, ×, no thanks, etc.) before planning again. This fixed many failures that appeared to be "bad reasoning" but were actually hidden overlays.

The developer notes being curious if others are seeing stepwise planning beat upfront planning once sites get unfamiliar.

📖 Read the full source: r/LocalLLaMA

Ad

👀 See Also

Context Gateway: An Open-Source Proxy for Compressing AI Agent Context
Tools

Context Gateway: An Open-Source Proxy for Compressing AI Agent Context

Context Gateway is an open-source proxy that sits between coding agents and LLMs, compressing tool outputs before they enter the context window. It uses small language models to detect signal in context, performs background compaction at 85% window capacity, and includes spending caps, a dashboard, and Slack notifications.

OpenClawRadar
OpenClaw Codex-GPT5.4 Task Validation Loop Issue
Tools

OpenClaw Codex-GPT5.4 Task Validation Loop Issue

A developer reports Codex-GPT5.4 through OpenClaw gets stuck in a task validation loop during autonomous project work, repeatedly identifying and confirming tasks without executing them. They've implemented workspace controls including TASKS.md, heartbeat rules, and persona files to address the issue.

OpenClawRadar
AI Doomsday Toolbox v0.932 adds benchmarking, dataset creation, and agent workspace for Android local AI
Tools

AI Doomsday Toolbox v0.932 adds benchmarking, dataset creation, and agent workspace for Android local AI

AI Doomsday Toolbox v0.932 introduces benchmarking for local LLMs on Android devices, a dataset creator that converts text/PDF files to Alpaca JSON format, and an AI agent workspace with Termux integration. The update also includes subtitle burning with Whisper and built-in Ollama management tools.

OpenClawRadar
Engram v1.0.0: Persistent Memory for Local LLMs via Knowledge Graph
Tools

Engram v1.0.0: Persistent Memory for Local LLMs via Knowledge Graph

Engram is a single binary that provides persistent memory for local LLMs through a knowledge graph system. It includes an MCP server for integration with Claude Code, Cursor, and Windsurf, stores all data in a single .brain file, and runs fully offline.

OpenClawRadar