Skip to main content

everruns_contracts/
session_sandbox.rs

1//! Provider-neutral managed session sandbox contracts.
2
3use crate::tools::ToolExecutionResult;
4use serde::{Deserialize, Serialize};
5use serde_json::{Value, json};
6#[cfg(feature = "openapi")]
7use utoipa::ToSchema;
8use uuid::Uuid;
9
10/// Capability id for the managed session sandbox capability.
11pub const SESSION_SANDBOX_CAPABILITY_ID: &str = "session_sandbox";
12/// Secret name used to persist the managed sandbox record for a session.
13pub const SESSION_SANDBOX_SECRET_NAME: &str = "session_sandbox";
14/// Default idle timeout for auto-pausing the managed sandbox.
15pub const DEFAULT_SESSION_SANDBOX_IDLE_TIMEOUT_SECS: u64 = 180;
16
17/// Provider-side label every Everruns-created resource carries, tool-created
18/// sandboxes included.
19pub const LABEL_EVERRUNS: &str = "everruns";
20/// Provider-side label only managed Session Sandboxes carry. The orphan scan
21/// requires it, so sandboxes an agent created with a provider tool are never
22/// touched by it.
23pub const LABEL_MANAGED: &str = "everruns.managed";
24/// Provider-side label naming the owning organization (public `org_…` id).
25pub const LABEL_ORG_ID: &str = "everruns.org_id";
26/// Provider-side label naming the owning Session. A Session owns exactly one
27/// logical managed Sandbox per provider, so this also identifies the logical
28/// Sandbox: its row id is assigned when the state is first saved, after the
29/// provider create returns, and so cannot be stamped on the resource.
30pub const LABEL_SESSION_ID: &str = "everruns.session_id";
31
32/// Session sandbox configuration.
33#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
34pub struct SessionSandboxConfig {
35    /// Concrete provider id (e.g. `daytona`).
36    pub provider: String,
37    /// Start the sandbox proactively when the session is created.
38    #[serde(default = "default_true")]
39    pub auto_start: bool,
40    /// Pause the sandbox after this much session inactivity.
41    #[serde(default = "default_idle_timeout")]
42    pub idle_pause_after_seconds: u64,
43    /// Whether the control plane should pause this sandbox when the timeout elapses.
44    #[serde(default = "default_true")]
45    pub idle_pause_enabled: bool,
46    /// Credential owner pinned when the Session is created. This contains only
47    /// stable identifiers; credential material remains in the host store.
48    #[serde(default)]
49    pub credential: SessionSandboxCredential,
50    /// Provider-specific extra configuration.
51    #[serde(default = "default_provider_config")]
52    pub provider_config: Value,
53    /// Optional one-time initialization commands executed after create.
54    #[serde(default)]
55    pub init: SessionSandboxInitConfig,
56}
57
58impl SessionSandboxConfig {
59    /// Whether the sandbox is created with a desktop: `provider_config.desktop`
60    /// is `true` or an object of computer-use settings (display size and
61    /// action limits).
62    ///
63    /// The `record` key is not a computer-use setting and is left out; read it
64    /// with [`Self::desktop_recording`].
65    pub fn desktop(&self) -> Option<Value> {
66        match self.provider_config.get("desktop") {
67            Some(Value::Bool(true)) => Some(Value::Object(Default::default())),
68            Some(Value::Object(settings)) => {
69                let mut settings = settings.clone();
70                settings.remove(DESKTOP_RECORD_KEY);
71                Some(Value::Object(settings))
72            }
73            _ => None,
74        }
75    }
76
77    /// Whether the desktop is recorded as video: on for every desktop unless
78    /// `provider_config.desktop.record` is `false`.
79    pub fn desktop_recording(&self) -> bool {
80        self.desktop().is_some()
81            && self
82                .provider_config
83                .get("desktop")
84                .and_then(|desktop| desktop.get(DESKTOP_RECORD_KEY))
85                .and_then(Value::as_bool)
86                .unwrap_or(true)
87    }
88}
89
90/// Key of `provider_config.desktop` that turns desktop recording off.
91pub const DESKTOP_RECORD_KEY: &str = "record";
92
93/// The bytes of a [`DesktopRecording`], streamed from the sandbox in chunks.
94pub type RecordingBody = futures::stream::BoxStream<'static, Result<Vec<u8>, String>>;
95
96/// A finished recording of a sandbox desktop, collected from the provider.
97///
98/// Decision: the video is a stream, never a buffer, so a long recording costs
99/// the collector a chunk of memory rather than its whole size. Because the
100/// stream reads from the sandbox, the recording stays there until the caller
101/// has stored it and awaits [`DesktopRecording::remove`]; a failed store
102/// leaves it for the next collection.
103pub struct DesktopRecording {
104    /// File name to store it under, e.g. `2026-10-26T19-50-00Z.mp4`.
105    pub file_name: String,
106    /// Length in seconds, when the provider reports it.
107    pub duration_seconds: Option<f64>,
108    /// Size of the video file in bytes, as the provider reports it.
109    pub size_bytes: u64,
110    /// The video, or `None` when it was larger than the provider's limit.
111    pub body: Option<RecordingBody>,
112    /// Deletes the recording from the sandbox.
113    pub remove: futures::future::BoxFuture<'static, Result<(), String>>,
114}
115
116impl std::fmt::Debug for DesktopRecording {
117    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
118        f.debug_struct("DesktopRecording")
119            .field("file_name", &self.file_name)
120            .field("duration_seconds", &self.duration_seconds)
121            .field("size_bytes", &self.size_bytes)
122            .field("has_body", &self.body.is_some())
123            .finish_non_exhaustive()
124    }
125}
126
127impl Default for SessionSandboxConfig {
128    fn default() -> Self {
129        Self {
130            provider: String::new(),
131            auto_start: true,
132            idle_pause_after_seconds: DEFAULT_SESSION_SANDBOX_IDLE_TIMEOUT_SECS,
133            idle_pause_enabled: true,
134            credential: SessionSandboxCredential::default(),
135            provider_config: default_provider_config(),
136            init: SessionSandboxInitConfig::default(),
137        }
138    }
139}
140
141/// Where a managed Sandbox obtains its provider credential.
142#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
143#[cfg_attr(feature = "openapi", derive(ToSchema))]
144#[serde(rename_all = "snake_case")]
145pub enum SessionSandboxCredentialSource {
146    #[default]
147    None,
148    SessionUser,
149    Agent,
150    Organization,
151    /// The deployment's own access (for example its Kubernetes cluster for
152    /// isolated sandboxes): no user connection, no token from a store.
153    Platform,
154}
155
156/// Non-secret, session-pinned credential binding.
157#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
158#[cfg_attr(feature = "openapi", derive(ToSchema))]
159pub struct SessionSandboxCredential {
160    /// Identity scope from which the provider credential is resolved.
161    #[cfg_attr(feature = "openapi", schema(example = "session_user"))]
162    pub source: SessionSandboxCredentialSource,
163    /// Exact virtual-user owner for user, Agent, and organization grants.
164    #[serde(default, skip_serializing_if = "Option::is_none")]
165    #[cfg_attr(
166        feature = "openapi",
167        schema(example = "00000000-0000-0000-0000-000000000001")
168    )]
169    pub virtual_user_id: Option<Uuid>,
170    /// Exact connection for organization grants, which may have several
171    /// accounts for one provider.
172    #[serde(default, skip_serializing_if = "Option::is_none")]
173    #[cfg_attr(
174        feature = "openapi",
175        schema(example = "00000000-0000-0000-0000-000000000002")
176    )]
177    pub connection_id: Option<Uuid>,
178}
179
180/// One-time sandbox initialization.
181#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
182pub struct SessionSandboxInitConfig {
183    #[serde(default)]
184    pub commands: Vec<String>,
185}
186
187/// Runtime lifecycle status of the managed sandbox.
188#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
189#[serde(rename_all = "snake_case")]
190pub enum SessionSandboxStatus {
191    Running,
192    Paused,
193    /// The provider resource disappeared and must be replaced before use.
194    Lost,
195}
196
197/// Provider-owned physical environment instance record.
198#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
199pub struct SessionSandboxInstance {
200    /// Provider-specific stable identifier (e.g. Daytona sandbox id).
201    pub external_id: String,
202    /// Optional human-readable name.
203    #[serde(skip_serializing_if = "Option::is_none")]
204    pub display_name: Option<String>,
205    /// Optional default workspace path inside the sandbox.
206    #[serde(skip_serializing_if = "Option::is_none")]
207    pub workspace_path: Option<String>,
208    /// Provider-specific non-secret payload needed for resume/ops.
209    #[serde(default)]
210    pub provider_state: Value,
211    /// Provider-specific non-secret metadata for UI/debugging.
212    #[serde(default)]
213    pub metadata: Value,
214}
215
216/// Persisted managed environment state.
217#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
218pub struct SessionSandboxState {
219    /// Hosted logical-sandbox identity and incarnation fence. Legacy secret
220    /// records omit it and acquire one when they are adopted into durable
221    /// control-plane state.
222    #[serde(skip)]
223    pub sandbox: Option<crate::sandbox_checkpoint::SandboxRef>,
224    pub provider: String,
225    pub status: SessionSandboxStatus,
226    pub instance: SessionSandboxInstance,
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub init_completed_at: Option<String>,
229    #[serde(skip_serializing_if = "Option::is_none")]
230    pub last_init_error: Option<String>,
231    pub created_at: String,
232    pub updated_at: String,
233}
234
235/// Provider-neutral exec request.
236#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
237pub struct SessionSandboxExecRequest {
238    pub command: String,
239    #[serde(skip_serializing_if = "Option::is_none")]
240    pub cwd: Option<String>,
241    #[serde(skip_serializing_if = "Option::is_none")]
242    pub timeout_ms: Option<u64>,
243    #[serde(default = "default_output_mode")]
244    pub output_mode: String,
245}
246
247/// Provider-neutral exec result.
248#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
249pub struct SessionSandboxExecResponse {
250    pub exit_code: i32,
251    pub stdout: String,
252    pub stderr: String,
253    pub success: bool,
254    pub truncated: bool,
255    pub total_lines: usize,
256    #[serde(skip_serializing_if = "Option::is_none")]
257    pub raw_output: Option<String>,
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub hint: Option<String>,
260}
261
262/// Provider-neutral file read result.
263#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
264pub struct SessionSandboxReadFileResponse {
265    pub path: String,
266    pub content: String,
267    pub encoding: String,
268}
269
270/// Provider-neutral file write result.
271#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
272pub struct SessionSandboxWriteFileResponse {
273    pub path: String,
274    pub bytes_written: usize,
275}
276
277/// Provider-neutral status view.
278#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
279pub struct SessionSandboxStatusResponse {
280    pub provider: String,
281    pub session_status: SessionSandboxStatus,
282    pub external_id: String,
283    #[serde(skip_serializing_if = "Option::is_none")]
284    pub display_name: Option<String>,
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub workspace_path: Option<String>,
287    #[serde(default)]
288    pub metadata: Value,
289}
290
291/// Session-scoped services used by a sandbox provider. Hosts supply the adapter;
292/// provider implementations never need a runtime or control-plane context type.
293#[async_trait::async_trait]
294pub trait SessionSandboxContext: Send + Sync {
295    fn session_id(&self) -> crate::typed_id::SessionId;
296
297    /// Clone the service handle for long-running lease heartbeats.
298    fn clone_context(&self) -> std::sync::Arc<dyn SessionSandboxContext>;
299
300    async fn connection_token(&self, provider: &str)
301    -> Result<Option<String>, ToolExecutionResult>;
302
303    /// Resolve the provider credential selected by the Session sandbox policy.
304    /// Unlike ordinary tool connections, this never falls back to another
305    /// identity or account.
306    async fn sandbox_connection_token(
307        &self,
308        provider: &str,
309        credential: &SessionSandboxCredential,
310    ) -> Result<Option<String>, ToolExecutionResult>;
311
312    /// Non-secret labels for resources created on behalf of this session.
313    async fn resource_labels(&self) -> serde_json::Map<String, Value>;
314
315    /// The session's merged network access list (harness, Agent, Session),
316    /// which a provider enforces on the sandbox's own outbound traffic where
317    /// it can (`runtime::sandbox_egress`).
318    #[cfg(feature = "runtime")]
319    fn network_access(&self) -> Option<crate::runtime::network_access::NetworkAccessList> {
320        None
321    }
322
323    /// A credential for tunnelling the sandbox's own traffic through the
324    /// host's tenant egress proxy, valid for `valid_for`; `None` when the host
325    /// does not route sandboxes. An error means routing is configured but
326    /// unusable, and the sandbox must not start with direct egress instead.
327    #[cfg(feature = "runtime")]
328    fn sandbox_proxy_credential(
329        &self,
330        _valid_for: std::time::Duration,
331    ) -> Result<Option<crate::runtime::SandboxProxyCredential>, ToolExecutionResult> {
332        Ok(None)
333    }
334
335    /// Labels for the managed Session Sandbox itself: [`Self::resource_labels`]
336    /// plus [`LABEL_MANAGED`], which the orphan scan keys on.
337    async fn managed_resource_labels(&self) -> serde_json::Map<String, Value> {
338        let mut labels = self.resource_labels().await;
339        labels.insert(LABEL_MANAGED.to_string(), json!("true"));
340        labels
341    }
342
343    /// Encrypted session-secret storage for provider bootstrap credentials that
344    /// must survive pause/resume but must never enter the non-secret Sandbox
345    /// snapshot.
346    async fn get_provider_secret(
347        &self,
348        _name: &str,
349    ) -> Result<Option<String>, ToolExecutionResult> {
350        Ok(None)
351    }
352
353    async fn set_provider_secret(
354        &self,
355        _name: &str,
356        _value: &str,
357    ) -> Result<(), ToolExecutionResult> {
358        Err(ToolExecutionResult::internal_error_msg(
359            "Sandbox provider secret storage is unavailable",
360        ))
361    }
362
363    async fn delete_provider_secret(&self, _name: &str) -> Result<(), ToolExecutionResult> {
364        Ok(())
365    }
366
367    /// Refresh the cleanup lease, when the host supports leased resources.
368    async fn refresh_lease(&self, lease: SessionSandboxLease) -> Result<(), ToolExecutionResult>;
369
370    async fn release_lease(
371        &self,
372        provider: &str,
373        external_id: &str,
374    ) -> Result<(), ToolExecutionResult>;
375}
376
377/// Non-secret resource metadata for a sandbox cleanup lease. The context resolves
378/// the owner from its bound connection rather than accepting ownership input.
379#[derive(Debug, Clone)]
380pub struct SessionSandboxLease {
381    pub provider: String,
382    pub external_id: String,
383    pub display_name: Option<String>,
384    pub duration_seconds: u32,
385    pub credential: SessionSandboxCredential,
386    pub metadata: Value,
387}
388
389/// A provider-side sandbox found by label, independent of any Session.
390#[derive(Debug, Clone, PartialEq, Eq)]
391pub struct OwnedSandbox {
392    pub external_id: String,
393    /// Labels/tags/metadata as the provider reports them.
394    pub labels: std::collections::BTreeMap<String, String>,
395    /// Provider-native state, for logs.
396    pub state: String,
397    /// Whether the sandbox still holds compute (and so is worth stopping).
398    pub active: bool,
399    pub created_at: Option<chrono::DateTime<chrono::Utc>>,
400}
401
402/// Failure of a credential-only provider operation (orphan scan).
403#[derive(Debug, Clone, PartialEq, Eq)]
404pub enum SandboxAdminError {
405    /// The provider cannot list or act on sandboxes without a Session.
406    Unsupported,
407    Provider(String),
408}
409
410impl std::fmt::Display for SandboxAdminError {
411    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
412        match self {
413            Self::Unsupported => f.write_str("operation unsupported by this provider"),
414            Self::Provider(message) => f.write_str(message),
415        }
416    }
417}
418
419impl std::error::Error for SandboxAdminError {}
420
421/// Provider trait implemented by integration crates.
422#[async_trait::async_trait]
423pub trait SessionSandboxProvider: Send + Sync {
424    fn id(&self) -> &str;
425
426    /// List the account's sandboxes carrying every label in `labels`.
427    /// Takes the provider credential directly: the orphan scan runs with no
428    /// Session. Callers must still re-check labels on the result.
429    async fn list_owned(
430        &self,
431        _token: &str,
432        _labels: &std::collections::BTreeMap<String, String>,
433    ) -> Result<Vec<OwnedSandbox>, SandboxAdminError> {
434        Err(SandboxAdminError::Unsupported)
435    }
436
437    /// Stop (pause) one sandbox by provider id, keeping its data. A sandbox
438    /// that is already gone counts as stopped.
439    async fn stop_by_id(&self, _token: &str, _external_id: &str) -> Result<(), SandboxAdminError> {
440        Err(SandboxAdminError::Unsupported)
441    }
442
443    /// Delete one sandbox by provider id. A sandbox that is already gone
444    /// counts as deleted.
445    async fn delete_by_id(
446        &self,
447        _token: &str,
448        _external_id: &str,
449    ) -> Result<(), SandboxAdminError> {
450        Err(SandboxAdminError::Unsupported)
451    }
452
453    async fn create(
454        &self,
455        context: &dyn SessionSandboxContext,
456        config: &SessionSandboxConfig,
457    ) -> Result<SessionSandboxInstance, ToolExecutionResult>;
458
459    async fn resume(
460        &self,
461        context: &dyn SessionSandboxContext,
462        config: &SessionSandboxConfig,
463        instance: &SessionSandboxInstance,
464    ) -> Result<SessionSandboxInstance, ToolExecutionResult>;
465
466    async fn pause(
467        &self,
468        context: &dyn SessionSandboxContext,
469        config: &SessionSandboxConfig,
470        instance: &SessionSandboxInstance,
471    ) -> Result<SessionSandboxInstance, ToolExecutionResult>;
472
473    async fn delete(
474        &self,
475        context: &dyn SessionSandboxContext,
476        config: &SessionSandboxConfig,
477        instance: &SessionSandboxInstance,
478    ) -> Result<(), ToolExecutionResult>;
479
480    async fn exec(
481        &self,
482        context: &dyn SessionSandboxContext,
483        config: &SessionSandboxConfig,
484        instance: &SessionSandboxInstance,
485        request: &SessionSandboxExecRequest,
486    ) -> Result<SessionSandboxExecResponse, ToolExecutionResult>;
487
488    async fn read_file(
489        &self,
490        context: &dyn SessionSandboxContext,
491        config: &SessionSandboxConfig,
492        instance: &SessionSandboxInstance,
493        path: &str,
494    ) -> Result<SessionSandboxReadFileResponse, ToolExecutionResult>;
495
496    async fn write_file(
497        &self,
498        context: &dyn SessionSandboxContext,
499        config: &SessionSandboxConfig,
500        instance: &SessionSandboxInstance,
501        path: &str,
502        content: &[u8],
503    ) -> Result<SessionSandboxWriteFileResponse, ToolExecutionResult>;
504
505    /// Persist the current workspace after a completed mutating operation.
506    /// Providers without disposable local filesystems may keep the default.
507    async fn checkpoint(
508        &self,
509        _context: &dyn SessionSandboxContext,
510        _config: &SessionSandboxConfig,
511        instance: &SessionSandboxInstance,
512    ) -> Result<SessionSandboxInstance, ToolExecutionResult> {
513        Ok(instance.clone())
514    }
515
516    /// Point the provider's recovery state at `revision`, or clear it when
517    /// `None`, without touching the running workspace.
518    ///
519    /// Reconciliation decides which revision a session may recover to from the
520    /// checkpoint records; this is how that decision reaches the provider state
521    /// the restore actually reads. Providers with no recovery state keep the
522    /// default: there is nothing to rewind, and reconciliation is a no-op for
523    /// them.
524    async fn rewind_checkpoint(
525        &self,
526        _context: &dyn SessionSandboxContext,
527        _config: &SessionSandboxConfig,
528        instance: &SessionSandboxInstance,
529        _revision: Option<&str>,
530    ) -> Result<SessionSandboxInstance, ToolExecutionResult> {
531        Ok(instance.clone())
532    }
533
534    /// Open the desktop of a sandbox created with a desktop
535    /// (`provider_config.desktop`), started at `display` size. Providers
536    /// without desktops keep the default refusal.
537    #[cfg(feature = "runtime")]
538    async fn open_desktop(
539        &self,
540        _context: &dyn SessionSandboxContext,
541        _config: &SessionSandboxConfig,
542        _instance: &SessionSandboxInstance,
543        _display: crate::runtime::computer_use::DisplaySize,
544    ) -> Result<Box<dyn crate::runtime::computer_use::ComputerSession>, ToolExecutionResult> {
545        Err(ToolExecutionResult::tool_error(format!(
546            "the {} sandbox has no desktop",
547            self.id()
548        )))
549    }
550
551    /// Stop the desktop's recordings and hand back the finished ones, removing
552    /// them from the sandbox. Called when the Session goes idle, so each turn's
553    /// desktop work becomes one video. Providers that cannot record keep the
554    /// default: nothing to collect.
555    async fn collect_desktop_recordings(
556        &self,
557        _context: &dyn SessionSandboxContext,
558        _config: &SessionSandboxConfig,
559        _instance: &SessionSandboxInstance,
560    ) -> Result<Vec<DesktopRecording>, ToolExecutionResult> {
561        Ok(Vec::new())
562    }
563
564    async fn status(
565        &self,
566        context: &dyn SessionSandboxContext,
567        config: &SessionSandboxConfig,
568        state: &SessionSandboxState,
569    ) -> Result<SessionSandboxStatusResponse, ToolExecutionResult>;
570}
571
572/// Inventory registration point for concrete session sandbox providers.
573#[cfg(feature = "session-sandbox")]
574pub struct SessionSandboxProviderPlugin {
575    pub factory: fn() -> Box<dyn SessionSandboxProvider>,
576}
577
578#[cfg(feature = "session-sandbox")]
579inventory::collect!(SessionSandboxProviderPlugin);
580
581/// Look up a registered provider by id.
582#[cfg(feature = "session-sandbox")]
583pub fn create_session_sandbox_provider(
584    provider_id: &str,
585) -> Option<Box<dyn SessionSandboxProvider>> {
586    inventory::iter::<SessionSandboxProviderPlugin>
587        .into_iter()
588        .map(|plugin| (plugin.factory)())
589        .find(|provider| provider.id() == provider_id)
590}
591
592fn default_true() -> bool {
593    true
594}
595fn default_idle_timeout() -> u64 {
596    DEFAULT_SESSION_SANDBOX_IDLE_TIMEOUT_SECS
597}
598fn default_provider_config() -> Value {
599    json!({})
600}
601fn default_output_mode() -> String {
602    // EVE-489: persistence-first default for exec-style sandbox tools.
603    "auto".to_string()
604}
605
606#[cfg(test)]
607mod desktop_tests {
608    use super::*;
609
610    fn config(provider_config: Value) -> SessionSandboxConfig {
611        SessionSandboxConfig {
612            provider: "daytona".to_string(),
613            provider_config,
614            ..Default::default()
615        }
616    }
617
618    #[test]
619    fn desktops_are_recorded_unless_turned_off() {
620        assert!(config(json!({"desktop": true})).desktop_recording());
621        assert!(config(json!({"desktop": {"display_width": 800}})).desktop_recording());
622        assert!(!config(json!({"desktop": {"record": false}})).desktop_recording());
623        assert!(!config(json!({})).desktop_recording());
624        assert!(!config(json!({"desktop": false, "record": true})).desktop_recording());
625    }
626
627    #[test]
628    fn the_record_switch_is_not_a_computer_use_setting() {
629        let settings = config(json!({"desktop": {"record": false, "display_width": 800}}))
630            .desktop()
631            .unwrap();
632        assert_eq!(settings, json!({"display_width": 800}));
633    }
634}