Skip to content

Fix out of index error#31

Merged
mervyn-teo merged 1 commit intomasterfrom
fix-message-compression
Aug 15, 2025
Merged

Fix out of index error#31
mervyn-teo merged 1 commit intomasterfrom
fix-message-compression

Conversation

@mervyn-teo
Copy link
Owner

This pull request introduces a small but important fix to the compressMsg function in internal/router/chat.go. The change ensures that the code only attempts to access the summary portion of a system message if it actually exists, preventing potential out-of-bounds errors.

  • Reliability improvement:
    • Added a check to ensure pastHistory[1] is only accessed if the split result has at least two elements, preventing possible panics when processing system messages in compressMsg.

@mervyn-teo mervyn-teo merged commit 6f823ef into master Aug 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant