Skip to content

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

Python

Say why a role persona's provider pin was ignored

Rach Pradhan79dc546c6cc4
diff --git a/src/subagent_pin_qualified_tests.zig b/src/subagent_pin_qualified_tests.zig
index a9fb513a..ce0382cb 100644
--- a/src/subagent_pin_qualified_tests.zig
+++ b/src/subagent_pin_qualified_tests.zig
@@ -45,3 +45,18 @@ test "a <provider>/<model> pin seats a role on another provider only with consen
keys.values = @splat(null);
try std.testing.expectEqual(pin_mod.Outcome.no_login, pin_mod.resolve(codexBase(), scout).outcome);
}
+
+test "an ignored cross-provider pin is named in the worker's report" {
+ const vision_ask = @import("vision_ask.zig");
+ const gpa = std.testing.allocator;
+ const refused: vision_ask.Ask = .{ .pin = .{ .outcome = .cross_provider_unconsented, .source = .persona } };
+ const flagged = vision_ask.flagText(gpa, try gpa.dupe(u8, "the brief"), refused);
+ defer gpa.free(flagged);
+ try std.testing.expect(std.mem.indexOf(u8, flagged, "--allow-cross-provider-subagents") != null);
+ try std.testing.expect(std.mem.endsWith(u8, flagged, "the brief"));
+ // A pin that applied adds nothing.
+ const seated: vision_ask.Ask = .{ .pin = .{ .outcome = .pinned, .source = .persona } };
+ const clean = vision_ask.flagText(gpa, try gpa.dupe(u8, "the brief"), seated);
+ defer gpa.free(clean);
+ try std.testing.expectEqualStrings("the brief", clean);
+}
diff --git a/src/vision_ask.zig b/src/vision_ask.zig
index 6dc1ed29..1672bf94 100644
--- a/src/vision_ask.zig
+++ b/src/vision_ask.zig
@@ -366,6 +366,13 @@ pub const pinned_warning = "[vision warning] this task names an image and the wo
/// have BEEN a vision ask: a disclaimer in a report about anything else is
/// prose, not a capability admission.
pub fn warningFor(ask: Ask, report: []const u8) ?[]const u8 {
+ // A role persona that names another provider and could not be seated
+ // there ran on the session default instead: say why, where the user and
+ // the parent model both see it, not only in the trace.
+ switch (ask.pin.outcome) {
+ .cross_provider_unconsented, .no_login => return ask.pin.outcome.describe(),
+ else => {},
+ }
if (!ask.isAsk()) return null;
if (disclaimed(report)) return disclaimer_warning;
return if (ask.pinned_blind) pinned_warning else null;