You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f438c0a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/architecture/chat-rendering-pipeline.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,11 @@ When the session is done streaming and has artifacts, the `embeddedArtifactPaths
258
258
259
259
PDF export uses `fetch()` + blob download (not `<a>.click()` navigation) because the backend PDF generation takes 5-15 seconds. The `<a>.click()` pattern causes the browser to show "Site wasn't available" for slow responses. The `fetch()` approach shows a loading spinner on the Download button during generation.
260
260
261
-
Artifact content lookup is best-effort across three sources: local host path, live sandbox backend `PullFile`, then persisted transcript `write_file` arguments. The transcript fallback is a recovery/cache path for historical artifacts; it does not prove that the file currently exists in a resumed sandbox. Direct K8s backends should read live files through the backend abstraction first so `/root/foo.md` refers to the composed sandbox rootfs, then fall back only if the live sandbox is unavailable.
261
+
DOCX export runs in the Studio browser via `@m2d/remark-docx`. That package's preprocessing path instantiates WebAssembly, so the Studio CSP permits `script-src 'wasm-unsafe-eval'` while still omitting general JavaScript `'unsafe-eval'`.
262
+
263
+
PDF export is Chrome-only. When sandboxing is enabled, the dedicated PDF browser manager must use the active sandbox backend's Chrome tunnel: Incus for `sandbox.backend: incus`, OpenShell for `openshell`, and direct backend tunneling for `k8s`. It must not silently fall back to Incus for non-Incus backends, and it must not switch to the pure-Go PDF renderer when Chrome cannot launch. Host Chrome is used only when sandboxing is disabled.
264
+
265
+
Artifact content lookup is best-effort across three sources: local host path, live sandbox backend `PullFile`, then persisted transcript reconstruction. The live sandbox read is attempted before transcript fallback whenever a session ID is available; if the backend reports a stopped-but-preserved session, the handler resumes it and waits for readiness before pulling the file. Direct K8s backends should read live files through the backend abstraction first so `/root/foo.md` refers to the composed sandbox rootfs, then fall back only if the live sandbox is unavailable. The transcript fallback is a recovery/cache path for historical artifacts: it replays the latest known `write_file` content plus subsequent matching `edit_file` mutations for the same path, but it does not prove that the file currently exists in a resumed sandbox.
Copy file name to clipboardExpand all lines: docs/architecture/sandbox-backends.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -386,7 +386,7 @@ The entrypoint runs as PID 1 with the privilege path selected at chart-install t
386
386
387
387
**Sandbox binary loader contract.** The intended sandbox `astonish-host` build is static (`CGO_ENABLED=0`), but the `astonish-sandbox-base` image also creates `/lib/ld-musl-x86_64.so.1 -> x86_64-linux-gnu/ld-linux-x86-64.so.2` as a compatibility guard. Without that loader path, a dynamically linked musl binary bind-mounted into the chroot fails with exit `127` and no node handshake (`backend exec: no node response in stdout`) even though `/usr/local/bin/astonish` exists.
388
388
389
-
**Browser-in-sandbox.** Direct K8s uses the same browser `Manager` callbacks as the other sandbox backends, but tunnels through `Backend.ExecStreaming` instead of Incus or OpenShell APIs. Browser tools resolve the current chat session, launch CloakBrowser/Chromium inside `/sandbox/rootfs` via `/usr/local/bin/astonish-shell`, keep that exec stream open so the browser stack stays alive, and connect Rod to CDP through a `socat` tunnel on port `9222`. When KasmVNC is installed, the launcher uses `Xkasmvnc :0` and exposes the web handoff endpoint on port `6901`; otherwise it falls back to `Xvfb :99` for browser automation without visual handoff. The browser dependency catalog explicitly installs GLib/GObject (`libglib2.0-0` on Debian bookworm, `libglib2.0-0t64` on Ubuntu noble) because CloakBrowser is a standalone Chromium binary and apt cannot infer its shared-library dependencies.
389
+
**Browser-in-sandbox.** Direct K8s uses the same browser `Manager` callbacks as the other sandbox backends, but tunnels through `Backend.ExecStreaming` instead of Incus or OpenShell APIs. Browser tools resolve the current chat session, launch CloakBrowser/Chromium inside `/sandbox/rootfs` via `/usr/local/bin/astonish-shell`, keep that exec stream open so the browser stack stays alive, and connect Rod to CDP through a `socat` tunnel on port `9222`. The PDF export browser manager is wired to the same K8s callbacks, using the session ID as the tunnel handle; it does not fall back to Incus or to a non-Chrome renderer. When KasmVNC is installed, the launcher uses `Xkasmvnc :0` and exposes the web handoff endpoint on port `6901`; otherwise it falls back to `Xvfb :99` for browser automation without visual handoff. The browser dependency catalog explicitly installs GLib/GObject (`libglib2.0-0` on Debian bookworm, `libglib2.0-0t64` on Ubuntu noble) because CloakBrowser is a standalone Chromium binary and apt cannot infer its shared-library dependencies.
390
390
391
391
**Rejected alternative.** A separate init container performing the overlay mount would require either a `hostPath` volume (rejected — violates Pod Security Admission `baseline`) or a CSI volume that supports `mountPropagation: Bidirectional` between init and main containers (complex; not all CSI drivers honour it). Doing the mount in the main container's PID 1 keeps the pod spec minimal and works with any CSI driver.
0 commit comments