{"record":{"id":"1f826623cc40ef22","repo":"jaegertracing/jaeger","slug":"initialize-w","errorCode":null,"errorMessage":"initialize: %w","messagePattern":"initialize: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/jaegerai/aihealth/acp_check.go","lineNumber":63,"sourceCode":"\t\t}\n\t\tdefer adapter.Close()\n\n\t\tconn := acp.NewConnection(noopMethodHandler, adapter, adapter)\n\t\tconn.SetLogger(silentACPLogger)\n\n\t\treq := acp.InitializeRequest{\n\t\t\tProtocolVersion: acp.ProtocolVersionNumber,\n\t\t\tClientCapabilities: acp.ClientCapabilities{\n\t\t\t\tFs:       acp.FileSystemCapabilities{ReadTextFile: false, WriteTextFile: false},\n\t\t\t\tTerminal: false,\n\t\t\t},\n\t\t\tClientInfo: &acp.Implementation{\n\t\t\t\tName:    \"jaeger-ai-check\",\n\t\t\t\tVersion: version.Get().GitVersion,\n\t\t\t},\n\t\t}\n\t\tif _, err := acp.SendRequest[acp.InitializeResponse](conn, ctx, acp.AgentMethodInitialize, req); err != nil {\n\t\t\treturn fmt.Errorf(\"initialize: %w\", err)\n\t\t}\n\t\treturn nil\n\t}\n}\n","sourceCodeStart":45,"sourceCodeEnd":68,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/jaegerai/aihealth/acp_check.go#L45-L68","documentation":"After dialing, the ACP health check sends an initialize request (acp.AgentMethodInitialize) and expects an InitializeResponse; failure is wrapped as \"initialize: <cause>\". This proves the agent speaks ACP, not just that the socket opened.","triggerScenarios":"WebSocket connects but the initialize request times out (ctx deadline), the agent returns a request error, or the response cannot be decoded as acp.InitializeResponse.","commonSituations":"Agent accepts connections but speaks a different/incompatible protocol version; agent is overloaded and slow to answer so the health-check context times out; a proxy strips or corrupts frames.","solutions":["Check the agent's logs for errors handling the initialize method.","Verify agent protocol compatibility with the ACP version Jaeger's client (jaeger-ai-check) implements.","Increase the health check timeout if the agent is slow to respond (ai.health_check_timeout).","Rule out intermediaries (proxies) that interfere with WebSocket frames."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := healthCheck(ctx); err != nil {\n    if strings.Contains(err.Error(), \"initialize: \") {\n        // agent reachable but protocol/handshake issue: check agent logs and version compat\n        log.Printf(\"ACP initialize failed: %v\", err)\n    }\n}","preventionTips":["Keep the agent's ACP protocol version compatible with the jaegerquery client.","Set ai.health_check_timeout generously enough for slow agent startup.","Update agent and Jaeger together when protocol versions change."],"tags":["acp","health-check","protocol"],"backgroundTag":"protocol-handshake-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}