{"record":{"id":"5e54e955ff2fdc32","repo":"chenhg5/cc-connect","slug":"acp-parse-session-list-w","errorCode":null,"errorMessage":"acp: parse session/list: %w","messagePattern":"acp: parse session/list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/acp/list_sessions.go","lineNumber":168,"sourceCode":"// method-not-found / invalid-request — callers interpret that as\n// \"unsupported\" rather than \"real error\".\nfunc probeListSessions(ctx context.Context, tr *transport, cwdFilter string) ([]acpSessionListEntry, error) {\n\tparams := map[string]any{}\n\tif cwdFilter != \"\" {\n\t\tparams[\"cwd\"] = cwdFilter\n\t}\n\traw, err := tr.call(ctx, \"session/list\", params)\n\tif err != nil {\n\t\tif rpcErr, ok := err.(*rpcErrPayload); ok {\n\t\t\tif rpcErr.Code == -32601 || rpcErr.Code == -32600 {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t}\n\t\treturn nil, err\n\t}\n\tvar out acpSessionListResult\n\tif err := json.Unmarshal(raw, &out); err != nil {\n\t\treturn nil, fmt.Errorf(\"acp: parse session/list: %w\", err)\n\t}\n\treturn out.Sessions, nil\n}\n\n// ListSessions returns past sessions reported by the ACP agent, scoped\n// to the agent's work_dir. If the agent does not advertise\n// sessionCapabilities.list or the call soft-fails, returns nil.\n//\n// This runs a one-shot `<command>` process that performs only\n// initialize + session/list, so it does NOT allocate a real session on\n// the backend (unlike session/new). Cost is roughly a single ACP\n// handshake round-trip (~100-500ms for Devin).\nfunc (a *Agent) ListSessions(ctx context.Context) ([]core.AgentSessionInfo, error) {\n\tif a.listUnsupported.Load() {\n\t\t// Already learned this agent doesn't support session/list;\n\t\t// fast-path out to avoid respawning just to rediscover that.\n\t\treturn nil, nil\n\t}","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/acp/list_sessions.go#L150-L186","documentation":"Raised in probeListSessions when the 'session/list' RPC returned a payload that failed to unmarshal into acpSessionListResult. Note that -32601/-32600 method-not-found errors are soft-skipped earlier; this error only fires on a successful reply with an unexpected body, i.e. a schema mismatch with the probed agent.","triggerScenarios":"Thrown at agent/acp/list_sessions.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether the agent's session/list response format differs from what this cc-connect version parses","Upgrade cc-connect or the agent CLI so both speak the same session/list schema","Log the raw RPC payload to identify the offending field"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}