Glimpse host UI
Open host-owned Glimpse windows from sandboxed code without exposing a browser or compositor.
View source MarkdownThis document explains the user-facing AGS integration for Glimpse.
Use this if you want code running inside the sandbox to open host-owned Glimpse windows.
For the protocol/RFC details, see docs/GLIMPSE_HOST_UI_BRIDGE.md.
What Glimpse means in AGS#
With AGS host UI enabled:
- your agent still runs inside the sandbox
- the actual window is created on the host
- sandboxed code can keep using
glimpseui - AGS wires the sandbox to a host-side Glimpse bridge automatically
This is useful for:
- prompts and lightweight forms
- visual status windows
- host-owned webviews for sandbox-local apps
- packages that already use
glimpseui
You should not need a browser inside the sandbox for the AGS-managed Glimpse path.
What you need on the host#
AGS does not ship the host-side Glimpse binaries itself. You need working host binaries for:
- the host UI service (
glimpse_host_ui/glimpse-host-ui) - a renderer binary (
glimpse) when usingrenderer = "process"
Exact paths depend on how you built or installed the Glimpse projects on your machine.
Minimal config#
Add a [host_ui] section to ~/.config/ags/config.toml.
Example:
[host_ui]
enabled = true
binary = "/path/to/glimpse_host_ui"
renderer = "process"
renderer_bin = "/path/to/glimpse"
idle_timeout_ms = 0
log_level = "info"Field meanings#
enabled- turns on the AGS host UI sidecar
binary- path or command for the host UI service
renderer"process"for real host windows"stub"is mainly useful for testing, not normal interactive use
renderer_bin- required when
renderer = "process" - path to the actual Glimpse renderer binary
- required when
idle_timeout_ms- host UI idle shutdown timeout
0disables idle shutdown and keeps the sidecar alive for the full AGS session
log_level- host UI logging level
How it works#
At runtime AGS:
- starts a per-session host UI service on the host
- keeps that sidecar alive for the full AGS session by default
- mounts its socket into the sandbox
- points sandboxed
glimpseuiat AGS's bundled shim - lets the shim talk to the host UI service
In other words:
- your agent stays sandboxed
- the window lives on the host
- AGS handles the transport automatically
You should not need to set internal env vars like GLIMPSE_BINARY_PATH manually.
Typical usage#
Once [host_ui] is enabled and your image is current:
ags --agent piThen sandboxed code can use glimpseui normally.
If you changed AGS itself, rebuild the release binary and image first:
cargo build --release -p ags
ags update-imageStart a fresh AGS session after rebuilding.
Quick verification inside the sandbox#
Run:
ags --agent shell -- -lc 'echo "$AGS_HOST_UI_SOCK"; echo "$GLIMPSE_BINARY_PATH"; ls -l /opt/ags/glimpse-shim'Expected:
AGS_HOST_UI_SOCK=/run/ags-host-ui/host-ui.sockGLIMPSE_BINARY_PATH=/opt/ags/glimpse-shim/opt/ags/glimpse-shimexists
If those are true, AGS is exposing the host-UI-backed Glimpse path.
Troubleshooting#
Glimpse falls back to Chromium / Chrome detection#
Symptoms:
- logs mention
No Chromium or Chrome installation found - sandboxed code behaves like ordinary upstream
glimpseuifallback logic
Usually this means one of these:
- your
agsbinary is stale - your sandbox image is stale
- you are still in an old AGS session
[host_ui]is disabled or misconfigured
Fix:
cargo build --release -p ags
ags update-image
ags doctorThen start a new session and verify:
ags --agent shell -- -lc 'echo "$GLIMPSE_BINARY_PATH"; echo "$AGS_HOST_UI_SOCK"'No host window appears#
Check:
[host_ui].enabled = true[host_ui].binarypoints to a real executable[host_ui].renderer = "process"for normal usage[host_ui].renderer_binpoints to a real executable
Run:
ags doctorSELinux alerts mentioning pasta / code#
If you previously used an older build that relabeled bind mounts, your worktree may still have the wrong SELinux context.
Restore labels:
restorecon -RFv /home/$USER/code/agent-sandboxIf your repo lives elsewhere, run restorecon on that parent path instead.
Related docs#
docs/CONFIG.md— config field referencedocs/COMMANDS.md— runtime behavior and side effectsdocs/TROUBLESHOOTING.md— common failures and fixesdocs/GLIMPSE_HOST_UI_BRIDGE.md— protocol and architecture details
Improve this page where the source lives.