Skip to content

feat(computer): add RecordStart and RecordStop screen recording tools - #1304

Merged
edenreich merged 14 commits into
mainfrom
feat/record-screen-tools
Sep 25, 2026
Merged

edenreich merged 14 commits into
mainfrom
feat/record-screen-tools

Conversation

@edenreich

@edenreich edenreich commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1293

Summary

Adds two opt-in tools, RecordStart and RecordStop, that record the primary screen, a single window, or a frame-space region to an H.264 / yuv420p MP4 with ffmpeg. Gated by computer_use.recording.enabled (INFER_COMPUTER_USE_RECORDING_ENABLED), off by default.

Changes

  • Config - computer_use.recording (enabled, max_duration 120, output_dir -> ~/.infer/tmp/recordings, framerate 15), validated when enabled; env vars come free through the sidecar mapping.
  • Recorder (internal/computer/recorder.go) - one recording at a time. ffmpeg runs with exec.Command so it outlives the tool call, is stopped with q on stdin (works on every OS, writes the moov atom), and is capped with -t max_duration so it also finalizes on its own. A 1.5s startup check surfaces ffmpeg errors (missing encoder, capture device, permission) as the tool error. Exit status 255 (ffmpeg finalizing after a terminal signal) counts as success; a kill after the 10s stop timeout is reported.
  • Shutdown - ServiceContainer.Shutdown finalizes an active recording first, covering normal exit, SIGINT and SIGTERM for chat and headless. infer tools execute refuses both tools, since a one-shot run never shuts down.
  • Capture area (internal/computer/infrastructure/capture) - robotgo's purego build has no window-bounds API on any OS, so bounds are resolved natively: macOS through a new window action in the existing AX helper, Linux through EWMH over X11 (jezek/xgbutil), Windows through user32 + DWM frame bounds. On Linux the screen size is read from X directly, because robotgo's purego build targets Wayland (see [BUG] Computer tool reports a 0x0 display on Linux X11 in purego release builds #1303).
  • Per-OS ffmpeg inputs - macOS: avfoundation + a crop expressed relative to the input size, so the Retina backing scale never has to be detected; Screen Recording permission is preflighted with CGPreflightScreenCaptureAccess. Linux: x11grab -video_size/+X,Y, refused under Wayland or without DISPLAY. Windows: gdigrab with offsets/size in physical pixels (DESKTOPHORZRES/HORZRES). Sizes are rounded down to even for libx264.
  • ffmpeg resolution - ffmpeg on PATH, otherwise the prebuilt ~/.infer/bin/ffmpeg download (reusing audio.BinaryStore). That build gains libx264 and the screen grabbers in feat: build ffmpeg with screen capture and libx264 binaries#31.
  • Approval - both tools are computer-use tools, so they follow computer_use.approval (observations under destructive).
  • TUI - a ScreenRecordingStatusEvent drives a ● REC badge in the status bar that is never dropped for space and clears when ffmpeg exits (stop, cap, or shutdown).
  • Docs - docs/tools-reference.md, docs/configuration-reference.md, docs/directory-structure.md, README tool table.

Verification

  • Unit tests (table-driven, -race): per-OS ffmpeg args for each mode, even rounding and clamping, frame-to-screen scaling and the region error text, request parsing, target parsing, the Wayland/DISPLAY refusal, and the recorder lifecycle against the test binary acting as ffmpeg (single-active guard, stop with nothing running, max-duration cap, Close finalizing and refusing new starts, startup failure surfacing stderr).
  • macOS, real infer binary driven by the mock gateway: screen, region, and window (app:Finder, frontmost) recordings probed with ffprobe (h264, yuv420p, even Retina dimensions); both guards; max_duration=3 stops on its own; normal exit, SIGTERM and Ctrl+C in the TUI all leave a playable file and no ffmpeg process; ● REC shows while recording and clears at the cap.
  • Linux X11 in Docker (Xvfb + openbox + xterm): window (app:xterm, frontmost) and region recordings probe as h264/yuv420p with even dimensions, guards work, the recording finalizes on exit, and a Wayland session gets the clear refusal.
  • task precommit:run passes; golangci-lint is also clean with GOOS=linux and GOOS=windows.
  • Not run: Windows. It compiles and lints, but gdigrab offsets on a scaled display and the window lookup need a manual check on a Windows host.

Cross-repo impact

Follow-ups

Opt-in tools (computer_use.recording.enabled) that record the primary
screen, a window, or a frame-space region to H.264/yuv420p MP4 with
ffmpeg (PATH first, then the prebuilt ~/.infer/bin download).

- One recording at a time; RecordStop finalizes it by sending "q", and
  ffmpeg -t caps it at max_duration (default 120s) on its own.
- ServiceContainer.Shutdown finalizes an active recording on exit,
  SIGINT and SIGTERM; infer tools execute refuses both tools.
- Window bounds are resolved natively: the macOS AX helper, EWMH over
  X11, and user32/DWM on Windows. The X11 screen size is read from X
  directly because robotgo's purego build targets Wayland.
- macOS crops relative to the captured input so Retina scaling needs no
  detection; Screen Recording permission is preflighted.
- Approval follows computer_use.approval; the chat status bar shows a
  REC badge while recording.

Closes #1293
Comment thread internal/computer/recorder.go Resolved
Comment thread internal/computer/recorder.go Resolved
Comment thread internal/computer/recorder.go Resolved
Comment thread internal/computer/recorder.go Resolved
Comment thread internal/computer/recorder_test.go Resolved
@edenreich

Copy link
Copy Markdown
Contributor Author

@infer Can you review this PR? use /ponytail:ponytail /ponytail:ponytail-review /domain-driven-design /clean-architecture /clean-code

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Model: ollama_cloud/glm-5.3-flash · View Job

Todos

  • Read invoked skill files (ponytail, ponytail-review, DDD, clean-architecture, clean-code)
  • Read full PR diff and commit history
  • Read key changed files in detail (recorder, record_tools, capture, config, tests)
  • Review for over-engineering / what to delete (ponytail-review)
  • Review for DDD / clean-architecture / clean-code alignment
  • Write up findings as final review message

Pull Request

#1304

✅ Infer Result: Success

Review complete. Here are my findings:

Review of PR #1304 (RecordStart / RecordStop)

Read the full diff (36 files, +1586/-45), the new recorder/capture/record_tools code with its tests, and the supporting code they reuse (audio BinaryStore, approval policy, computer domain). Verified locally: go build ./... passes; go test ./internal/computer/... ./config/..., the approval-policy tests, and the status-bar drop-order test all pass.

ponytail-review (over-engineering hunt)

This diff is unusually disciplined for its size. The reuse rungs were genuinely climbed rather than performed: ffmpeg resolution reuses audio.BinaryStore (~/.infer/bin cache shared with the gateway) instead of a new downloader; frameRegionToScreen was extracted from the existing Computer path and is now shared by both captureRegion and the recorder; the AX helper gained a window action instead of a second macOS mechanism; ApplicationNamesMatch was exported so Linux window matching reuses the same matcher (its test now runs on all platforms via the names_test.go rename); the logical screen size comes from the existing display controller. Both ponytail: comments name real ceilings (no capability probe of the cached ffmpeg; no 4K scale filter). The fake-ffmpeg TestMain is the one runnable check for exec-based logic - exactly the ponytail minimum, not bloat. Findings:

  • cmd/tools/tools.go:L153: yagni: the cmd layer hardcodes the two tool names as strings. Put IsSessionOnlyTool(toolName) next to IsComputerUseTool in internal/agent/tools/registry.go so tool-name knowledge lives in one package (net 0 lines, one place to change).
  • record_tools.go:L149-157: shrink: FormatForLLM nests a nil check inside a combined nil-or-failed check. Two flat guards: if result == nil { return "Error: no result" }; if !result.Success { ... }.

Nothing else to cut - RecordingStatus fields are all consumed, Screen.NativeWidth/Height are needed by Windows (not speculative), screen_controller.go is the fewest-files home shared by darwin+windows, and the config is four fields validated only when enabled.

net: -2 lines possible. Effectively lean already; this is the rare PR whose best outcome is staying the same length.

domain-driven-design: 8/10

Satisfied rows: expert-readable names (ScreenRecorder, RecordingStatus, Preflight, WindowBounds); explicit boundaries - everything lives inside the computer context, and the only cross-boundary flow is ScreenRecordingStatusEvent in the agentdomain shared kernel beside its two existing siblings; small aggregate - one small ScreenRecorder root whose single-recording invariant lives inside it (idleLocked/launch under one mutex), not in a service; behavior-rich objects - recording.finish() owns the finalize semantics (q on stdin, stop timeout, the exit-255 rule, the stat); domain events drive the REC badge instead of polling; ACLs at every external integration - ffmpeg args, the AX subprocess, EWMH, user32/DWM are all translated behind capture/accessibility, with frame-space-to-screen-space translation at the boundary (frameRegionToScreen, nativeRect); the supporting subdomain is engineered proportionately - that is exactly what the two ponytail: comments encode. Depth: +1 invariants-in-aggregate, +1 language consistency (same words in code, tests, and docs), +0 rich model (honest plumbing). The near-miss rows: recorder.go imports internal/audio (a sibling capability) for the binary store - an infrastructure helper that arguably belongs in internal/platform alongside the model-store move from #1259; and the cmd-layer tool-name special case above. Both are minor; neither blocks.

clean-architecture: 9/10

Six of seven diagnostic rows satisfied: lifecycle rules test without a screen or real ffmpeg; dependencies point inward within the repo's context model (presentation untouched except the event handler and status bar); capture implementations swap behind three small per-OS functions; the recorder knows nothing about TUI/headless (it emits a bool event); Main wires everything (container.go builds the recorder and passes it in; Shutdown closes it first). The two inversions named above are all that separate it from 10.

clean-code: 9/10

Names reveal intent; comments explain why (exit 255, -r pinning, ponytail ceilings); errors are wrapped with context and the ffmpeg stderr tail is surfaced to the model with the fix spelled out; tests are table-driven. Minor: the FormatForLLM nesting above; capture_windows.go:L94 swallows the real DWM error into errNoWindow, losing the reason; the kill-after-stop-timeout branch in finish() is untested (the fake ffmpeg honors q, so nothing drives the 10s kill path - an INFER_FAKE_FFMPEG_IGNORE_Q switch would cover it).

Correctness notes (outside ponytail-review's scope, flagged for the record)

  • After the max-duration cap fires, r.cur still references the finished recording; a follow-up RecordStart without an intervening RecordStop silently drops that status (the file stays valid and its path is already known to the model, so no data loss). A one-line note in the new recording's status message would make the orphaned file discoverable. Optional.
  • Stop() holds the mutex while finalizing (up to ~10s), so Close() on shutdown blocks behind it. Fine in practice - shutdown follows the agent turn and 10s fits the 20s budget - just noting it.
  • Registering both tools in IsComputerUseTool means they bypass approval under the default destructive setting. That is consistent with screenshots (both are observations), and the PR and docs state it; flagging only so it stays a conscious product choice, since a recording captures everything on screen, not just app UI.
  • Windows compiles and lints but is untested, as the PR states - the DWM swallow above sits on that path. Worth the manual host check before calling the Windows story done.

Bottom line

Lean, well-layered, and honestly tested; the admitted gaps (Windows runtime, binaries#31 ffmpeg rebuild) are correctly documented with follow-ups. Nothing blocking from this review - the two two-line nits and the optional registry-helper move are the whole list.

Model: ollama_cloud/glm-5.3-flash · Exit Code: 0 · Duration: 6m 56s

Tokens: 2,053,408 in · 20,954 out · 2,074,362 total (20 requests)

Tool calls: 29 total · 100% success rate

Traces
Session: 1790345148-071c85d3

session (headless, success)                                                                        6m48s
├── chat ollama_cloud/glm-5.3-flash                                                                 6.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.1s
├── execute_tool TodoWrite call_o8ncf0bt                                                            66µs
├── chat ollama_cloud/glm-5.3-flash                                                                 5.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.1s
├── execute_tool Read call_4rn68v4k                                                                293µs
├── execute_tool Read call_frgfbmhw                                                                173µs
├── execute_tool Read call_6fy3x2fs                                                                237µs
├── execute_tool Read call_n633a15v                                                                235µs
├── execute_tool Read call_gc93nheb                                                                163µs
├── chat ollama_cloud/glm-5.3-flash                                                                 2.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.9s
├── execute_tool TodoWrite call_5cc7uwse                                                            59µs
├── chat ollama_cloud/glm-5.3-flash                                                                 2.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.2s
├── execute_tool Bash call_9oka3xt3                                                                 33ms
├── execute_tool Bash call_h1fjvw0x                                                                 36ms
├── chat ollama_cloud/glm-5.3-flash                                                                 3.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.6s
├── execute_tool Bash call_bzthjqj0                                                                 28ms
├── chat ollama_cloud/glm-5.3-flash                                                                 6.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.0s
├── execute_tool Bash call_b5w8fcvr                                                                 29ms
├── chat ollama_cloud/glm-5.3-flash                                                                 2.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.6s
├── execute_tool Bash call_vz05o019                                                                 34ms
├── chat ollama_cloud/glm-5.3-flash                                                                 4.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.2s
├── execute_tool Bash call_ni1041s8                                                                 32ms
├── chat ollama_cloud/glm-5.3-flash                                                                 3.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.5s
├── execute_tool Bash call_i441zmay                                                                 30ms
├── chat ollama_cloud/glm-5.3-flash                                                                1m23s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      1m23s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    1m23s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            1m23s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                1m23s
├── execute_tool TodoWrite call_148g0x0o                                                            64µs
├── chat ollama_cloud/glm-5.3-flash                                                                 3.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.3s
├── execute_tool Read call_6ar3f0q0                                                                230µs
├── execute_tool Bash call_hvnbytfo                                                                 29ms
├── chat ollama_cloud/glm-5.3-flash                                                                 7.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.9s
├── execute_tool Read call_ix1qfs68                                                                194µs
├── execute_tool Read call_k2eljqwg                                                                239µs
├── execute_tool Bash call_wajem9hz                                                                 28ms
├── chat ollama_cloud/glm-5.3-flash                                                                 8.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       8.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     8.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             8.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 8.3s
├── execute_tool Grep call_qlq3w9kc                                                                  1ms
├── execute_tool Grep call_ifwox064                                                                 13ms
├── chat ollama_cloud/glm-5.3-flash                                                                28.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      28.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    28.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            28.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                28.0s
├── execute_tool Bash call_u3t3gm14                                                                1m15s
├── chat ollama_cloud/glm-5.3-flash                                                                 2.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.2s
├── execute_tool Bash call_v0bww1ux                                                                 7.7s
├── chat ollama_cloud/glm-5.3-flash                                                                10.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      10.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    10.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            10.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                10.0s
├── execute_tool Bash call_xs4g9ma2                                                                 8.5s
├── execute_tool Bash call_i5qaaupb                                                                 3.9s
├── chat ollama_cloud/glm-5.3-flash                                                                44.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      44.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    44.7s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            44.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                44.7s
├── execute_tool Memory call_sl3zvqd2                                                              127µs
├── chat ollama_cloud/glm-5.3-flash                                                                32.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      32.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    32.8s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            32.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                32.8s
├── execute_tool Memory call_jp62jrak                                                               1.9s
├── chat ollama_cloud/glm-5.3-flash                                                                34.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      34.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    34.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            34.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                34.5s
├── execute_tool TodoWrite call_u27z67dx                                                            59µs
╰── chat ollama_cloud/glm-5.3-flash                                                                15.6s
    ╰── POST /v1/chat/completions [inference-gateway, server]                                      15.6s
        ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    15.5s
            ╰── POST /proxy/:provider/*path [inference-gateway, server]                            15.5s
                ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                15.5s
Stats
Tool Calls

╭───────────┬───────┬───────┬────────╮
│ Tool      │ Calls │ Fail% │ Avg    │
├───────────┼───────┼───────┼────────┤
│ Bash      │ 13    │ 0%    │ 7299ms │
│ Read      │ 8     │ 0%    │ 207µs  │
│ TodoWrite │ 4     │ 0%    │ 56µs   │
│ Grep      │ 2     │ 0%    │ 7ms    │
│ Memory    │ 2     │ 0%    │ 960ms  │
╰───────────┴───────┴───────┴────────╯

Token Usage

╭────────────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
│ Model                      │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
├────────────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 2053408 │ 1675520 │ 20954      │ 2074362 │ -    │
╰────────────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

- Move the session-only tool check into IsSessionOnlyTool next to IsComputerUseTool
- Keep the DWM error when reading window bounds on Windows
- Name an uncollected, already stopped recording in the next RecordStart status
- Make the stop timeout a recorder field and test the kill of a hung ffmpeg
- Flatten FormatForLLM guards and drop comments inside function bodies
- Name the accessibility bbox format [left, top, right, bottom] in its result
- Give RecordStart the tmux pane to region formula
- Only call RecordStop when the user asks to stop the recording
RecordStart starts capturing the screen, so in chat it now always asks
for approval (auto-accept mode still bypasses). RecordStop stays
approval-free, and outside chat both keep following
computer_use.approval.
…t outside chat

RecordStart now requires approval in every mode except auto-accept, so
headless hosts get it as an approval_request with --require-approval
(and it is blocked without an approver) instead of only the chat TUI
prompting. RecordStop is unchanged.

Headless installs a UI notifier bridge that forwards recording status
into the rendered stream; the AG-UI renderer emits it as a CUSTOM
screen_recording event with {active}, so a desktop host can show a
recording indicator.
…s runs alive

A screen recording now holds a machine-wide lock
(~/.infer/run/screen-recording.lock, flock or LockFileEx) while its
ffmpeg runs, so a RecordStart from any other infer process fails with
the owner's pid instead of starting a competing capture.

A running recording is also a silent, session-holding background job
(kind recording): a headless run waits for it instead of exiting and
finalizing it early, so a user_message follow-up can reach RecordStop in
the same process, and /tasks lists it. A recording that ends on its own
queues a note asking the agent to collect it with RecordStop.
@edenreich
edenreich merged commit 8718955 into main Sep 25, 2026
1 check passed
@edenreich
edenreich deleted the feat/record-screen-tools branch September 25, 2026 16:39
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.208.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add RecordStart and RecordStop screen recording tools

1 participant