Bug Description
Manual session compression (/compress) causes system prompt to double in size (20,957 → 42,303 chars, +102%) due to duplicate agent identity definitions being concatenated.
Steps to Reproduce
-
Run session with 300+ messages
-
Trigger manual compression (/compress)
-
Check database:
bash
sqlite3 ~/.hermes/state.db "SELECT id, length(system_prompt) FROM sessions ORDER BY started_at DESC LIMIT 2;"
-
Verify duplication:
bash
sqlite3 ~/.hermes/state.db "SELECT system_prompt FROM sessions WHERE id = 'new_session_id';" | grep -c "You are Hermes Agent"
Returns: 2 (should be 1)
Expected Behavior
| Metric |
Old Session |
New Session |
Change |
| System Prompt Size |
20,957 chars |
42,303 chars |
+102% |
| "You are Hermes Agent" count |
1 |
2 |
Duplicate |
| Compression Summary |
N/A |
Not found |
Missing |
Actual Behavior
| Metric |
Old Session |
New Session |
Change |
| System Prompt Size |
20,957 chars |
42,303 chars |
+102% |
| "You are Hermes Agent" count |
1 |
2 |
Duplicate |
| Compression Summary |
N/A |
Not found |
Missing |
Affected Component
Other
Messaging Platform (if gateway-related)
No response
Debug Report
Report https://paste.rs/JoS7X
agent.log https://paste.rs/eBZD3
gateway.log https://paste.rs/4lssL
Operating System
macOS 26.4.1
Python Version
3.11.15
Hermes Version
v0.11.0 (2026.4.23)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
Bug Description
Manual session compression (/compress) causes system prompt to double in size (20,957 → 42,303 chars, +102%) due to duplicate agent identity definitions being concatenated.
Steps to Reproduce
Run session with 300+ messages
Trigger manual compression (/compress)
Check database:
bash
sqlite3 ~/.hermes/state.db "SELECT id, length(system_prompt) FROM sessions ORDER BY started_at DESC LIMIT 2;"
Verify duplication:
bash
sqlite3 ~/.hermes/state.db "SELECT system_prompt FROM sessions WHERE id = 'new_session_id';" | grep -c "You are Hermes Agent"
Returns: 2 (should be 1)
Expected Behavior
Actual Behavior
Affected Component
Other
Messaging Platform (if gateway-related)
No response
Debug Report
Operating System
macOS 26.4.1
Python Version
3.11.15
Hermes Version
v0.11.0 (2026.4.23)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?