Skip to content

Commit b4b63ea

Browse files
author
Antigravity Agent
committed
feat(queen): integrate gamma_agent with queen_bridge GitHub API (#386)
- Add logIssueOpened() using logGitHubIssueStart() - Update logIssueEvent() to use specialized GitHub APIs - Gamma agent now creates proper episodes for GitHub issues φ² + 1/φ² = 3 = TRINITY
1 parent c37d627 commit b4b63ea

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

src/tri/queen/gamma_agent.zig

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ pub fn mapPullRequestAction(action: []const u8) queen_bridge.StepType {
4646
return .observe; // default
4747
}
4848

49-
/// Create episode from GitHub issue event
49+
/// Create episode from GitHub issue opened event
50+
pub fn logIssueOpened(
51+
allocator: Allocator,
52+
issue_number: u32,
53+
title: []const u8,
54+
labels: []const []const u8,
55+
) !void {
56+
try queen_bridge.logGitHubIssueStart(allocator, "gamma", issue_number, title, labels);
57+
}
58+
59+
/// Create episode from GitHub issue action (legacy, use specific functions)
5060
pub fn logIssueEvent(
5161
allocator: Allocator,
5262
queen_url: []const u8,
@@ -56,15 +66,23 @@ pub fn logIssueEvent(
5666
thought: ?[]const u8,
5767
) !void {
5868
_ = queen_url;
59-
const step_type = mapIssueAction(action);
69+
_ = thought; // TODO: use thought in episode data
70+
71+
// For opened issues, use specialized API
72+
if (std.mem.eql(u8, action, "opened") or std.mem.eql(u8, action, "reopened")) {
73+
// Empty labels slice for now
74+
try queen_bridge.logGitHubIssueStart(allocator, "gamma", issue_number, title, &[_][]const u8{});
75+
return;
76+
}
6077

78+
// For other actions, use general logStep
79+
const step_type = mapIssueAction(action);
6180
try queen_bridge.logStep(allocator, .{
6281
.agent = "gamma",
6382
.issue_number = issue_number,
64-
.step_name = action,
83+
.step_name = title,
6584
.step_type = step_type,
66-
.thought = thought,
67-
.action = if (step_type == .act) title else null,
85+
.action = action,
6886
.result = if (step_type == .success) "Issue closed" else null,
6987
});
7088
}

0 commit comments

Comments
 (0)