sincecutoff.com
← all changes

agent-browser restores validated browser state by stable session

Introduced 2026-06-25 · score 0.97

HOW TO USE IT

For workflows that reuse an authenticated browser session across restarts, generate a stable worktree-scoped session ID and run commands with `--session <id> --restore`. Add a restore check to validate state before saving; `auto` skips autosave after failed restore or validation.

SESSION="$(agent-browser session id --scope worktree --prefix <prefix>)" agent-browser --session "$SESSION" --restore --restore-check-text <text> open <url>

WHY THIS HELPS

When maintaining a repository workflow that reuses an authenticated browser session across restarts, persist and validate that session's state.

REQUIREMENTS AND LIMITATIONS

  • Version: v0.31.0
  • --scope <scope> (required): For session ID generation, use `worktree` to scope to the Git worktree root when available, then Git root, then canonical current directory.
  • --prefix <prefix> (required): Prefix for the generated stable session ID.
  • --session <id> (required): Selects the session; with bare `--restore`, this is the persistence key.
  • --restore (required): Automatically loads and saves session state; bare option uses the current session as the persistence key.
  • --restore-check-text <text>: Validate that restored page text contains the specified text.
  • --restore-check-url <glob>: Validate restored state against a URL pattern.
  • --restore-check-fn <js>: Validate restored state against a truthy JavaScript expression.
  • --restore-save <policy>: Autosave policy: `auto` (default; skips autosave after failed restore or validation), `always`, or `never`.
  • --namespace <namespace>: Namespace for daemon sockets and restore-state directories.
  • agent-browser session info --json: Displays daemon, launch, and restore status.
  • Prerequisite: Install `agent-browser` and run `agent-browser install` to download Chrome, unless a supported existing Chrome, Brave, Playwright, or Puppeteer installation is detected.
  • Restore validation can check a URL pattern, page text, or a truthy JavaScript expression.
  • `--restore-save` policies are `auto`, `always`, or `never`.
  • Auto-save avoids overwriting good state after failed restore or failed validation.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card