Inspiration
AI coding agents can work for a long time, but a single “Continue” prompt can suddenly interrupt the entire workflow. The interruption is small, yet it breaks context, attention, and momentum.
I wanted to automate that repetitive click without creating a dangerous bot that blindly clicks anything labeled “Continue.”
What I built
Trae Auto-Continue Watcher is a local, safety-first watcher for a CDP-enabled Trae Work session.
It recognizes a narrow continuation contract: a visible prompt containing Input「Continue」to get more content, together with exactly one visible and enabled Continue button in the same DOM region.
In live mode, the watcher:
- requires two consecutive matching observations before clicking;
- verifies the prompt and button belong to the same rendered session;
- resolves a fresh DOM node immediately before clicking;
- limits automatic invocations per session;
- verifies that the original prompt disappears after the click;
- stops safely whenever the evidence is missing, ambiguous, stale, or changing.
It never types into the composer, uses screen coordinates, relies on screenshots, or guesses what to click with an LLM.
How I built it
I built the project as a small Windows-friendly Node.js CLI using the Chrome DevTools Protocol. It reads the accessibility tree first, then inspects the DOM and box geometry only when a possible continuation prompt is found.
The watcher uses loopback-only CDP communication, opaque redacted JSONL logs, session-bound candidate IDs, bounded reconnects, and fail-closed safety checks. The project currently has 91 automated tests covering detection, DOM boundaries, stale nodes, reconnects, aborts, click caps, verification, and logging.
What I learned
The accessibility tree was more useful than a simple text query for detecting the real user-facing state. I also learned that invoking element.click() is not the same as proving that the application resumed successfully: the UI can re-render immediately, so post-click verification must be treated as a separate state.
Another important lesson was that virtualized interfaces may expose historical prompt nodes outside the active card. Candidate validation must be region-aware instead of treating every matching node on the page as part of the same action.
Challenges
The hardest part was defining what “safe to click” means. A visible button alone is not enough. The watcher must prove the prompt, button, DOM region, rendered session, and current backend node all agree.
I used Codex with GPT-5.6 to turn the initial idea into a precise safety contract, split the implementation into testable modules, inspect real CDP accessibility data, write regression tests before fixes, and iterate on a live acceptance issue. GPT-5.6 and Codex helped build the tool; the runtime itself remains deterministic and auditable.
Built With
- codex
- node.js
Log in or sign up for Devpost to join the conversation.