How to debug Portal wrapper failures
Goal
Find and fix common failures for wl-paste/gh wrappers and other Portal clients.
Quick checklist
- Is host service running?
- If
[portal].global = true:pgrep -a agent-portal-host - If
[portal].global = false,ab spawnshould start one automatically for that session.
- If
- Can you ping the socket directly?
agent-portal-cli ping - Is the wrapper using the expected socket path?
echo "$AGENT_PORTAL_SOCKET" - Enable host logging with
RUST_LOG:
WhenRUST_LOG=agent_portal=debug,agent_portal_host=trace agent-portal-hostagent-portal-hostis run directly, logs are visible in the terminal and also written to the log file. Managed hosts started byab spawnlog only to files. - Inspect the log file:
- Log files live under:
${XDG_STATE_HOME:-$HOME/.local/state}/agent-box/logs/ - The log filename matches the socket filename, with
.sockreplaced by.log. - Example:
portal.sock->portal.log - In managed per-container mode (
[portal].global = false), each spawned socket gets its own matching log file. - Use
RUST_LOG=debug ab spawn ...if you want more verbose managed-host logs.
- Log files live under:
Common failures
- failed to connect to socket
- socket path mismatch or host service not running
- denied
- policy mode blocks method/container
- prompt_failed
prompt_commandmissing or exits non-zero in ask-mode
- clipboard_failed
- no allowed image MIME currently in clipboard or a host Wayland clipboard access issue
- gh_exec_failed
- host
ghunavailable or command failure
- host
Next actions
- Confirm
[portal.policy]defaults and overrides. - Confirm wrapper is first on PATH in container.
- Re-run request via
agent-portal-clito isolate wrapper-specific parsing issues.