{"record":{"id":"2dd67dbd5fba8243","repo":"chenhg5/cc-connect","slug":"agent-error-no-details","errorCode":null,"errorMessage":"agent error (no details)","messagePattern":"agent error \\(no details\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/engine.go","lineNumber":16072,"sourceCode":"\t\t\tif currentID := agentSession.CurrentSessionID(); currentID != \"\" {\n\t\t\t\tsaveRelaySessionID(currentID, true)\n\t\t\t}\n\t\t\tresp := event.Content\n\t\t\tif resp == \"\" && len(textParts) > 0 {\n\t\t\t\tresp = strings.Join(textParts, \"\")\n\t\t\t}\n\t\t\tif resp == \"\" {\n\t\t\t\tresp = \"(empty response)\"\n\t\t\t}\n\t\t\tslog.Info(\"relay: turn complete\", \"from\", fromProject, \"to\", e.name, \"response_len\", len(resp))\n\t\t\tagentSession.Close()\n\t\t\treturn resp, nil\n\t\tcase EventError:\n\t\t\tagentSession.Close()\n\t\t\tif event.Error != nil {\n\t\t\t\treturn \"\", event.Error\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"agent error (no details)\")\n\t\tcase EventPermissionRequest:\n\t\t\t// Auto-approve all permissions in relay mode\n\t\t\t_ = agentSession.RespondPermission(event.RequestID, PermissionResult{\n\t\t\t\tBehavior:     \"allow\",\n\t\t\t\tUpdatedInput: event.ToolInputRaw,\n\t\t\t})\n\t\t}\n\t\tif ctx.Err() != nil {\n\t\t\t// Relay timed out. Let the agent finish its turn in the\n\t\t\t// background so the session state is saved cleanly and the\n\t\t\t// session remains resumable for the next relay call.\n\t\t\tgo e.drainRelaySession(agentSession, session, sessions, agent.Name(), relaySessionKey)\n\t\t\treturn relayPartialResponseOrError(ctx.Err(), textParts, fromProject, e.name)\n\t\t}\n\t}\n\n\t// Event channel closed without EventResult.\n\tagentSession.Close()","sourceCodeStart":16054,"sourceCodeEnd":16090,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/engine.go#L16054-L16090","documentation":"During relay event streaming, the agent emitted an EventError whose event.Error field was nil, so cc-connect returns a generic 'agent error (no details)' sentinel. The agent signalled failure without attaching an error object, leaving no cause to propagate. This is a defensive branch so callers always get a non-nil error.","triggerScenarios":"The relay event loop receives event.Type == EventError with event.Error == nil — an agent adapter emitted a failure event without populating Error (adapter bug, or the agent CLI produced an unparseable failure output that was normalized to an empty error).","commonSituations":"Agent CLI crashed with output the adapter couldn't parse into a structured error; custom/third-party agent adapter with incomplete EventError handling; agent stderr lost due to pipe buffering so no detail was captured.","solutions":["Check agent process stderr/logs around the failure timestamp for the real cause","Retry — intermittent agent crashes often include proper error detail on retry","Update or fix the agent adapter so it always populates EventError.Error","Check agent CLI version for known crash bugs and upgrade"],"exampleFix":"// before (adapter emitting the event)\nevents <- Event{Type: EventError}\n// after\nevents <- Event{Type: EventError, Error: fmt.Errorf(\"agent exited: %s\", stderrTail)}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"case EventError:\n    agentSession.Close()\n    if event.Error != nil {\n        return \"\", event.Error\n    }\n    slog.Error(\"agent error without detail; check agent stderr\")\n    return \"\", fmt.Errorf(\"agent error (no details)\")","preventionTips":["Use first-party or well-tested agent adapters that always populate EventError.Error","Capture and log agent stderr so failures are attributable even when Error is nil","Keep agent CLIs updated to avoid unparseable crash output","Retry once on detail-less agent errors before surfacing to the user"],"tags":["agent","relay","event-stream","go"],"backgroundTag":"upstream-api-error","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}