mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
This PR introduces screen recording of the computer use agent using the virtual desktop. - Screen recording is triggered by a `wait_agent` tool call. Recording is stopped by a successful `wait_agent` tool call or when there hasn't been any desktop activity for 10 minutes. - Recordings are handled by the `portabledesktop` cli via the `record` command. The videos are sped up in periods of inactivity. - Recordings are saved to the database to the `chat_files` table. There's a hard limit of 100MB per recording. Larger recordings are dropped. - A successful `wait_agent` on a computer use subagent tool call returns a `recording_file_id`, later allowing the frontend to display the corresponding video.
13 lines
338 B
Go
13 lines
338 B
Go
//go:build !windows
|
|
|
|
package agentdesktop
|
|
|
|
import "os"
|
|
|
|
// interruptRecordingProcess sends a SIGINT to the recording process
|
|
// for graceful shutdown. On Unix, os.Interrupt is delivered as
|
|
// SIGINT which lets the recorder finalize the MP4 container.
|
|
func interruptRecordingProcess(p *os.Process) error {
|
|
return p.Signal(os.Interrupt)
|
|
}
|