{"record":{"id":"b06299f76a9e12b1","repo":"Tencent/WeKnora","slug":"chat-model-not-available-for-web-fetch-summary","errorCode":null,"errorMessage":"chat model not available for web_fetch summary","messagePattern":"chat model not available for web_fetch summary","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/tools/web_fetch.go","lineNumber":237,"sourceCode":"\t\tData: map[string]interface{}{\n\t\t\t\"results\":          aggregated,\n\t\t\t\"count\":            len(aggregated),\n\t\t\t\"successful_count\": successCount,\n\t\t\t\"failed_count\":     failedCount,\n\t\t\t\"skipped_count\":    skippedCount,\n\t\t\t\"all_failed\":       allFailed,\n\t\t\t\"display_type\":     \"web_fetch_results\",\n\t\t},\n\t}\n\tif allFailed {\n\t\ttoolResult.Error = \"all page fetches failed\"\n\t}\n\treturn toolResult\n}\n\nfunc (t *WebFetchTool) processWithLLM(ctx context.Context, item WebFetchItem, content string) (string, error) {\n\tif t.chatModel == nil {\n\t\treturn \"\", fmt.Errorf(\"chat model not available for web_fetch summary\")\n\t}\n\tmessages := []chat.Message{\n\t\t{\n\t\t\tRole:    \"system\",\n\t\t\tContent: \"Answer the request from the supplied web page text. Never fabricate information that is absent from the page.\",\n\t\t},\n\t\t{\n\t\t\tRole:    \"user\",\n\t\t\tContent: fmt.Sprintf(\"User request:\\n%s\\n\\nWeb page content:\\n%s\", item.Prompt, content),\n\t\t},\n\t}\n\tmodelCtx := types.WithLLMCallMetadata(ctx, \"web_fetch_summary\", \"\")\n\tresponse, err := t.chatModel.Chat(modelCtx, messages, &chat.ChatOptions{Temperature: 0.3, MaxTokens: 1024})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(response.Content), nil\n}","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/tools/web_fetch.go#L219-L255","documentation":"Dependency guard in processWithLLM: the chat model handle is nil (LLM not configured for this web_fetch instance), so fetched page content cannot be summarized and the per-item processing step fails rather than nil-panicking.","triggerScenarios":"Thrown at internal/agent/tools/web_fetch.go:237 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a chat model for the web_fetch tool","Skip LLM summarization and return raw content when no model is available","Report summarization unavailability distinctly from fetch failure"],"exampleFix":null,"handlingStrategy":"fallback","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"}