agent: use zenai's hasImage

zenai exports it now; drop the local copy and re-pin.
This commit is contained in:
Adrià Arrufat authored and GitHub committed 2026-08-27 16:49:18 +02:00
1 parent 051a70cfdd
commit 7318fbfcec
2 files changed
+3 -8

No files matched your search

+2 -2
View File
@@ -36,8 +36,8 @@
.hash = "sqlite3-3.53.2-DMxLWuAOAAA_Px0arJOIOaP4AKEu5prbsQgPMA35W1zz",
},
.zenai = .{
.url = "git+https://github.com/lightpanda-io/zenai.git#b76da59f1b7c36d367a0914adf60a72ca6d87dd4",
.hash = "zenai-0.0.0-iOY_VEm3BgDBXrcf-iedI2lNaTE5oF7vyG0AxB85b-2q",
.url = "git+https://github.com/lightpanda-io/zenai.git#be5d2e70d3dcc9866041dbdbcfa1f18799601a30",
.hash = "zenai-0.0.0-iOY_VE23BgCNT-WtrAC6BM1J_G98bSk6kD0v8g09XWYA",
},
.isocline = .{
.url = "git+https://github.com/arrufat/isocline?ref=lightpanda#832a9fe25f5f4458fcc47b5acc7c21db669c2f47",
+1 -6
View File
@@ -85,7 +85,7 @@ fn expireImages(self: *Conversation) void {
const results = msg.tool_results orelse continue;
var stripped: ?[]zenai.provider.ToolResult = null;
for (results, 0..) |res, n| {
if (!hasImage(res.parts orelse continue)) continue;
if (!zenai.provider.hasImage(res.parts orelse continue)) continue;
if (budget > 0) {
budget -= 1;
continue;
@@ -99,11 +99,6 @@ fn expireImages(self: *Conversation) void {
}
}
fn hasImage(parts: []const zenai.provider.ContentPart) bool {
for (parts) |part| if (part == .image) return true;
return false;
}
/// Cap history growth: expire stale images, then once history exceeds
/// `prune_high`, keep the system prompt plus the most recent `prune_keep`
/// messages, snapped to a safe boundary so a tool_call isn't split from its