summaryrefslogtreecommitdiff
path: root/src/system_prompt.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/system_prompt.zig')
-rw-r--r--src/system_prompt.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/system_prompt.zig b/src/system_prompt.zig
index d8c06bb..500b135 100644
--- a/src/system_prompt.zig
+++ b/src/system_prompt.zig
@@ -249,7 +249,7 @@ pub fn resolveCompactionLayers(
/// seed sequence). Returned slices borrow from `messages`.
fn effectiveConfigWindow(
arena: Allocator,
- messages: []const panto.conversation.Message,
+ messages: []const panto.Message,
) ![]const []const u8 {
// Find the index of the last message carrying a `replace`-mode block.
var anchor: ?usize = null;
@@ -462,9 +462,9 @@ const TmpLayers = struct {
}
};
-fn openTmpStore(arena: Allocator, root: []const u8) !panto.session_manager.FileSystemJSONLStore {
+fn openTmpStore(arena: Allocator, root: []const u8) !panto.FileSystemJSONLStore {
const sessions = try std.fs.path.join(arena, &.{ root, "sessions" });
- return panto.session_manager.FileSystemJSONLStore.init(testing.allocator, testing.io, sessions, "/cwd");
+ return panto.FileSystemJSONLStore.init(testing.allocator, testing.io, sessions, "/cwd");
}
/// Minimal agent harness for system-prompt tests: a throwaway provider
@@ -472,12 +472,12 @@ fn openTmpStore(arena: Allocator, root: []const u8) !panto.session_manager.FileS
/// store). Post-R1 the agent owns its own (empty) tool registry, so the
/// harness only holds the config to keep the agent's borrowed pointer valid.
const SPAgentHarness = struct {
- config: panto.config.Config,
+ config: panto.Config,
agent: panto.agent.Agent,
fn init(
self: *SPAgentHarness,
- session: panto.session_store.Session,
+ session: panto.Session,
adopted: ?panto.conversation.Conversation,
) void {
self.config = .{
@@ -499,8 +499,8 @@ fn forceFlush(agent: *panto.agent.Agent) !void {
var conv = panto.conversation.Conversation.init(testing.allocator);
defer conv.deinit();
try conv.addAssistantMessage(&.{});
- const id: panto.session_store.WireIdentity = .{ .api_style = .openai_chat, .base_url = "u", .model = "m" };
- var batch = [_]panto.session_store.PersistentMessage{
+ const id: panto.WireIdentity = .{ .api_style = .openai_chat, .base_url = "u", .model = "m" };
+ var batch = [_]panto.PersistentMessage{
.{ .message = conv.messages.items[0], .identity = id },
};
try agent.session.append(&batch);
@@ -537,7 +537,7 @@ test "seedFresh then no-config-change resume is a no-op" {
// The persisted conversation reflects the seeded system prompt.
var conv_disk = (try store.load(session_id)).?;
- const eff_disk = try panto.conversation.effectiveSystemBlocks(arena, conv_disk.messages.items);
+ const eff_disk = try panto.effectiveSystemBlocks(arena, conv_disk.messages.items);
const seeded_count = eff_disk.items.len;
conv_disk.deinit();
try testing.expect(seeded_count > 0);
@@ -550,7 +550,7 @@ test "seedFresh then no-config-change resume is a no-op" {
h2.init(sess2, conv2);
defer h2.deinit();
try reconcileResumeLayers(arena, testing.io, null, null, project_dir, &h2.agent);
- const eff_after = try panto.conversation.effectiveSystemBlocks(arena, h2.agent.conversation.messages.items);
+ const eff_after = try panto.effectiveSystemBlocks(arena, h2.agent.conversation.messages.items);
try testing.expectEqual(seeded_count, eff_after.items.len);
}
@@ -593,7 +593,7 @@ test "resume after config change appends replace + append sequence" {
try reconcileResumeLayers(arena, testing.io, null, null, project_dir, &h2.agent);
// The effective prompt now reflects only the new config blocks.
- const eff = try panto.conversation.effectiveSystemBlocks(arena, h2.agent.conversation.messages.items);
+ const eff = try panto.effectiveSystemBlocks(arena, h2.agent.conversation.messages.items);
try testing.expectEqual(@as(usize, 2), eff.items.len);
try testing.expectEqualStrings("new seed", eff.items[0]);
try testing.expectEqualStrings("new append", eff.items[1]);
@@ -601,7 +601,7 @@ test "resume after config change appends replace + append sequence" {
// A second no-op resume must not change the effective prompt (anchors
// to the new `replace` window, not the stale original seed).
try reconcileResumeLayers(arena, testing.io, null, null, project_dir, &h2.agent);
- const eff2 = try panto.conversation.effectiveSystemBlocks(arena, h2.agent.conversation.messages.items);
+ const eff2 = try panto.effectiveSystemBlocks(arena, h2.agent.conversation.messages.items);
try testing.expectEqual(@as(usize, 2), eff2.items.len);
}