This repository was archived by the owner on Apr 20, 2026. It is now read-only.
Commit dd5e3ed
fix(hsg): sanitise raw API content blocks before memory storage
Add sanitise_content() called at the top of add_hsg_memory() to strip
{"type": "thinking"}, {"type": "tool_use"}, and {"type": "tool_result"}
JSON blocks before they reach the DB. Memories that reduce to fewer than
20 chars after sanitisation are rejected with a clear error.
Prevents Claude's internal extended thinking monologue from accumulating
as noise in the memory store when /remember or similar skills are run.
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Generated: true1 parent 5537e0b commit dd5e3ed
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1052 | 1068 | | |
1053 | 1069 | | |
1054 | 1070 | | |
| |||
1063 | 1079 | | |
1064 | 1080 | | |
1065 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1066 | 1088 | | |
1067 | 1089 | | |
1068 | 1090 | | |
| |||
0 commit comments