ASSERT-KTH / ASSERT-KTH/Mokav

Enters an infinite loop when messages are too long

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.