A streaming text delta that repeats everything streamed so far is missing from the recorded turn
Maintainer thường phản hồi trong vòng 1 ngày
@cpsievert đang làm issue này rồi.
Từ ngày 14/9/2026.
Đá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
- 84/100
Hướng nghiên cứu
Bắt đầu với OpenAICompletionsProvider.stream_merge_chunks và stream_turn, sử dụng bản tái hiện ChatCompletionChunk được cung cấp để theo dõi cách các delta lặp lại được tích lũy và ghi lại. Thêm một regression test bao quát ["\n", "\n", "Here is the answer."] và các ví dụ khác, sau đó xác minh rằng turn được ghi lại khớp với toàn bộ văn bản được stream.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
If a streamed response contains a text delta identical to everything streamed before it, that delta does not make it onto the assistant turn. The caller watches the right text go by, and the turn that gets stored, and sent back as history on the next request, is short by one delta.
The easy case is a response starting with two identical deltas, which is what a leading "\n\n" often looks like coming off a local model.
No API key needed for this, it drives the completions provider's streaming contract:
from openai.types.chat import ChatCompletionChunk
from chatlas._provider_openai_completions import OpenAICompletionsProvider
provider = OpenAICompletionsProvider(api_key="unused", model="gpt-4o-mini")
def chunk(text, last=False):
return ChatCompletionChunk.model_validate({
"id": "chatcmpl-1",
"object": "chat.completion.chunk",
"created": 1,
"model": "gpt-4o-mini",
"choices": [{
"index": 0,
"delta": {"role": "assistant", "content": text},
"finish_reason": "stop" if last else None,
}],
})
deltas = ["\n", "\n", "Here is the answer."]
completion = None
for i, d in enumerate(deltas):
completion = provider.stream_merge_chunks(completion, chunk(d, last=i == len(deltas) - 1))
turn = provider.stream_turn(completion, has_data_model=False)
print("streamed:", repr("".join(deltas)))
print("turn: ", repr(turn.text))
streamed: '\n\nHere is the answer.'
turn: '\nHere is the answer.'
I expected both to be '\n\nHere is the answer.'.
It is not just the first two deltas. ["ab", "c", "abc"] streams abcabc and records abc, while ["ab", "c", "ab"] comes out fine, so it seems to bite when the new delta equals the whole accumulation so far.
chatlas at 7b3aa569, openai 3.13.0, python 3.12.14. Everything built on OpenAICompletionsProvider shares that call, so ChatOllama(), ChatGroq(), ChatDeepSeek() and ChatOpenRouter() are in the same boat. I found it driving the provider rather than a live model, so I cannot say how often a real stream lands on it.
- Ngôn ngữ chính
- Python
- Star
- 179
- Fork
- 32
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 10
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 posit-dev/chatlas
-
ai-triage:needs-review documentation
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày 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
-
ai-triage:done Priority: Low
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-triage:done Priority: Medium
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
posit-dev/chatlas#432 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của posit-dev/chatlas
Issue tương tự
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[TV SHOW]: Dynasty (1981)Đang mởcountry:US rating:6 request-theme type:TV SHOW
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
LizardByte/ThemerrDB#10501 · 1 bình luận ·
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
agentscope-ai/agentscope#4563 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
comp/desktop desktop/chat P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NousResearch/hermes-agent#164451 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
external integration integration-submission
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
langchain-ai/docs#8426 ·
Maintainer thường phản hồi trong vòng 1 ngày