Skip to content

A programming framework for agentic AI

[gh-flow] If Item.Message is null it tries to post empty messages (#42)

Carlos Garcia Lalicatacc66a1ca714c
diff --git a/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs b/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs
index 4a9dfe253..cfe30aeb5 100644
--- a/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs
+++ b/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs
@@ -34,7 +34,7 @@ public class Hubber : Agent
case nameof(GithubFlowEventType.DevPlanGenerated):
case nameof(GithubFlowEventType.CodeGenerated):
var contents = string.IsNullOrEmpty(item.Message)? "Sorry, I got tired, can you try again please? ": item.Message;
- await PostComment(item.Data["org"], item.Data["repo"], long.Parse(item.Data["issueNumber"]), item.Message);
+ await PostComment(item.Data["org"], item.Data["repo"], long.Parse(item.Data["issueNumber"]), contents);
break;
case nameof(GithubFlowEventType.DevPlanCreated):
{
diff --git a/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs b/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs
index 745a822ec..6c50c2938 100644
--- a/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs
+++ b/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs
@@ -71,7 +71,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error committing to branch");
- throw;
+ throw;
}
}
@@ -85,7 +85,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error creating branch");
- throw;
+ throw;
}
}
@@ -100,7 +100,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error getting main language");
- throw;
+ throw;
}
}
@@ -120,7 +120,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error creating issue");
- throw;
+ throw;
}
}
@@ -134,7 +134,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error creating PR");
- throw;
+ throw;
}
}
@@ -147,7 +147,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error posting comment");
- throw;
+ throw;
}
}
@@ -161,7 +161,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error getting files");
- throw;
+ throw;
}
}
@@ -192,7 +192,7 @@ public class GithubService : IManageGithub
catch (Exception ex)
{
_logger.LogError(ex, "Error collecting files");
- throw;
+ throw;
}
}
}