Repository navigation
Description
Grok Bot's only headline feature with no open equivalent in this stack: watch the operator perform a workflow (browser demonstration), then persist it as something a teammate can run again.
Updated 2026-10-30. This issue predates the v0.2 rewrite and originally described compiling demonstrations into an OpenClaw
SKILL.md. OpenGrokBot has had its own core since v0.2 (a gateway, a web client, one container per teammate; the old recipe is kept in docs/openclaw-recipe), so the artifact is now native. The shape below reflects that; the direction is the one @bferanmi806-sketch laid out in the comments.
Proposed shape
- Record: the operator drives the teammate's own persistent Chromium through the computer panel (noVNC), exactly as today. The gateway already holds a Playwright/CDP connection to that browser; instrument it to capture semantic events (navigation, click, input, select) rather than pixels or raw DOM mutations. Input into password or otherwise secret fields is recorded as "a value was entered here", never the value itself.
- Compile: turn the trace into a small typed workflow (intent, steps with locators and expected page states), stored with the teammate the way memory and routines are. No generated JavaScript: the model writes the intent and step descriptions, the recorder supplies the mechanics.
- Replay with judgment: run the deterministic steps first; when a locator or page has drifted, hand that step to the agent with the recorded intent, let it continue, and offer to re-record the step afterwards.
- Routines run workflows: a workflow describes how; a routine (cron, webhook or watch) decides when. Approvals, standing rules and the action log apply to a replayed step exactly as to any other tool call.
Non-goals (v1): cross-app desktop recording, mobile, exporting workflows to other tools.
Prior art to evaluate: Playwright codegen (event capture, locator generation), rrweb (the event model, not the replay), WebArena-style trace formats, and the shared-skill playbooks already in <data>/skills/ as the human-readable half.
Suggested slices, each its own PR: recorder + trace format → deterministic workflow runner → agent fallback and routine integration. A short design note on the trace schema before the first slice would be ideal.
If you want this to exist, 👍 the issue or comment with your workflow — the first three concrete recorded-workflow examples will shape the trace format.
Maintainer note: design discussion welcome before any code; this issue is the roadmap anchor linked from the README.
Activity
bferanmi806-sketch commentedon Aug 16, 2026
I’d love to work on this. I traced the current v0.2 path from the computer panel through the Docker/noVNC browser, the gateway’s Playwright CDP connection, routines, and the agent tool loop before proposing an implementation.
One thing I wanted to confirm first: this issue predates the v0.2 self-built-core merge and still describes compiling demonstrations into an OpenClaw
SKILL.md. Currentmainno longer appears to have an OpenClaw skill runtime, so I think the record → compile → deterministic replay goal still fits, but the artifact probably wants to be native to OpenGrokBot now.My current direction would be:
I’d probably split it into recorder/trace foundation → deterministic workflow runner → agent/routine integration rather than land teach-mode as one large PR.
Does that match where you want #1 to go after the v0.2 rewrite? If so, I’m happy to take the first slice
wolfqing commentedon Oct 30, 2026
Thanks for the thorough read, and sorry for the long silence. Yes, your direction matches where #1 should go after the v0.2 rewrite: record against the bot's own persistent Chromium through the existing CDP context, compile into a small typed workflow rather than generated JS, never persist secret input, replay deterministically and hand off to the agent on drift, and keep workflows ("how") separate from routines ("when"). Splitting it into recorder/trace → deterministic runner → agent/routine integration is the right shape too.
I've refreshed the issue body to drop the OpenClaw
SKILL.mdframing. If you're still interested, the first slice (recorder + trace format) is yours; a short design note on the trace schema before code would be ideal.bferanmi806-sketch commentedon Oct 31, 2026
Trace schema v1
I propose keeping a recorded workflow as a versioned, typed JSON document, separate from routines. A workflow describes how to do something; a routine may later decide when to run it. The first slice records traces only and does not add replay or scheduling.
The recorder should attach to the teammate's existing persistent Chromium
Pagesupplied by the sharedBrowserSession; it must not launch a second browser or replace the logged-in context. A recording session explicitly starts and stops event capture on that page. Each action stores semantic locators in a resilient preference order (role/name, label, placeholder, test id, then CSS), without generating executable JavaScript.Redaction is enforced before serialization. Password and one-time-code fields, sensitive
autocompletevalues, and fields whose accessible/name metadata indicates a password, secret, token, or API key produce a redacted fill/select step with no input value. Navigation URLs lose user-info and fragments; query values are omitted by default so session tokens cannot leak through URLs. The trace never stores page text, screenshots, cookies, or other browser state.The format leaves room for later deterministic replay: locator candidates are tried in order, and a redacted step can ask the operator for a value at replay time. That runner and routine integration remain out of this first slice. If this shape fits, I’ll proceed with the recorder and schema validation/tests only.
wolfqing commentedon Nov 1, 2026
Thanks — this is a clear note, and the overall shape is right: one document per workflow with a version number, a recorder that attaches to the teammate's existing browser, redaction before anything is written, and no generated JS. Please go ahead with the recorder and schema slice. A few things I'd like folded in first:
1. Build on v0.4.0. A teammate's computer can now be local, not only Docker. Since your note, v0.4.0 added local computers: on macOS and Linux a teammate can get a browser on the host instead of a container. Both kinds share
BrowserSession(gateway/src/browser-page.ts), so attaching tosession.page()works for both. Two things differ for recording:showWindow()opens for sign-in. So recording on a local computer means showing that window first.showWindow()/hideWindow()close the browser and reopen it with or without a window (seerelaunchincomputer-local.ts), so thePageyou attached to is gone afterwards. The recorder needs to re-attach after a relaunch, or recording needs to stop cleanly when one happens.Please test both Docker and local computers.
2. A few more step types, or at least room for them.
navigate/click/fill/selectcover a lot, but real workflows quickly need:press(Enter to submit a search box is the common case)check/uncheckLeaving some of these out of v1 is fine, as long as the format can add them without a version bump. Maybe that means an optional
frame/pagereference on every step.3. Make the locator candidates an ordered list. "Tried in order" is really a property of the list, so
target: { candidates: Locator[] }(most stable first, each candidate one strategy) says it directly. A single object with optional fields leaves the order to whoever reads it.4. Leave room for intent now. The compile step will add each step's intent and the page state it expects, and the agent fallback depends on both. An optional
intent?: stringon every step (and on the trace) costs nothing now and avoids a v2 later.5. Literal values are still personal data. Redacting secrets is right, but a
fillwith an email address or a street address is still stored as is. Before saving, please show the operator what was captured (even a plain step list), so they can turn any value into a placeholder or drop a step. Recording query keys with their values removed, so a replay knows which parameters were there, also sounds good.6. Two small scope questions.
gateway/src/db.ts). Aworkflowstable next toroutineswould match that.Happy to review the PR as soon as it's ready.
docs(readme): describe local computers wherever the READMEs assumed D…
feat(gateway): record typed browser workflows (#11)