bug: conversation context selects the oldest thread messages instead of recent replies
Maintainer thường phản hồi trong vòng 1 ngày
Đá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
Trong bot.py, kiểm tra _build_conversation_context() và lời gọi thread.history(). Dùng tin nhắn hiện tại làm mốc giới hạn lịch sử, giữ giới hạn bốn tin nhắn và kiểm tra kết quả được sắp xếp theo trình tự thời gian, đồng thời ngữ cảnh tham chiếu trả lời tường minh vẫn khả dụng. Tái hiện bằng bản tái hiện độc lập có thể thực thi được đề cập trong issue; hoàn tất khi chọn các tin nhắn 7–10 trước tin nhắn 11.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Description
Summary
_build_conversation_context() fetches the oldest four thread messages and labels them as the immediately preceding discussion. Recent corrections are absent from the context used for answers, repository routing, and issue drafting.
Root cause
In bot.py:203, thread.history(limit=THREAD_HISTORY_LIMIT, oldest_first=True) has no before/after cursor. With discord.py 2.7.1 this starts at after=0, selecting the thread's first four messages. Slicing the resulting context later cannot recover messages that were never fetched.
Expected vs. actual behavior
Expected: for current message 11, select messages 7-10 in chronological order and exclude the current message and later messages.
Actual: select messages 1-4. Explicit reply-reference context should remain available independently.
Proposed fix
Fetch newest-first with before=current_msg, then reverse the bounded result before formatting it. Keep the existing four-message limit, formatting, and explicit reply-reference handling.
Duplicate check
Checked all 10 open issues and 7 open PRs on 28 November 2026. No matching report was found. #58 concerns reconnect/backlog processing; #24 concerns repository document size. The public patches for PRs #60, #70 and #71 do not change this history request.
AI assistance
N/A
Steps to Reproduce
- In an unmodified checkout, consider a thread containing messages 1-10 and a current message with ID 11.
- Call
_build_conversation_context(thread, author, query, current_msg)without an explicit reply reference. - Inspect the context passed to the model: the history request starts at after=0 and contains messages 1-4 instead of 7-10.
This was reproduced offline with discord.py's real history iterator and a fixture replacing its HTTP boundary. A standalone executable reproduction is available for this report.
Logs and Screenshots
History arguments: [{'limit': 4, 'before': None, 'after': 0}]
Immediate preceding context (last 3-4 messages & reply target):
Contributor: message-1
Contributor: message-2
Contributor: message-3
Contributor: message-4
PRIMARY TAGGED QUESTION (from Contributor): please explain the fix
AssertionError: Expected immediately preceding messages 7-10; got the thread's oldest messages
The unmodified checkout exits 1. The patched checkout selects messages 7-10 and exits 0.
Environment Details
Linux; Python 3.12.14; discord.py 2.7.1. Tested commit: a03e0dbac0f9a74a1231c161b40372d420fd8018.
Impact
Medium - Feature works but has issues
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Ngôn ngữ chính
- Python
- Star
- 10
- Fork
- 12
- Merge trung bình
- 3 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 AOSSIE-Org/SkillBot
-
[BUG]: Issue-creation intent is missed when the article is omitted (create issue for this)Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
AOSSIE-Org/SkillBot#65 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: Non-Atomic Gap Log Writes Can Cause Data Loss After an Interrupted SaveCó thể đã có người làm @sankalpmtellur đã nhận 4 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AOSSIE-Org/SkillBot#61 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: os.chdir() Changes the Process-Wide Working Directory During Repository SyncCó thể đã có người làm @aadityachhipa80-oss đã nhận 12 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
AOSSIE-Org/SkillBot#59 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: wait_for_ollama() Retries Indefinitely When Ollama Is UnavailableCó thể làm lại được @SYED-IRTEZA-HUSSAIN-RIZVI đã nhận 22 ngày trước và không có pull request nào đang mở. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AOSSIE-Org/SkillBot#56 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: Backlog Messages Are Re-processed on Discord ReconnectionCó thể làm lại được @SYED-IRTEZA-HUSSAIN-RIZVI đã nhận 22 ngày trước và không có pull request nào đang mở. Đang mởbug enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
AOSSIE-Org/SkillBot#58 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của AOSSIE-Org/SkillBot
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bad-antics/lateralus-lang#1438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: control app
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
glossyio/traffic-monitor#415 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
apply_matrix_rect takes 6-9% of extract_text timeCó thể đã có người làm @g4lb đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
pdfminer/pdfminer.six#1333 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
intake mcp-intake needs-human-review priority:high type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Ikalus1988/MisakaNet#6081 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày