# Pane recording

An Agent records one pane to a video of exactly that pane's rectangle, with actions of `computer_use`. There is no menu, button or shortcut for a person. The App captures its own pages, so macOS never asks for Screen Recording and no approval is added.

## What the Agent calls

Three actions on `type="browser"`, the target that already reaches the App and owns `get_state`, which takes its screenshots. Names and limits follow `start_audio_recording` and `stop_audio_recording` of `type="window"`.

```
computer_use(type="browser", action="start_video_recording", args={"pane": "conversation"})
…
computer_use(type="browser", action="stop_video_recording")

Recorded 12.4 seconds of tk3fa, 1600×1200 at up to 60 fps, saved to
~/.openprogram/computer-use/video/20261110-101500-conversation.mp4.
```

| Action | Arguments | Returns |
| --- | --- | --- |
| `start_video_recording` | `pane`: what to record, below. `max_duration`: seconds, 60 by default, at most 600. | At once: the pane, its size in pixels and the limit. Recording goes on while the Agent acts. |
| `stop_video_recording` | `discard`: delete instead of saving | `path`, `seconds`, `width`, `height`, `fps`, `bytes`, and `ended`: why it ended when not by this call |
| `list_panes` | None | The panes on screen in the answering window: id, kind, title, size |

| `pane` | Records |
| --- | --- |
| `conversation` | This conversation's own pane, when it is on screen |
| An id from `list_panes` | Any center tab or canvas pane on screen: conversation, file, application, built-in page such as Settings |
| `window` | The whole window. Web views show as empty areas. |
| A web tab | Refused for now |

## Rules

| Aspect | Rule |
| --- | --- |
| Approval | None added |
| Which window | The one that shows this conversation; the main window when none does |
| One at a time | One recording per window. A second start is refused and names the one running. |
| Who may stop | The conversation that started it |
| At the limit | Stops by itself and keeps the file; the next stop returns it with the reason |
| Pane closed or hidden | The same: it stops and the file is kept |
| Pane resized | The video keeps the size it started with; the picture scales to fit |

| Failure | What the Agent reads |
| --- | --- |
| No App window answers | Video recording needs the OpenProgram desktop App with a window open; open it and call again. |
| Conversation not on screen | Says so and lists the panes that are |
| Unknown or missing pane | The error lists the panes on screen, as `list_panes` would |
| Already recording | Already recording tk3fa; call stop_video_recording first. |
| Nothing to stop | Nothing is being recorded; call start_video_recording first. |
| `max_duration` out of range | max_duration must be between 0 and 600 seconds |
| App older than this feature | Says to update the desktop App |
| Capture, encoder or file fails | What failed; the partial file is removed |
| File not on the worker's computer | Names the path the App reported |

The worker sends `record_panes`, `record_start` and `record_stop` over the desktop link; the App records and writes the file. Code: `openprogram/programs/applications/browser/video.py`, `apps/web/lib/desktop/recording/pane-recorder.ts`, `apps/desktop/main/windows/pane-recording.js`.

## What the person sees

1. **Recorded pane** accent outline just outside the frame, so it is not in the video

The outline is all a person gets: no pill, timer or button. It stays because recording starts without asking, so it must be visible. A whole-window recording has no outline.

## What a pane is

| Surface | Drawn by | Recorded as |
| --- | --- | --- |
| Center tab: chat, file, terminal, review, application, built-in pages such as Settings | The window's page | One stream cropped to the tab's content |
| Canvas pane | The window's page | The same; the crop follows the pane |
| Right sidebar: Files, Activity, Resources, detail panel | The window's page | The same |
| Left sidebar, secondary rail, one Settings column | The window's page | The same |
| Web tab | Toolbar by the window's page, the site by its own native view | Later: the site's own frame as one stream |
| Floating preview | As a web tab | As a web tab |
| Whole window | All of the above | The uncropped stream with visible web views laid in |
| Menus that open above a web page; native context menus | Their own top-layer views; the system | Left out at first |
| Agent glow and pointer over a page | A transparent window per page | Not captured |

Layout: [center canvas](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/workspace/center-canvas-layout.html), [web tab bounds](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/browser/web-tab-native-bounds.html), [agent control overlay](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/browser/agent-control-overlay.html).

## Capture route

| Route | Frame rate, measured | Pointer | macOS permission | Encoding |
| --- | --- | --- | --- | --- |
| Recommended. Own-frame stream: `getDisplayMedia` answered with the window's frame, then `cropTo` the pane | 60 fps, full and cropped; 60 fps for a web tab's frame | Drawn in by Chromium (the track reports `cursor: motion`) | None | Built in: H.264 MP4 at 60 fps, with real frame times |
| `capturePage` in a loop | About 115 fps for a 640×400 pane; 59 fps for the full window with JPEG encoding | None | None | Own encoder; frame times are the loop's guesses |
| CDP `Page.startScreencast` | About 93 fps, whole viewport only | None | None | Own encoder; needs the page's debugger, which agent control also uses |
| Window capture: `desktopCapturer`, cropped by rectangle | Not measured, since asking raises the system prompt | The real one | Screen Recording, granted to the App | Built in; also shows native menus and web views in one picture |

Measured in Electron 45.2.1 (Chromium 156) on a 2× display with a 1280×800 window and a small moving element; real pages will be slower on every route.

1. **Pane element**
2. **App frame** 60 fps stream
3. **Crop** to the pane
4. **Encode** H.264 MP4
5. **File** Movies folder

| Aspect | Rule |
| --- | --- |
| Who may capture | Only a window's main page, only its own window's frames, only while a recording the worker asked for is running. Sites in web tabs stay refused as today. |
| Size | The pane's CSS size times the display scale, rounded to even numbers. Left alone the stream comes out at screen size, so the size is set explicitly. |
| Web tab | The site's own frame, answered to the window's page; no joining |
| Why not window capture | It adds a system permission, and the App is not the identity that holds Screen Recording for workflow recording. It stays the later answer for native menus. |
| Why not the other two | Fast enough, but no pointer, no frame times, and an encoder to write. `capturePage` stays what it is used for today: stills. |

## The file

| Aspect | Value |
| --- | --- |
| Format | MP4, H.264, 8 Mbit/s, up to 60 fps, no audio. Frames come only when the pane changes, so a still pane has few. |
| GIF, WebM | Not recorded. The Agent converts the MP4 with its own tools when asked. |
| Saved to | `computer-use/video/` under the state folder, beside the audio recordings; the newest 20 are kept |
| Name | Date, time and the pane as it was named |
| Handing it over | The Agent copies it into the working folder and calls `send_file` |

## Effects

| Effect | How |
| --- | --- |
| Pointer and click mark | The Agent's actions move no real pointer, and its usual pointer lives in a separate window. The same pointer is drawn inside the recorded frame from the action events. |
| Automatic zoom to clicks | An export crops and eases toward each click, from a list of clicks kept beside the file |
| Padding, background, rounded frame | The export places the video on a backdrop |

None of these is built. The export writes a second file; the plain recording is never altered.

## Without the desktop App

| Where | Result | Why |
| --- | --- | --- |
| OpenProgram open in a browser tab | Refused: needs the desktop App | A browser shares a tab only after a person clicks and answers its own prompt, in Chromium; Firefox, Safari and phones cannot crop to an element at all |
| The user's own Chrome or Edge, through the extension | Not at first | Later by CDP screencast, which measured about 93 fps, with the worker encoding |
| Server with no window | Refused: needs the desktop App | Nothing draws the panes |

## Implementation status

| State | Items |
| --- | --- |
| Implemented | The three actions; center tabs, canvas panes and the whole window; the outline; the limit and the pane watch; refusal of every display capture the App did not ask for |
| Not implemented | Web tabs; sidebars as panes; stopping when the run ends; first and last frame returned as images; a `path` argument inside the working folder; the pointer drawn in the frame; the export step and its effects; the user's own Chrome or Edge |
| Still to check | That QuickTime, X and WeChat accept the recorder's MP4 as written; frame rate on a long chat |

[Built-in browser](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/browser/built-in-browser.html)
