Tencent/WeKnora · error

no message service

Error message

no message service

What it means

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.

Source

Thrown at internal/agent/tools/search_conversations.go:125

	var input SearchConversationsInput
	if err := json.Unmarshal(args, &input); err != nil {
		return &types.ToolResult{
			Success: false,
			Error:   fmt.Sprintf("Failed to parse args: %v", err),
		}, err
	}
	query := strings.TrimSpace(input.Query)
	if query == "" {
		return &types.ToolResult{
			Success: false,
			Error:   "query is required",
		}, fmt.Errorf("missing query")
	}
	if t.messageService == nil {
		return &types.ToolResult{
			Success: false,
			Error:   "conversation history search is not available",
		}, fmt.Errorf("no message service")
	}

	limit := input.Limit
	if limit <= 0 {
		limit = 5
	}
	if limit > searchConversationsMaxResults {
		limit = searchConversationsMaxResults
	}

	result, err := t.messageService.SearchMessages(ctx, &types.MessageSearchParams{
		Query: query,
		Mode:  types.MessageSearchModeHybrid,
		// Over-fetch so dropping the current session cannot empty the result.
		Limit:   limit + 2,
		OwnerID: t.ownerID,
	})
	if err != nil {

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Wire the message service into the tool at construction
  2. Disable/exclude the tool when the service is absent
  3. Surface a feature-unavailable signal to the agent
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at internal/agent/tools/search_conversations.go:125 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/c7ca6e21f5e7c37b. Report an issue: GitHub.