A replayed click on a button that fetches the next page of a list
returned at once, so the extract after it read the list the click was
meant to replace: a step that worked when the model acted, slowly
enough to hide it, returned the first page twice once it replayed. A
page that draws its list from a request after loading had the same
race after goto.
A goto, an act, and a replayed action now end once the page settles:
a page they loaded until its network is idle, and a page they changed
in place until its requests end and it stops changing for half a
second, at most five seconds.
An agent guarding a click by ID with when, as it would an act, had the
whole operation refused as invalid. An element operation now takes when
and timeout, which its act keeps and checks as any act does.
Part of #3070
To click, type, or pick on a page, a session asked the act model to find
the element in the page's whole accessibility tree, which on a large
page runs to tens of thousands of characters: a small model answered
that nothing matched "Click 東京都" on a property portal whose tree held
two such links, and each try sent the tree again.
The outline now shows the ID of every element an operation can act on,
and do takes {"click": ID}, {"type": {"into": ID, "text": TEXT}}, and
{"select": {"in": ID, "option": OPTION}}, acting on that element by its
XPath with no model. The session keeps each as the act a step writes,
such as Click the "Sign in" button, with the action it took as the act's
recording, so an exported step replays exactly that action and heals by
the act's words when the page changes.
The outline also grows shorter where it repeated itself: a link to the
page's own site shows its path, and a list item that is one link shows
only the link.
Part of #3070
The outline a session reports is cut at a few thousand characters, and
it followed the page's order, where a site's header and menus come
first: on a site with large menus, such as a property portal's top page
or a search engine's results, the limit ended inside the menus and the
content never showed, so an agent concluded the page had none. The
page's own content now comes first, and its header, menus, sidebars,
and footer after it, in a frame as on the page. A menu inside the
content, such as its pages, stays beside what it belongs to.
Part of #3070
The browser runtime closes only after the call it is serving ends, and
an act waits on the step's model. When an act outlived its timeout, the
model call kept running past the engine, the runtime could not close,
and a kept browser, such as a browser session's, refused every later
command until its idle timeout: one model request that hung, as on a
network drop, broke the session. An engine now ends its model calls
when it detaches or closes, so the act fails, the runtime closes, and
the next command reattaches.
Part of #3070
An application that worked a site in a session may need the session's
profile for a step, such as a trial run of the workflow it is writing,
before it exports the session. Closing removed the history with the
browser, so the recordings were lost. close --keep ends the session as
an idle timeout does: its browser closes and its profile is free, and
its history can still be exported for a day.
Part of #3070
The check of an exported step names the session's operations in place
of the step's do[N]. Replacing each N in its own pass was correct only
because higher indexes went first; one pass over every reference does
not depend on that order.
Part of #3070
A watchdog whose session's browser would not close tried again every
tenth of a second, since the session's deadline had passed, spending
CPU and I/O until the failure cleared. It now waits ten seconds before
trying again.
Part of #3070
The limit counted bytes, so a page in Japanese was cut at about a third
of the characters asked for. A long run of alike text boxes or check
boxes is also counted as "textboxes" and "checkboxes" now.
Part of #3070
An act that typed a variable's value itself was not exported for
replay, but its actions still went to the session's history and, with
a secret's value unmasked, to the command's output. The history now
keeps only the actions an export replays, and the output masks the
secret values in the arguments it reports.
Part of #3070
A closed session's watchdog slept until the old idle deadline in the
directory of the command that opened the session, which Windows then
would not let anyone remove. The watchdog now runs in its executable's
directory and looks at its session at least every ten seconds, so it
exits soon after the session is closed or ended elsewhere. Looking takes
the session's lock only once the session is abandoned, so the watchdog
never makes a command find the session busy.
Part of #3070
A tree whose lines end in CRLF, as the outline fixtures do when checked
out on Windows, left a carriage return on every name, so no outline
matched. The parser now drops it.
Part of #3070
Spec 079 states what browser sessions do: the commands and their JSON,
the lifetime and the watchdog, operations, variables and masking, the
model and the variables it may read, the outline, export and the
recordings it writes, profiles, platforms, and the error codes. Spec
072 points to it where a session holds a profile and where export
writes a step's recordings.
The skill tells an author working on a page they have not seen to work
it in a session and export the step rather than guess, and to guard
sign-in operations with when when a profile keeps the sign-in; the
CLI reference documents the commands, the agent reference given to
MCP clients that can run the CLI says the same, and llms.txt is
regenerated.
Part of #3070
The conformance suite for spec 079 runs every session command as its
own dagu process against a real Chrome, a local portal that signs its
user in and filters its orders by script, and a scripted model that
refuses any request holding the password.
It works the portal one operation per command, with a failed operation
in between, exports the step, and checks it equals a static fixture;
that fixture's first run then replays every act the session recorded
without a model request. Other cases cover a step refused a profile a
session holds, a session closing its browser once idle with its
history still exported, a session without a model, and input refused
before any browser starts. Run on Windows, the separate processes
show a session's browser outliving each command.
Part of #3070
A session's browser was closed when idle only once something swept the
session store: a later session command, a browser step, or a server.
On a machine with no server running, a forgotten session kept its
browser, possibly signed in, open indefinitely. Opening a session now
starts a watchdog process of its own, detached from the caller's
terminal and, where the job allows, from its Windows job object. It
sleeps until the session's deadline, looks again since a command may
have renewed it, and closes the browser once the session is idle past
it, keeping the history; it ends with the session.
On Windows, a session opened from a job object that ends its processes
on close says so, since its browser closes with that job.
Part of #3070
Browser sessions get their CLI: open, do, describe, export, close, and
list under dagu browser session. open takes the browser's options and
the session's model as a step's llm field or as --provider and
--model; do reads one operation and its variables from stdin, so a
value never sits on the command line or in the process list, and
refuses a terminal; describe can answer as text; export can print the
step alone as YAML, with what to declare and what to check as
comments.
Every command prints one JSON object, so an agent can drive a session
as well as a person. A command that fails prints the error's code and
message as JSON and exits 1; an operation that failed prints its
whole result first, since the session stays usable.
Part of #3070
An exported step referred to a variable the session was given as a
literal by its name in upper case, so a variable named user became
${USER}, which the system's own USER variable shadows. The step now
refers to a parameter of the variable's own name, ${user}, and the
export says to give the DAG that parameter.
Part of #3070
A session's model got no API key: its settings name the variable that
holds the key, such as OPENROUTER_API_KEY, and value resolution never
reads the process's own environment, which keeps a step's model from
seeing anything its DAG did not declare. A session has no DAG to
declare it, so every act failed with an authentication error. A
session's model now sees exactly the variables its settings name, its
API key's and those its base URL references, read from the process's
environment as secrets; every other variable stays out of reach.
A secret variable a session registered must be set for each of its
commands, which mask its value; the error saying it is not set now
says so.
Part of #3070
A browser session takes its model on the command line, and it should
take exactly what a step's llm field takes, checked the same way: one
model or a fallback list, a base URL, the name of the variable holding
the key. The checks and conversion a step's llm block gets are now one
function, which a new ParseLLMConfig also runs on a block read on its
own, refusing fields an llm block does not have.
Part of #3070
What a session found to work is only useful once it is a step. Export
builds a browser.run step from the session's history: the operations
that succeeded, and those skipped because their when did not hold, in
the order they ran, leaving out failures and screenshots. Each
variable becomes a reference the DAG fills in: a secret for one the
session read from the environment, a parameter for a literal value,
which the export never shows.
It writes the acts' recordings into the replay cache of the DAG and
step it names, keyed by their places in the step's with.do, so the
step's first run replays them instead of asking the model when it
meets the pages the session met. Export runs the checks a DAG's load
would run on the step, naming the session's operations in what it
reports, and warns about an act with no recording and about a page
the session reached outside the exported operations. A session whose
browser has closed can still be exported.
The DAG's step ID is checked by the rules a definition's step IDs
follow, now exported from the spec package.
Part of #3070
Writing a browser step means guessing at a page until a whole run
shows what went wrong. A browser session keeps a browser open between
commands, each of which runs one operation of with.do on it, exactly
as a step would, and reports what it did and what the page shows
next, so a person or an agent can work a site one step at a time.
Each command takes the session's lock, reattaches to its browser the
way a step resumes after an ask, runs the operation, and leaves the
browser waiting until the session's idle deadline. An operation that
fails is reported and kept in the history, and the session stays
usable. Describe outlines the page without a model. A session holds
its profile between commands, refuses the operations that need a
model when it was opened without one, and ends once idle past its
timeout or once its browser is gone, keeping its history for a day.
A variable's value is passed with the operation, never kept: one
named by an environment variable is read on every command and masked
like a secret, and a literal one serves its own command only. A
secret never reaches the model, and an act whose recorded actions
hold a value is not replayed later.
Part of #3070
Whoever writes a browser step needs to see the page it acts on, and
the page's raw HTML or text buries the controls under markup and
menus. The engine now reads the page's accessibility tree, the one an
act shows the model, without a model call, and an outline renders it
for someone deciding what to do next: headings, fields with their
labels, selects with their choice and options, buttons, checkboxes,
links with their addresses, messages, and tables and lists by their
columns and rows, with long runs of alike rows collapsed to a few. It
never shows what was typed into a field. A search shows the matching
entries wherever they sit, and an outline over its limit ends at a
whole line saying how to see more.
The fixtures are trees Chrome reported for a sign-in form, an order
table, a long list, and an iframe, and a real-Chrome test guards the
format.
Part of #3070
Chrome cannot share a profile directory between processes. A step
waiting for input already marks its profile as held between uses; a
browser session keeps its browser open between commands the same way,
but its record lives in the session store, so a step would start a
second browser on the profile. Taking a profile now checks both
stores and names the session and how to close it. A session takes a
profile without waiting, failing at once while a running step uses
it, since it cannot wait out a step of unknown length.
Part of #3070
A browser session keeps its browser between commands, which the
steps' record store cannot hold: its sweeps release any record in a
state they do not know, so an older server or scheduler would close a
session within a minute. Sessions get their own store beside it, with
two states of their own: interactive, waiting for the next command,
and ended, whose browser is closed but whose history is kept for a
day so it can still be read. A session's record carries the directory
of files it owns and its history, and a lock serializes its commands
with sweeps.
Sweeps now cover both stores: an interactive session past its idle
deadline, or one whose command died, is retired, closing its browser
and keeping its history, unless a command holds it; an ended one is
removed after a day. The reaper and a browser step's start-up sweep
use the combined sweep.
Part of #3070
A statement condition marshalled to {} because the statement field is
not written, and an act always marshalled as an object, so an
operation could not be written back the way it was given. A browser
session keeps the operations it ran and writes them into the step it
exports, so a condition now marshals as a statement string or a fixed
check object, and an act with nothing but an instruction as that
string.
Part of #3070
A browser step's operations reported straight to the step's timeline
and outputs, so nothing but a step could run them. The page operations
now live on an operator that returns what each one did: the report, the
actions an act performed and the page it started on, and the values an
extract read. The step records those results in the same place and
order as before, and acts replay and record through a recorder the
step backs with its replay cache. A browser session will run the same
operations through the same code.
Part of #3070
Reattaching to a browser that a step left running for an ask dropped
the browser's process ID and start time, so closing the reattached
browser could no longer wait for its process tree or end it when it
stopped answering. The resumed step now passes the recorded process
along, and the reattached engine keeps it.
Part of #3070