@@ -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)
5060pub 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