[BUG] Python memory summarization fails for Gemini models: the request has no model name

Đang mở Phù hợp với người mới
#3,710 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@BahaaMattar đang làm issue này rồi.

Từ ngày 17/11/2026.

  • #3711 của @BahaaMattar — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
google-cloud, python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại python/packages/kagent-adk/src/kagent/adk/_memory_service.py và đọc KagentMemoryService._summarize_session_content_async, sau đó kiểm tra cách các yêu cầu Gemini nhận tên mô hình. Tái hiện bằng ứng dụng khách Gemini giả lập được mô tả trong issue và thêm một bài kiểm thử tập trung cho yêu cầu. Công việc được xem là hoàn tất khi phần tóm tắt trả về các dữ kiện đã trích xuất và yêu cầu có tên mô hình đã cấu hình.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

📋 Prerequisites
  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue
🎯 Affected Service(s)

App Service

🚦 Impact/Severity

Minor inconvenience

🐛 Bug Description

KagentMemoryService._summarize_session_content_async (python/packages/kagent-adk/src/kagent/adk/_memory_service.py) builds LlmRequest(contents=[...]) without model. google-adk's Gemini raises Gemini requests require a model name. for such a request. With memory enabled on a gemini or gemini_vertex_ai ModelConfig, the session summary therefore always fails and the raw transcript is stored as a single memory instead of the extracted facts. The other providers fall back to their own model name, so they're not affected.

🔄 Steps To Reproduce

On main (29aaacd, google-adk 2.14.1), with a stub Gemini client:

import asyncio
from types import SimpleNamespace
from unittest.mock import MagicMock
from google.genai import types
from kagent.adk._memory_service import KagentMemoryService
from kagent.adk.models._gemini import KAgentGeminiLlm

async def generate_content(*, model, contents, config):
    print("model sent:", model)
    return types.GenerateContentResponse(candidates=[types.Candidate(content=types.Content(role="model", parts=[types.Part(text='["User prefers dark mode"]')]))])

llm = KAgentGeminiLlm(model="gemini-2.5-flash")
llm.__dict__["api_client"] = SimpleNamespace(vertexai=False, aio=SimpleNamespace(models=SimpleNamespace(generate_content=generate_content)))
print(asyncio.run(KagentMemoryService(controller_client=MagicMock())._summarize_session_content_async("user: I like dark mode", model=llm)))
🤔 Expected Behavior

['User prefers dark mode'], with the request naming gemini-2.5-flash.

📱 Actual Behavior
WARNING kagent.adk._memory_service: Failed to summarize session content: Gemini requests require a model name.. Using original.
['user: I like dark mode']

generate_content is never called.

💻 Environment

kagent main (29aaacd), Python ADK runtime, google-adk 2.14.1, Python 3.13.

🔍 Additional Context

google-adk's own LlmEventSummarizer passes model=self._llm.model for the same reason. Passing model=model.model in the summarization request fixes it; I have a fix with a test.

🙋 Are you willing to contribute?
  • I am willing to submit a PR to fix this issue
Ngôn ngữ chính
Go
Star
4.5k
Fork
937
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
150

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của kagent-dev/kagent

Tất cả issue của kagent-dev/kagent

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.