can1357/oh-my-pi · error · ToolError
xd:// is not mounted in this session.
Error message
xd:// is not mounted in this session.
What it means
Writes to xd:// targets are dispatched through the session's mounted xdev transport (this.session.xdev). If no xdev transport is mounted for the session, any xd:// write fails with this ToolError because there is no device layer to dispatch to.
Source
Thrown at packages/coding-agent/src/tools/write.ts:1180
details: { xdev },
isError: result.isError,
useless: result.useless,
};
return;
}
if (name && isResolutionDeviceName(name)) {
const { result, xdev } = await dispatchResolutionDevice(this.session, name, deviceContent);
xdResult = {
content: result.content,
details: { xdev },
isError: result.isError,
useless: result.useless,
};
return;
}
const xdev = this.session.xdev;
if (!xdev) {
throw new ToolError("xd:// is not mounted in this session.");
}
if (!name) {
throw new ToolError(`Cannot write to xd:// itself — pick a device:\n${xdevListing(xdev)}`);
}
const { result, xdev: dispatch } = await dispatchXdevTool(
xdev,
name,
deviceContent,
_toolCallId,
signal,
onUpdate as AgentToolUpdateCallback,
// The write tool's own gate just resolved approval at this
// device's tier (see #approval above) — mark it so a wrapped
// inner tool does not prompt a second time.
context ? { ...context, xdevApproved: true } : undefined,
);
xdResult = {
content: result.content,View on GitHub (pinned to 9690622007)
Solutions
- Mount the xd:// device transport in the session before issuing xd:// writes.
- Verify device setup with `read xd://` — if that also fails, the transport is not configured.
- Fall back to non-xd paths if the session permits local filesystem access.
- Recreate the session with device configuration if the mount was lost.
Defensive patterns
Strategy: fallback
Validate before calling
const mounted = (await read("xd://")).length > 0; // or check session.xdev directly
if (!mounted) throw new Error("xd:// transport not mounted; use local paths or mount devices"); Try / catch
try {
await write(`xd://${device}`, jsonContent);
} catch (err) {
if (String(err.message).includes("not mounted")) {
// fall back to local write or surface a mount-required error
}
throw err;
} Prevention
- Confirm the device transport is mounted at session startup before any xd:// calls.
- Probe with `read xd://` before the first xd:// write of a session.
- Re-mount devices after session restarts or transport teardown.
When it happens
Trigger: Calling write with path `xd://<tool>` (or `xd://` itself) in a session where this.session.xdev is undefined — the device transport was never mounted or has been torn down.
Common situations: Model assuming xd:// is always available; device mount failed at session startup; session restarted without re-mounting devices; SDK embedding that skipped transport setup.
Related errors
- No model configured
- Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL
- Cannot register custom API "${api}": built-in API names are
- Unable to read OMP_AUTH_BROKER_ACCOUNT_POOL_FILE at ${filePa
- OMP_AUTH_BROKER_ACCOUNT_POOL_FILE must contain a JSON object
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/a4dfe8fcf93bd358.
Report an issue: GitHub.