Google realtime: on gemini-3.1 a resumed session loses the seeded history, which #6000 no longer replays
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- ai, audio-video-rtc
Hướng nghiên cứu
Start with the repro script in the issue, which runs google-genai directly with and without history_config set to initial_history_in_client_content, and see which path loses the seeded client content on resume. Then find where the plugin skips chat context replay on resume after #6000 and gate that on whether history_config is set. Done when the 3.1 resume path replays the seeded history and the repro reports kept_seeded_history as true. The issue leaves the replay-versus-diff choice open, so check with maintainers first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What
On gemini-3.1-flash-live-preview, a session resumed with a session resumption handle no longer has the history that was seeded as client content. Since #6000, the plugin skips the chat context replay when it resumes, so after any reconnect or goAway restart the agent has forgotten its initial chat context.
For 3.1, the plugin sets history_config=HistoryConfig(initial_history_in_client_content=True), because the model has no mutable chat context. It then sends the initial chat context once, as client content with turn_complete=False. #6000 assumes "the handle restores the conversation; send only what came after it". With history mode on, the server does not restore that seeded history.
Repro
This uses google-genai 2.29.0 directly, with the same setup the plugin sends for 3.1, and replays nothing on resume, as #6000 does:
import asyncio, os, re
from google import genai
from google.genai import types
MODEL = "gemini-3.1-flash-live-preview"
HISTORY_MODE = os.environ.get("HISTORY", "1") == "1"
client = genai.Client(api_key=os.environ["GOOGLE_API_KEY"])
def config(handle=None):
return types.LiveConnectConfig(
response_modalities=["AUDIO"],
output_audio_transcription=types.AudioTranscriptionConfig(),
system_instruction="You are a terse test assistant. Answer in as few words as possible.",
session_resumption=types.SessionResumptionConfig(handle=handle),
history_config=types.HistoryConfig(initial_history_in_client_content=True) if HISTORY_MODE else None,
)
async def ask(session, text, state):
await session.send_realtime_input(text=text)
said = ""
async for msg in session.receive():
u = msg.session_resumption_update
if u and u.resumable and u.new_handle:
state["handle"] = u.new_handle
sc = msg.server_content
if sc and sc.output_transcription and sc.output_transcription.text:
said += sc.output_transcription.text
if sc and sc.turn_complete:
return said.strip()
async def first_handle(session, state):
state["handle"] = None
async for msg in session.receive():
u = msg.session_resumption_update
if u and u.resumable and u.new_handle:
state["handle"] = u.new_handle
return
async def main():
state = {}
async with client.aio.live.connect(model=MODEL, config=config()) as session:
await session.send_client_content(turns=[
types.Content(role="user", parts=[types.Part(text="My favourite number is 7351. Please remember it.")]),
types.Content(role="model", parts=[types.Part(text="Got it, your favourite number is 7351.")]),
], turn_complete=False)
await ask(session, "Remember this code word for later: BLUEFIN. Reply with just: noted.", state)
await asyncio.wait_for(first_handle(session, state), 10)
async with client.aio.live.connect(model=MODEL, config=config(state["handle"])) as resumed:
after = await ask(resumed, "What is my favourite number, and what was the code word? Answer like: NUMBER WORD", state)
print({"after": after, "kept_seeded_history": bool(re.search(r"7\s?,?351", after))})
asyncio.run(main())
Results, each run resuming with a fresh handle:
history_config |
Seeded history kept after resume |
|---|---|
initial_history_in_client_content=True (what the plugin sends for 3.1) |
0 of 11 runs. Typical answers: "Unknown BLUEFIN", "I don't know your number. BLUEFIN was the word." |
| none | 2 of 3 |
The code word, sent as realtime input, survives the resume. The seeded client content does not.
We hit this in production on a voice agent seeded with each student's prior conversation. After a Gemini drop and reconnect, the tutor forgot everything from before the session. The JS plugin still replays the full context on every reconnect, which is what keeps the seeded history there.
Suggestion
When the session was set up with history_config, i.e. the model has no mutable chat context, keep replaying the full chat context on resume, as before #6000. Alternatively, keep the resumption-diff path only for models whose resumed session is known to hold client content.
lastConsumedClientMessageIndex would be the natural way to tell what a handle covers, but it comes back unset on 3.1 in our runs.
- Ngôn ngữ chính
- Python
- Star
- 14.6k
- Fork
- 3.9k
- Merge trung bình
- 3 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 199
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của livekit/agents
-
Assistant markup is stripped from chat history when expressive mode is offCó thể đã có người làm @ShivamSharma43 đã nhận 18 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsCó thể làm lại được @AbarnaaSree đã nhận 57 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
livekit/agents#7022 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TranslationRoomIO: unset_track() before a track is linked stalls startup, so the translation is never publishedCó thể đã có người làm @RaphaelFakhri đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
livekit/agents#8114 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OpenAI Realtime engine: expose the WebSocket close code and reason to subclassesCó thể đã có người làm @ninglinLiu đã nhận 3 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
livekit/agents#8076 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của livekit/agents
Issue tương tự
-
[Resource] agent-claimcheckĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
yzhao062/awesome-auditable-ai#45 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NVIDIA/flare-local-inference#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/streaming comp/gateway P2 platform/telegram type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#144897 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
request-theme
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
LizardByte/ThemerrDB#9575 ·
Maintainer thường phản hồi trong vòng 1 ngày