Enters an infinite loop when messages are too long
- Dominant language
- Python
- Stars
- 10
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
MuKav tries to remove messages history in the middle until the prompt size is less than MAX_LENGTH: https://github.com/ASSERT-KTH/DET-Gen/blob/main/src/chatgpt.py#L131
We should add a check like this:
```
if len(messages) < 6:
raise Exception("Messages are too long!!")
```
@bardia-mhd
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/chatgpt.py around line 131, where message history is removed while the prompt exceeds MAX_LENGTH. Check the loop's behavior when fewer than six messages remain, then add the requested failure condition. Done means oversized messages raise the specified exception instead of looping indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100