chenhg5/cc-connect · error
acp: probe initialize: %w
Error message
acp: probe initialize: %w
What it means
Wraps a failed JSON-RPC 'initialize' call during the ACP probe handshake in agent/acp/list_sessions.go. It fires when the spawned agent binary does not answer the initialize request within the probe timeout, exits early, or returns a protocol/transport error — meaning the CLI is not a working ACP agent.
Source
Thrown at agent/acp/list_sessions.go:139
<-done
}
}
return tr, &stderrBuf, teardown, nil
}
// probeInitialize performs the ACP handshake on an already-spawned
// transport and returns the parsed initialize result.
func probeInitialize(ctx context.Context, tr *transport) (*acpInitializeResult, error) {
raw, err := tr.call(ctx, "initialize", map[string]any{
"protocolVersion": 1,
"clientCapabilities": map[string]any{
"fs": map[string]any{"readTextFile": false, "writeTextFile": false},
"terminal": false,
},
"clientInfo": map[string]any{"name": "cc-connect", "version": "1.0.0"},
})
if err != nil {
return nil, fmt.Errorf("acp: probe initialize: %w", err)
}
var res acpInitializeResult
if err := json.Unmarshal(raw, &res); err != nil {
return nil, fmt.Errorf("acp: probe parse initialize: %w", err)
}
return &res, nil
}
// probeListSessions runs `session/list` on the given transport.
// Returns (nil, nil) if the agent refuses the call with
// method-not-found / invalid-request — callers interpret that as
// "unsupported" rather than "real error".
func probeListSessions(ctx context.Context, tr *transport, cwdFilter string) ([]acpSessionListEntry, error) {
params := map[string]any{}
if cwdFilter != "" {
params["cwd"] = cwdFilter
}
raw, err := tr.call(ctx, "session/list", params)View on GitHub (pinned to 4000b2338a)
Solutions
- Verify the configured agent binary supports the ACP protocol and the expected protocol version
- Run the agent CLI manually to confirm it starts and prints newline-delimited JSON-RPC on stdout
- Check the wrapped error for timeout vs process-exit causes; increase the probe timeout if the agent is slow to boot
- Inspect the appended stderr output (if any) for the agent's own startup failure message
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at agent/acp/list_sessions.go:139 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/a7f2792798c39bb6.
Report an issue: GitHub.