@@ -224,8 +224,10 @@ func TestShouldSkipJSONLField(t *testing.T) {
224224 {"ids" , true },
225225 {"session_ids" , true },
226226 {"userIds" , true },
227- // Exact match "signature" should be skipped.
227+ // Signature fields should be skipped (any key ending in "signature") .
228228 {"signature" , true },
229+ {"thinkingSignature" , true },
230+ {"thinking_signature" , true },
229231 // Path-related fields should be skipped.
230232 {"filePath" , true },
231233 {"file_path" , true },
@@ -245,7 +247,7 @@ func TestShouldSkipJSONLField(t *testing.T) {
245247 {"args" , false },
246248 {"video" , false }, // ends in "o", not "id"
247249 {"identify" , false }, // ends in "ify", not "id"
248- {"signatures" , false }, // not exact match "signature"
250+ {"signatures" , false }, // does not end in "signature"
249251 {"signal_data" , false },
250252 {"consideration" , false }, // contains "id" but doesn't end with it
251253 }
@@ -292,6 +294,22 @@ func TestJSONLContent_SkippedFieldValueCollision(t *testing.T) {
292294 }
293295}
294296
297+ func TestJSONLContent_PreservesThinkingSignature (t * testing.T ) {
298+ t .Parallel ()
299+ // Oh My Pi stores extended-thinking signatures under "thinkingSignature".
300+ // Their base64 value is high-entropy; redacting it corrupts the signature and
301+ // breaks replay with "Invalid `signature` in `thinking` block".
302+ input := `{"type":"thinking","thinking":"plan","thinkingSignature":"` + highEntropySecret + `"}`
303+
304+ result , err := JSONLContent (input )
305+ if err != nil {
306+ t .Fatalf ("unexpected error: %v" , err )
307+ }
308+ if ! strings .Contains (result , `"thinkingSignature":"` + highEntropySecret + `"` ) {
309+ t .Fatalf ("expected thinkingSignature to be preserved verbatim, got: %s" , result )
310+ }
311+ }
312+
295313func TestString_PatternDetection (t * testing.T ) {
296314 // These secrets have entropy below 4.5 so entropy-only detection misses them.
297315 // Betterleaks pattern matching should catch them.
0 commit comments