{"record":{"id":"c7ca6e21f5e7c37b","repo":"Tencent/WeKnora","slug":"no-message-service","errorCode":null,"errorMessage":"no message service","messagePattern":"no message service","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/tools/search_conversations.go","lineNumber":125,"sourceCode":"\tvar input SearchConversationsInput\n\tif err := json.Unmarshal(args, &input); err != nil {\n\t\treturn &types.ToolResult{\n\t\t\tSuccess: false,\n\t\t\tError:   fmt.Sprintf(\"Failed to parse args: %v\", err),\n\t\t}, err\n\t}\n\tquery := strings.TrimSpace(input.Query)\n\tif query == \"\" {\n\t\treturn &types.ToolResult{\n\t\t\tSuccess: false,\n\t\t\tError:   \"query is required\",\n\t\t}, fmt.Errorf(\"missing query\")\n\t}\n\tif t.messageService == nil {\n\t\treturn &types.ToolResult{\n\t\t\tSuccess: false,\n\t\t\tError:   \"conversation history search is not available\",\n\t\t}, fmt.Errorf(\"no message service\")\n\t}\n\n\tlimit := input.Limit\n\tif limit <= 0 {\n\t\tlimit = 5\n\t}\n\tif limit > searchConversationsMaxResults {\n\t\tlimit = searchConversationsMaxResults\n\t}\n\n\tresult, err := t.messageService.SearchMessages(ctx, &types.MessageSearchParams{\n\t\tQuery: query,\n\t\tMode:  types.MessageSearchModeHybrid,\n\t\t// Over-fetch so dropping the current session cannot empty the result.\n\t\tLimit:   limit + 2,\n\t\tOwnerID: t.ownerID,\n\t})\n\tif err != nil {","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/tools/search_conversations.go#L107-L143","documentation":"Dependency guard: the message service handle is nil on this tool instance, so past-conversation search is not backed by any storage and the tool reports the feature as unavailable instead of nil-panicking.","triggerScenarios":"Thrown at internal/agent/tools/search_conversations.go:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wire the message service into the tool at construction","Disable/exclude the tool when the service is absent","Surface a feature-unavailable signal to the agent"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}