bug: conversation context selects the oldest thread messages instead of recent replies
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
Direzione di ricerca
In bot.py, esamina _build_conversation_context() e la chiamata a thread.history(). Usa il messaggio corrente come limite della cronologia, mantieni il limite di quattro messaggi e verifica che il risultato sia ordinato cronologicamente e che il contesto esplicito dei riferimenti alle risposte resti disponibile. Riproduci il problema con la riproduzione eseguibile autonoma menzionata nell’issue; il lavoro è completato quando seleziona i messaggi da 7 a 10 prima del messaggio 11.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 10
- Fork
- 12
- Merge medio
- 3m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/SkillBot
-
[BUG]: Issue-creation intent is missed when the article is omitted (create issue for this)Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
AOSSIE-Org/SkillBot#65 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Non-Atomic Gap Log Writes Can Cause Data Loss After an Interrupted SaveForse già presa @sankalpmtellur l’ha presa 4 giorni fa. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
AOSSIE-Org/SkillBot#61 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: os.chdir() Changes the Process-Wide Working Directory During Repository SyncForse già presa @aadityachhipa80-oss l’ha presa 12 giorni fa. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
AOSSIE-Org/SkillBot#59 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: wait_for_ollama() Retries Indefinitely When Ollama Is UnavailableForse di nuovo libera @SYED-IRTEZA-HUSSAIN-RIZVI l’ha presa 22 giorni fa e non c’è nessuna pull request aperta. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AOSSIE-Org/SkillBot#56 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Backlog Messages Are Re-processed on Discord ReconnectionForse di nuovo libera @SYED-IRTEZA-HUSSAIN-RIZVI l’ha presa 22 giorni fa e non c’è nessuna pull request aperta. Apertabug enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
AOSSIE-Org/SkillBot#58 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di AOSSIE-Org/SkillBot
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
bad-antics/lateralus-lang#1438 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
area: control app
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
glossyio/traffic-monitor#415 ·
I maintainer di solito rispondono entro 1 giorno
-
apply_matrix_rect takes 6-9% of extract_text timeForse già presa @g4lb l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
pdfminer/pdfminer.six#1333 ·
I maintainer di solito rispondono entro 1 giorno
-
intake mcp-intake needs-human-review priority:high type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Ikalus1988/MisakaNet#6081 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno