Support shinychat history for composed Chatlas clients such as Python Commons
Maintainer thường phản hồi trong vòng 4 ngày
@jat255 đang làm issue này rồi.
Từ ngày 14/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
For Python only, when using commons with page_chat, the conversation history feature doesn't work; it's always blank.
Python Commons deliberately composes a chatlas.Chat rather than subclassing it. It exposes Chatlas-compatible behavior:
stream_async(...)get_turns() -> list[chatlas.Turn]set_turns(Sequence[chatlas.Turn])
This allows shinychat to stream from a Commons agent directly.
However, shinychat recognizes Chatlas turn history using a nominal check equivalent to:
isinstance(client, chatlas.Chat)
Other clients follow the generic ClientWithTurns path, which expects JSON-round-trippable turns. Commons therefore falls into the generic path even though its history uses chatlas.Turn semantics.
The result is that direct streaming works, but shinychat's conversation history and New Chat support require an application-level adapter that converts:
chatlas.Turn <-> JSON dictionaries
For example, the desired integration is roughly:
agent = Commons(...)
chat = shinychat.Chat("chat", client=agent)
ui = shinychat.page_chat("chat", history=True)
without needing a wrapper solely for history serialization.
History restoration also needs to call Commons.queue_restore_reminder(), similar to the hook installed by R's commons_server().
Possible directions
Some possible fixes:
- Have shinychat or chatlas define an explicit protocol or capability for clients whose history uses
chatlas.Turn. - Give clients explicit JSON history serialization/deserialization methods.
- Standardize one history representation across shinychat clients.
- Add a Python integration helper analogous to R's
commons_server().
- Ngôn ngữ chính
- Python
- Star
- 69
- Fork
- 5
- Merge trung bình
- 5 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 38
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/commons
-
Remove the `pull_request_target` workflow before GitHub blocks itCó thể đã có người làm @jat255 đã 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 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
posit-dev/commons#473 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của posit-dev/commons
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] vllm-sr config migrate drops providers.models[].deploymentCó thể đã có người làm @Bevisy đã nhận hôm nay. Đang mởneeds-acceptance wg/developer-experience-ecosystem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
vllm-project/semantic-router#5996 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bugfix low-priority plugin:abstract plugin:leyline small-effort source:discussion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
athola/claude-night-market#1132 ·
-
Add support for Sinhala languageĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
WeblateOrg/language-data#2773 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Đang mởkind/bug priority/medium qa_automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
yugabyte/yugabyte-db#37324 ·
Maintainer thường phản hồi trong vòng 1 ngày