Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions apps/docs/content/blog/agent-cursor-drawn-by-chrome.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Moving the agent cursor out of the page
description: In turno-browser 0.7.0 the agent cursor was an element drawn into each page; since 0.11.0 the default asks Chrome to draw a highlight and a click ripple above the page, so the cursor adds nothing to it. The highlight is a rectangle because, as a code comment records, Chrome 158 did not paint a node highlight into the live view's frames, and that rectangle is what the 0.12.1 Retina fix corrected.
date: 2026-12-04
tags: [research]
product: browser
releases: ["turno-browser@0.7.0", "turno-browser@0.11.0", "turno-browser@0.12.0", "turno-browser@0.12.1"]
---

When someone can see the browser, turno-browser shows where the agent acts. The first version, in 0.7.0, drew it inside each page. Since 0.11.0 the default asks Chrome to draw it, and the cursor adds nothing to the page. This post is about that move, and about one choice in it that a later release had to correct.

## The cursor in the page

turno-browser 0.7.0 added the [agent cursor](/docs/browser/agent-cursor): an arrow with the agent's name and the identity that glides to each element the agent acts on, a ring on the target, a ripple for each click, a typing bubble by a field, and a thin frame with a badge around the page while calls run. Several sessions on one identity's Chrome each get a cursor and a color of their own.

<Figure
src="/blog/agent-cursor-drawn-by-chrome/agent-cursor.png"
alt="A sign-in page with two agent cursors, one named Codex · school by the password field and one named Claude Code · school on the Sign in button, which has a ring around it, under a badge that says turno · Claude Code at work"
width={1100}
height={640}
caption="The cursor in the page, as the docs show it: two sessions on one identity."
/>

It was built to stay out of the model's way. Everything it draws lives in a closed shadow root on one host element under `<html>`, as the comment at the top of the file says:

```ts title="packages/browser/src/agent-cursor-overlay.ts"
* What it draws lives in a closed shadow root on one host element under `<html>` (never in
* `<body>`, so `document.body.innerText` never holds it). The host is `aria-hidden` and `inert`
* (out of the accessibility tree, so out of every snapshot), `pointer-events: none` (never a
* target of a click or of `elementFromPoint`, so Playwright's hit test and "covered" check see
* through it) and `position: fixed` with `contain: strict` (no layout, no scroll of its own).
```

It is also hidden while `browser_take_screenshot` runs. The person watching sees the cursor; snapshots, screenshots and clicks do not.

That kept the cursor away from the model. It did not keep it out of the page. The host element is still a node in the site's document, next to `<head>` and `<body>`: one element the site did not build.

## Asking Chrome to draw it

[turno-browser 0.11.0](/releases/browser/0-11-0) changed what the default, `cursor: "auto"`, draws. When the browser can be seen (Chrome has a window, or the [live view](/docs/browser/live-view) is on), turno-browser opens a DevTools protocol session on the page and asks Chrome for its own highlight on the element the agent acts on and its own ripple where each click lands:

```ts title="packages/browser/src/agent-cursor-cdp.ts"
try {
const cdp = await page.context().newCDPSession(page);
await cdp.send("DOM.enable");
await cdp.send("Overlay.enable");
// Chrome 158's experimental ripple; an older Chrome still gets the highlight.
const send = cdp.send.bind(cdp) as (method: string, params?: object) => Promise<unknown>;
await send("Page.setInputVisualization", { clicks: true }).catch(() => {});
return { cdp, box: null, tone: "agent" as Tone, outline: false };
} catch {
return false;
}
```

Both are painted by the browser above the page, like the boxes of Chrome's DevTools. The cursor inserts nothing, so it leaves the page's DOM and layout as they would be without it. That is true of the cursor only; other features still act in the page, such as the passkey watch, which wraps `navigator.credentials` on a sign-in page while the agent acts on it. The box is taken down while the model's screenshot is taken and drawn again after it. When Chrome refuses the protocol calls, the session is `false` and the cursor in the page is drawn instead.

In 0.11.0 the box was always turno's blue. [turno-browser 0.12.0](/releases/browser/0-12-0) gave it the color of the action: blue for a click, violet while the agent types, red for a moment when the call fails, and amber while the browser waits for the person.

| `cursor` | What is drawn | What the cursor adds to the page |
| --- | --- | --- |
| `auto` (default) | Chrome's highlight and click ripple, when the browser can be seen | nothing (the `on` element when Chrome refuses the protocol calls) |
| `on` | the named arrow, the ring, the ripple, the typing bubble, the frame and the badge | one element, `turno-agent-cursor`, with a closed shadow root |
| `off` | nothing | nothing |

## A rectangle, not a node

Chrome's overlay can highlight a DOM node (`Overlay.highlightNode`) or a rectangle given by its coordinates (`Overlay.highlightRect`). turno-browser draws a rectangle. The comment at the top of the file, from commit c2a8cbc (2026-11-26 UTC), records why; it does not say how this was measured:

```ts title="packages/browser/src/agent-cursor-cdp.ts"
* Measured on Chrome 158: `Overlay.highlightNode` is not painted into screencast frames, so the
* live view would not show it; `highlightRect` is, which is why the box is drawn as a rectangle.
```

The rectangle has two costs. The first is in the docs: the box is drawn at the element's place, and if the page moves under it during the action, the box stays where the element was.

The second was fixed in 0.12.1. 0.11.0 and 0.12.0 sent the CSS box as it was, so on a Retina screen it landed at twice its place; [the highlight that landed at twice its place](/blog/highlight-at-twice-its-place) has the measurement and the fix in [0.12.1](/releases/browser/0-12-1).

## What the default does not show

The default draws less than the cursor in the page. There is no arrow with the agent's name, no frame around the page while calls run, no badge and no typing bubble, and, as a comment added in 0.12.0 (a41a13e) notes, Chrome draws one highlight at a time, so each replaces the last. With [several agents in one browser](/docs/browser/sharing), a box in the default mode does not say whose it is. Those parts are still there with `cursor: "on"`, at the price of the element in the page.

The comment from c2a8cbc records, for Chrome 158, that the ripple is painted into screencast frames and screenshots alike; turno-browser does not hide it.

The ripple needs Chrome 158 or later; an older Chrome gets the highlight without it. Nothing is drawn in [read mode](/docs/browser/engines#read-mode-lightpanda), which lays out no page.

## Sources

The change to Chrome's highlight is [commit c2a8cbc](https://github.com/wimo-dev/turno/commit/c2a8cbc).
105 changes: 105 additions & 0 deletions apps/docs/content/blog/defaults-resolved-at-launch.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: Turning features on by default without rewriting anyone's config
description: turno-browser 0.11.0 turned on features that identities had to opt into, without writing a value into an existing identity.json. Each default is worked out at every launch, a key the person set still wins, and show, status and doctor say where each value came from.
date: 2026-12-04
tags: [research]
product: browser
releases: ["turno-browser@0.11.0", "turno-browser@0.11.1", "turno-cli@0.6.2", "turno-browser@0.14.0"]
---

Before turno-browser 0.11.0, the live view, flow recording, human-like input and tab sharing were each off until someone set a key for them in the identity's `identity.json`. [turno-browser 0.11.0](/releases/browser/0-11-0), released on 2026-11-28 with [turno 0.6.2](/releases/cli/0-6-2), turned them on by default.

It did that without editing any existing `identity.json`. In the words of the changelog, the defaults are "worked out at every launch and never written into identity.json." An identity that nobody edited gets the new behavior at its next launch, and an identity whose owner had set a key keeps that key.

## Why the defaults are not written down

One setting already showed what happens when a default is stored. The vault index next to `identity.json` always carried a `submit` value, and wrote `confirm` when nobody chose. When 0.11.0 made `auto` the default, a stored `confirm` could mean a person's choice or no choice at all. The index now marks a choice apart:

```ts title="packages/browser/src/vault.ts"
interface VaultIndex {
version: 1;
/** What an older turno-browser reads; this one reads it only with `submitChosen`. */
submit: SubmitPolicy;
/** The person chose `submit` with `vault submit`; without it the default (`auto`) applies. */
submitChosen?: boolean; // [!code highlight]
sites: Record<string, Omit<VaultSite, "site">>;
}
```

Only a `vault submit` the person runs sets that mark, so the changelog asks for `vault submit <id> confirm` to be run again, "even if it was chosen before."

The other defaults avoid that. The comment at the top of `defaults.ts` gives the reason: a key that is not in the file takes the default again at the next launch, "so a change of default never needs a migration, and the file keeps saying only what the person chose." A test in `defaults.test.ts` checks that resolving the defaults leaves no new file behind and does not change an existing one, down to its modification time.

## The order of precedence

Every key is resolved the same way: a `turno-browser-mcp` flag first, then `identity.json`, then the default. A default can depend on the launch itself. The low-resource preset is one:

```ts title="packages/browser/src/defaults.ts"
function resources(
s: IdentitySettings | undefined,
ctx: DefaultsContext,
f: DefaultsFlags,
): Effective<"normal" | "low"> {
const asked = f.resources ?? s?.resources;
if (asked === "normal" || asked === "low") return f.resources ? flag(asked) : file(asked);
if (ctx.pressure === undefined) return atLaunch("the low-resource preset while memory is short"); // [!code highlight]
return ctx.pressure === "normal" ? auto("normal", "no memory pressure") : auto("low", "memory pressure"); // [!code highlight]
}
```

Each value comes back with its origin, such as the file, a flag, a fixed default, or `auto` with the condition that decided it. When the pressure is not known, the value is left undefined and the origin carries the rule instead of a guess.

## What turned on

The changelog entry of f717317 lists 11 changes for an identity nobody touched. Three other entries of 0.11.0 also turn something on: the last-click rule and system notifications, the `storage` tools, and natural language actions. The 11 changes of f717317, and how to keep each one from applying:

| Feature | Default since 0.11.0 | To pin it |
| --- | --- | --- |
| Live view | on; it opens only with `turno-browser live` | `--live false` |
| Flows and screenshots | recorded; screenshots under the 200MB cap, never of a page that shows a vault value | `--record-flows false`, `--record-screenshots false` |
| `vision`, `pdf`, `devtools`, `network` tools | listed when the server has no `--caps`; in attach mode, `devtools` and `network` are off since [0.14.0](/releases/browser/0-14-0#changed-behavior) | `--caps` on the server |
| `browser_login` | submits the form | `vault submit <id> confirm` |
| Low-resource preset | on under memory pressure | `--resources normal` |
| Human-like input | `auto` | `--humanize off` |
| Tab sharing | several sessions, each in its own tabs | `--sharing session` |
| Coherent user agent | in a headless Chrome, once `login` has read its client hints | `--user-agent off` |
| Background throttling | in a headless Chrome with the live view off | `--background-throttling false` |
| Locale | the system's, when `identity.json` names none | `--locale off` |
| Health check | the one `login` finds | `--health off` |

`vault submit` is a command of its own and `--caps` a flag of the server; the other flags go to `turno-browser set <id>`. The [upgrade notes of 0.11.0](/releases/browser/0-11-0#upgrade) list what changes for an existing identity. Other changes in the same release, and the side panel of 0.12.0, go through the same resolver, and the [Defaults](/docs/browser/identities#defaults) section of the docs keeps the current list.

## Saying where a value came from

A setting that is not in the file has to be visible somewhere else. `show` prints the defaults under their own heading; the docs page shows a shortened example:

```text title="apps/docs/content/docs/browser/identities.mdx"
defaults (not in identity.json; decided at every launch):
live: on (default)
resources: auto (auto: the low-resource preset while memory is short)
humanize: auto (default)
sharing: tabs (default)
...
```

`status <id>` gives the same values on its `defaults` row. `show`, `status` and `doctor` never pass the memory pressure to the resolver, even while a server runs (`doctor` reads it only for its own memory check). So for an identity with no `resources` key, `show` prints the `resources: auto (...)` line above. `doctor`, when `identity.json` has no problems, adds an info line with only the values the context decides, starting with "decided at launch". At launch the host passes it and the resolver decides; the test expects `resources: low (auto: memory pressure)` under pressure, though nothing prints that line.

## Off, said out loud

Leaving a key out now means "the default", so some keys needed a way to say "off". Format 14 of `identity.json`, new in 0.11.0, adds `false` for the keys that had no off value (`act`, `cache`, `captcha`, `proxy`, `health`, `userAgent` and `locale`), and `"auto"` as an explicit name for the default of four keys. A file is written as format 14 only when it uses one of these or sets `notify` or `lastClick` (and, since 0.12.0, `sidePanel`), so every other file keeps its format. turno-browser 0.10 refuses a format 14 file rather than read it wrong.

## Two values that are stored

Two defaults do touch disk, each for a reason in the code. For a new identity, `add` writes `"keychain": "system"` into `identity.json` only at a terminal, on macOS, with Google Chrome detected, when no browser, engine, attach or keychain option is given, and not with `--dry-run`. As `defaults.ts` notes, an existing identity keeps what its cookies were encrypted with, so this choice is made once, when the identity is created. The health check that `login` finds is written to the identity's state folder, not to `identity.json`, so a check the person writes still wins and `health: false` still turns it off.

## What is still not solved

A key left out follows the default of the turno-browser that runs. A later release can change what an identity does while its file stays the same. That shows in `show`, `status` and `doctor`, and in the changelog, not in the file.

Defaults in code also live in help text and docs, and those did not follow on their own. [turno-browser 0.11.1](/releases/browser/0-11-1) ([pull request 181](https://github.com/wimo-dev/turno/pull/181)) corrected the help of `vault submit`, `record` and `set`, and docs pages, which still described the old defaults.

Traces are the one recording that stayed off. `defaults.ts` keeps them off and gives the reason: tracing stops pages from loading images and frames of other sites.

## Sources

The change itself is commit `f717317`.
Loading
Loading