diff --git a/crates/automation/src/agents_tests.rs b/crates/automation/src/agents_tests.rs index c1ddcfcac..a4fde85e1 100644 --- a/crates/automation/src/agents_tests.rs +++ b/crates/automation/src/agents_tests.rs @@ -62,6 +62,12 @@ fn fake_window(token: String) -> (u16, Arc>>) { /// Publishes a window on `port` in `dir` as the app does, its token file holding `token`. fn publish(dir: &Path, port: u16, token: &str) { std::fs::write(dir.join(TOKEN_FILE), token).unwrap(); + // Owner-only, as the app writes it: the client refuses a token others can read. + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(dir.join(TOKEN_FILE), std::fs::Permissions::from_mode(0o600)).unwrap(); + } write_connection(dir, &Connection::new(port, dir.join(TOKEN_FILE), "EffectCraft test")).unwrap(); } diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 4ba738de1..ab7d7f218 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -884,11 +884,9 @@ fn render_frame(app: &EffectcraftApp, p: &Value) -> Outcome { .and_then(Value::as_str) .map(str::to_string) .unwrap_or_else(|| std::env::temp_dir().join(format!("effectcraft-frame-{}.png", std::process::id())).to_string_lossy().to_string()); + // Written and inline: the reply carries the bytes the file holds. if inline { - out["png"] = match inline_png(&rgba, w, h) { - Ok(png) => json!(png), - Err(e) => return err(e), - }; + out["png"] = json!(base64(&png)); } match s.write_output_guarded(&guard, &path, &png) { Ok(()) => {