Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

fix(acp): keep WebSocket on desktop resume so prompt cache hits

justrach1075772be404
diff --git a/src/acp.zig b/src/acp.zig
index 1cdf546a..4476e622 100644
--- a/src/acp.zig
+++ b/src/acp.zig
@@ -178,8 +178,7 @@ pub fn runAcpCommand(gpa: Allocator, io: Io, environ_map: anytype, root: *agent_
_ = client;
main_mod.unattended = true;
root.in = null;
- root.out = null;
- root.stream_quiet = true;
+ root.out = null; // not stream_quiet: that forces SSE and misses resume cache
main_mod.g_out = null;
engine.implementation_version = main_mod.harness_version;
engine.cancel_flag.store(false, .release);
@@ -469,6 +468,7 @@ test "isAcpSubcommand claims only `acp`, and arms the stdout discipline" {
test {
_ = @import("acp_protocol.zig");
_ = @import("acp_stream.zig");
+ _ = @import("transport_gate.zig");
}
test "ACP advertises the complete REPL command catalog including compact" {
diff --git a/src/transport_gate.zig b/src/transport_gate.zig
index 09b1ae06..868b3d93 100644
--- a/src/transport_gate.zig
+++ b/src/transport_gate.zig
@@ -2,6 +2,7 @@
//! Lean `Graff.Transport.eligible` is the spec. This file is the shared
//! boolean so the 96-cell fixture test does not construct an Agent.
+const std = @import("std");
const Provider = @import("provider.zig").Provider;
pub const Flags = struct {
@@ -31,3 +32,10 @@ pub fn kindFromName(name: []const u8) ?Provider.Kind {
}
const std_mem = @import("std").mem;
+
+test "quiet forces SSE; a live root Responses turn without quiet is WS" {
+ const ws = Flags{ .kind = .responses, .is_sub = false, .codex_ws = true, .ws_off = false, .has_out = true, .quiet = false };
+ const quiet = Flags{ .kind = .responses, .is_sub = false, .codex_ws = true, .ws_off = false, .has_out = true, .quiet = true };
+ try std.testing.expect(eligible(ws));
+ try std.testing.expect(!eligible(quiet));
+}