Skip to content

Message compression#30

Merged
mervyn-teo merged 4 commits intomasterfrom
message-compression
Aug 15, 2025
Merged

Message compression#30
mervyn-teo merged 4 commits intomasterfrom
message-compression

Conversation

@mervyn-teo
Copy link
Owner

This pull request introduces a message history compression feature to manage long chat histories more efficiently, replacing the previous message trimming approach. It also updates several dependencies and makes minor configuration changes. The most significant updates are detailed below.

Message History Compression:

  • Replaces message trimming with a new compression mechanism: when a user's message history exceeds MaxMessagesToKeep, the history is summarized using a model and stored as a concise system message, preserving essential context. (internal/router/chat.go) [1] [2]
  • Adds a CompressionPrompt constant to guide the summarization process and introduces an initialSystemMessage variable to maintain context. (internal/router/chat.go) [1] [2]

Dependency Updates:

  • Updates several dependencies in go.mod, including aws-sdk-go-v2, discordgo, go-openai, and others, to newer versions for improved stability and features. (go.mod)

Configuration and Test Adjustments:

  • Changes the path to the .env file in the test setup to use a relative path, improving test environment consistency. (internal/voiceChatUtils/voice_test.go)
  • Removes an unnecessary Git mapping from the .idea/vcs.xml configuration. (.idea/vcs.xml)

Function Signature Update:

  • Updates the MessageLoop function signature to accept an additional initSystemMessage parameter, ensuring the system message context is preserved during compression. (cmd/api/main.go, internal/router/chat.go) [1] [2]

@codecov
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

❌ Patch coverage is 13.33333% with 52 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/router/chat.go 13.55% 50 Missing and 1 partial ⚠️
cmd/api/main.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
cmd/api/main.go 0.00% <0.00%> (ø)
internal/router/chat.go 66.17% <13.55%> (-11.45%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mervyn-teo mervyn-teo merged commit b00c28e into master Aug 15, 2025
3 checks 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