chenhg5/cc-connect · error
acp: probe parse initialize: %w
Error message
acp: probe parse initialize: %w
What it means
Raised in probeInitialize when the 'initialize' RPC succeeded at the transport level but the returned payload could not be unmarshalled into the expected acpInitializeResult shape. It fires when the agent answers with malformed or non-conforming JSON, indicating a protocol mismatch.
Source
Thrown at agent/acp/list_sessions.go:143
}
// 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)
if err != nil {
if rpcErr, ok := err.(*rpcErrPayload); ok {
if rpcErr.Code == -32601 || rpcErr.Code == -32600 {
return nil, nilView on GitHub (pinned to 4000b2338a)
Solutions
- Confirm the agent implements the ACP initialize response schema the bridge expects
- Update cc-connect to a version matching the agent's ACP protocol version
- Capture the raw initialize response and compare it against the expected structure
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at agent/acp/list_sessions.go:143 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/3cd7f1d61f41d22a.
Report an issue: GitHub.