diff options
| author | t <t@tjp.lol> | 2026-06-18 14:15:55 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-06-18 14:16:24 -0600 |
| commit | 270cd00129551647e7c764a13836e03e0b2dc4e2 (patch) | |
| tree | f939bbf999dd67d996b4025b03dbfe4abd30b9f4 /libpanto/src/openai_responses_json.zig | |
| parent | 7c2d8825660f73198149c0b2ce26166b16ba3532 (diff) | |
preserve signature origins across compactions
Diffstat (limited to 'libpanto/src/openai_responses_json.zig')
| -rw-r--r-- | libpanto/src/openai_responses_json.zig | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libpanto/src/openai_responses_json.zig b/libpanto/src/openai_responses_json.zig index 295e79c..fb98fe1 100644 --- a/libpanto/src/openai_responses_json.zig +++ b/libpanto/src/openai_responses_json.zig @@ -199,8 +199,9 @@ fn writeInputForMessage( if (block != .Thinking) continue; const tb = block.Thinking; const sig = tb.signature orelse continue; - const origin = tb.signature_origin orelse continue; - if (!origin.matches( + if (!conversation.thinkingSignatureMatches( + tb, + msg.identity, if (dialect == .codex) .openai_codex_responses else .openai_responses, cfg.base_url, cfg.model, @@ -643,9 +644,7 @@ test "responses serializeRequest - assistant phase metadata and reasoning signat var conv = conversation.Conversation.init(allocator); defer conv.deinit(); - const sig = try allocator.dupe(u8, - "{\"type\":\"reasoning\",\"id\":\"rs_1\",\"encrypted_content\":\"sealed\"}" - ); + const sig = try allocator.dupe(u8, "{\"type\":\"reasoning\",\"id\":\"rs_1\",\"encrypted_content\":\"sealed\"}"); const thinking = try conversation.textualBlockFromSlice(allocator, "thinking"); const text = try conversation.textualBlockFromSlice(allocator, "answer"); try conv.addAssistantMessage(&.{ @@ -676,9 +675,7 @@ test "responses serializeRequest - mismatched signature origin skips reasoning r var conv = conversation.Conversation.init(allocator); defer conv.deinit(); - const sig = try allocator.dupe(u8, - "{\"type\":\"reasoning\",\"id\":\"rs_1\",\"encrypted_content\":\"sealed\"}" - ); + const sig = try allocator.dupe(u8, "{\"type\":\"reasoning\",\"id\":\"rs_1\",\"encrypted_content\":\"sealed\"}"); try conv.addAssistantMessage(&.{ .{ .Thinking = .{ .text = try conversation.textualBlockFromSlice(allocator, "thinking"), .signature = sig } }, .{ .Text = try conversation.textualBlockFromSlice(allocator, "answer") }, |
