xai-org/grok-build · error
ACP error: {err}
Error message
ACP error: {err} What it means
The worktree command's ext_call helper sends an ACP (agent control protocol) extension request and converts any error envelope returned by the server into an anyhow error. It is shared by cmd_list, cmd_show, cmd_rm, cmd_gc, and cmd_db, so any server-side rejection of those worktree operations surfaces as this message with the server's error text appended.
Source
Thrown at crates/codegen/xai-grok-pager/src/worktree_cmd/mod.rs:146
#[derive(serde::Deserialize)]
struct ExtEnvelope<T> {
result: Option<T>,
error: Option<serde_json::Value>,
}
async fn ext_call<T: serde::de::DeserializeOwned>(
tx: &xai_acp_lib::AcpAgentTx,
method: &str,
params: &impl serde::Serialize,
) -> Result<T> {
let req =
ext_request(method, params).map_err(|e| anyhow::anyhow!("failed to build request: {e}"))?;
let resp = acp_send(req, tx)
.await
.map_err(|e| anyhow::anyhow!("{e}"))?;
let envelope: ExtEnvelope<T> = serde_json::from_str(resp.0.get())
.map_err(|e| anyhow::anyhow!("response parse error: {e}"))?;
if let Some(err) = envelope.error {
bail!("ACP error: {err}");
}
envelope
.result
.ok_or_else(|| anyhow::anyhow!("ACP response missing result field"))
}
async fn cmd_list(
tx: &xai_acp_lib::AcpAgentTx,
repo: Option<String>,
types: Vec<String>,
json: bool,
all: bool,
) -> Result<()> {
let records: Vec<WorktreeRecord> = ext_call(
tx,
"x.ai/git/worktree/list",
&serde_json::json!({
"repo": repo,
"type": types,View on GitHub (pinned to bc7f02eddd)
Solutions
- Read the `{err}` detail in the message — it carries the actual server-side cause.
- Verify the ACP/agent server is running and matches the CLI version.
- Retry the specific worktree subcommand after resolving the server-side condition (e.g. refresh `worktree list` to get valid ids).
Defensive patterns
Strategy: try-catch
Try / catch
match worktree_list() {
Err(e) if e.to_string().starts_with("ACP error:") => {
eprintln!("ACP server rejected request: {e}; check server health/version");
}
Err(e) => return Err(e),
Ok(v) => use(v),
} Prevention
- Ensure the ACP server is running and version-matched to the CLI.
- Refresh `worktree list` before operating on ids.
- Include the `{err}` detail in bug reports — it names the server-side cause.
When it happens
Trigger: Any of cmd_list/cmd_show/cmd_rm/cmd_gc/cmd_db issuing an ext_call whose response envelope contains an `error` field — e.g. the ACP server rejects the request, is in a bad state, or the operation fails server-side.
Common situations: ACP server not running properly or wrong version; stale worktree ids passed to rm/show/gc; server-side db errors during cmd_db; concurrent modification of worktrees.
Related errors
- e.error (daemon error message propagated via anyhow!)
- -32603
- overlay mount delegation not supported by this delegate
- overlay unmount delegation not supported by this delegate
- invalid worktree id from dest: {worktree_id}
AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31).
Data as JSON: /api/errors/eb6439b32c0e6e6c.
Report an issue: GitHub.